Closing Window Bug
Blitz3D Forums/Blitz3D Beginners Area/Closing Window Bug
| ||
I'm sure this bug is just on my system, and it must be temporary cause I haven't run into anything like it before. Basically, take the following code for example: Graphics 800,600,32,2 Repeat Until KeyHit(1) End When DEBUG is turned on, it works fine, I can press ESC or hit the X to close the window. However, when DEBUG is turned off, the only way to close the program is to task-manager END TASK it, or hit escape - the X button does nothing. ALT-F4 does nothing. Any ideas whats causing this? I'm guessing a reboot would probably fix it, but if something else is an issue I'd like to explore it a little more. Replacing the loop with "While not keyhit(1):wend" doesn't work either. However replacing the loop with WAITKEY() works fine. That leads me to the conclusion that program is hogging too many resources to let the GDI work.. but if that's the case, how does it even have enough cycles to let me press ESC, let alone running a movie and winamp in other windows.. And if that is a CPU usage issue, then how can I possibly create a loop with anything ELSE in it (ie, collision detection, etc) that isn't going to chew up even more resources? My last question for tonight, I promise. :) +BlackD |
| ||
That program's locked in a tight loop that doesn't give the OS time to respond to your 'close' message (clicking the close gadget, hitting Alt-F4, pressing ESC, etc). If you stick just about any old command in there, it'll cause a slight delay (eg. many commands will internally read Windows events to be able to update the window), giving the OS enough time to do its 'close window' stuff. If you're using Blitz 3D, it's always going to be a bit of a CPU hog, unless you add a 'Delay' command in the main loop, but if it's Blitz Plus, you can/should use the event commands to make your program play nicely with the OS. |