diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-01-11 17:42:55 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-01-11 17:42:55 +0000 |
commit | fae6b541ae866c6e48172af0726e163ae2992f7f (patch) | |
tree | 93edde2ad66c127f591c36e28f1c102cf0e05b41 /Lua/game | |
parent | 02da971050b39cca776ef99a87edc994f27861da (diff) | |
download | usdx-fae6b541ae866c6e48172af0726e163ae2992f7f.tar.gz usdx-fae6b541ae866c6e48172af0726e163ae2992f7f.tar.xz usdx-fae6b541ae866c6e48172af0726e163ae2992f7f.zip |
removed lua testplugin
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2070 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Lua/game')
-rw-r--r-- | Lua/game/plugins/LuaTest.usdx | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/Lua/game/plugins/LuaTest.usdx b/Lua/game/plugins/LuaTest.usdx deleted file mode 100644 index 553fca13..00000000 --- a/Lua/game/plugins/LuaTest.usdx +++ /dev/null @@ -1,65 +0,0 @@ -function plugin_init()
- register('lua interface test plugin', 'not Versioned', 'Hawkear');
-
- require('Usdx.Gl', 'Usdx.TextGl', 'Usdx.ScreenSing');
-
- Usdx.Hook('Display.Draw', 'OnDraw');
-
- return true
-end
-
-function OnDraw()
- -- Calculate FPS
- FPScounter = 1 + (FPScounter or 0) -- increment FPScounter (which is nil, when undefined, therefore "or 0")
- if Usdx.Time() > (LastTime or 0) then
- LastTime = Usdx.Time() + 1000
-
- print("FPS: " .. FPScounter - (LastFPScounter or 0)) -- print is only displayed, if compiled with DEBUG
- LastFPSCounted = FPScounter - (LastFPScounter or 0)
-
- LastFPScounter = FPScounter
-
- -- Show the first 200 Textures
- TexNum = 1 + (TexNum or 0)
- if TexNum > 200 then TexNum = 1 end
- print("TexNum: " .. (TexNum or 0))
- end
-
- -- draw fps to top right corner
- TextGl.Style(0)
- TextGl.Pos(650, 36)
- TextGl.Size(30)
- TextGl.Italic(False)
- Gl.Color(0.9, 0.9, 0.9, 0.7)
- TextGl.Print('FPS: ' .. LastFPSCounted)
-
- TextGl.Pos(650, 50)
- TextGl.Print('Beat: ' .. ScreenSing.GetBeat())
-
- -- Draw some rectanGles
- Gl.Enable("Gl_BLEND")
- Gl.Color(1, 1, 1, 0.5)
- for i = 1,10 do
- Gl.Begin("Gl_LINE_loop")
- Gl.Vertex(0+4*i, 0+4*i);
- Gl.Vertex(0+4*i, 600-4*i);
- Gl.Vertex(800-4*i, 600-4*i);
- Gl.Vertex(800-4*i, 0+4*i);
- Gl.End()
- end
- Gl.Disable("Gl_BLEND")
-
- -- Display a Texture
- Gl.Enable("Gl_BLEND")
- Gl.Enable("Gl_TEXTURE_2D")
- Gl.Color(1, 1, 1, 1)
- Gl.BindTexture("Gl_TEXTURE_2D", TexNum or 0)
- Gl.Begin("Gl_QUADS")
- Gl.TexCoord(0, 0); Gl.Vertex(10, 10);
- Gl.TexCoord(0, 1); Gl.Vertex(10, 110);
- Gl.TexCoord(1, 1); Gl.Vertex(110, 110);
- Gl.TexCoord(1, 0); Gl.Vertex(110, 10);
- Gl.End()
- Gl.Disable("Gl_TEXTURE_2D")
- Gl.Disable("Gl_BLEND")
-end
\ No newline at end of file |