# .compile-only. # .require. Tao.Sdl.dll # .require. Tao.OpenGl.dll # .args. -c|-r:Tao.Sdl|-r:Tao.OpenGl|-lib:C:\Program Files\Tao\examples """ cobra -r:Tao.Sdl -lib:"C:\Program Files\Tao\examples" tao.cobra """ use Tao.Sdl use Tao.OpenGl class Program def main is shared Sdl.sdl_Init(Sdl.sdl_INIT_EVERYTHING) surfacePtr = Sdl.sdl_SetVideoMode(640, 480, 32, Sdl.sdl_HWSURFACE|Sdl.sdl_DOUBLEBUF|Sdl.sdl_ANYFORMAT) CobraCore.noOp(surfacePtr) def foo(evt as Sdl.SDL_Event) evt2 as Sdl.SDL_Event evt2 = evt CobraCore.noOp(evt2) def foo1 evt as Sdl.SDL_Event Sdl.sdl_Init(Sdl.sdl_INIT_EVERYTHING) surfacePtr = Sdl.sdl_SetVideoMode(640,480,32,Sdl.sdl_HWSURFACE|Sdl.sdl_DOUBLEBUF|Sdl.sdl_ANYFORMAT|Sdl.sdl_OPENGL) h = 640.0f / 480.0f Gl.glViewport(0, 0, 640, 480) Gl.glMatrixMode(Gl.gl_PROJECTION) Gl.glLoadIdentity Gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f) Gl.glMatrixMode(Gl.gl_MODELVIEW) Gl.glLoadIdentity Gl.glTranslatef(0.0 to Single, 0.0 to Single, -40.0 to Single) while true Sdl.sdl_PollEvent(out evt) branch evt.type # use a read/write field on Sdl.sdl_QUIT # branch on a qualified const int field break CobraCore.noOp(surfacePtr)