PollEvent / WaitEvent with GLGraphics()
BlitzMax Forums/BlitzMax Beginners Area/PollEvent / WaitEvent with GLGraphics()
| ||
This is the relevant code, basicly I'm using GLGraphics in a init() function of a type.' Main Program Repeat ' Event Repeat PollEvent( ) Select EventID( ) Case EVENT_WINDOWCLOSE gl.g.Close( ) Print "*** close already!!!" Default End Select Until EventID( ) = 0 ' Render gl.render( ) Until KeyDown( KEY_ESCAPE ) I doesn't work, and I've been looking for examples, tutorials etc on the net. I'm gonna try using WaitEvent however at this particular point I don't want anything to wait so to say. Edit: Sorry, curse removed. Last edited 2011 |
| ||
Do you really need to poll the events? Why not use AppTerminate in your repeat loop?Repeat Until KeyDown( KEY_ESCAPE ) or AppTerminate() |
| ||
Wow, that's great. I didn't know about AppTerminate(), thank you very much! |
| ||
It seems I'll need MaxGUI for retrieving and setting mouse position and have to go with a PollEvent/WaitEvent either way. Still happy to know about AppTerminate() though. I'll be searching for more examples on PollEvent and SetMousePosition() (or whatever the command is) but would be very happy if anyone could show me an example on how to do the above. Nevermind, forgot the commands I needed are: MoveMouse( ) and HideMouse( ) This is all I need, thanks again. Last edited 2011 |