Something is wrong here...

BlitzMax Forums/BlitzMax Beginners Area/Something is wrong here...

degac(Posted 2007) [#1]
Try to run this simple program. It displays on the screen a number, then wait for a second, then again it displays a number.

SuperStrict
Graphics 640 , 480
Local x:Int
While x < 1000
	Cls
	DrawText X , 100 , 100
	Flip
	x:+1
Wend
x = 0
Delay 1000
While x < 1000
	Cls
	DrawText X , 200 , 100
	Flip
	x:+1
Wend


case 1: if I start the program and I DONT' MOVE the windows, it works as expected

case 2: if I try to move the window or click on the window I lock the application; sometimes I have an OS error sometimes nothing...

It's the same on your computer or it's my computer that's starting to going crazy?
Thanks


rockford(Posted 2007) [#2]
Well, it's not just your computer (Windows pc) :s


dmaz(Posted 2007) [#3]
well, this should be in the bug forum... it happens on mine but the program doesn't stop running just the display. my stop around 320 or so both in opengl and directx but add a print statement and you will see that the program continues.

SuperStrict
Graphics 640 , 480
Local x:Int
While x < 1000
	Cls
	DrawText X , 100 , 100
	Print x
	Flip 1
	x:+1
Wend



degac(Posted 2007) [#4]
Yep! Thanks.

I was hoping it was a problem with my computer...sigh!
I tried with debug/no debug, restarting windows, closing all the processes not needed...but nothing I have (and you have at this point...) the same problem.

Well - some new works for Marks...


MGE(Posted 2007) [#5]
One thing I learned through trial and error during my last 2 1/2 months of using Blitzmax, always put an AppSuspended() call at the start of any loop. This takes care of the problem.

SuperStrict
Graphics 640 , 480
Local x:Int
While x < 1000
    While AppSuspended()
     Delay 1
    Wend
	Cls
	DrawText X , 100 , 100
	Flip
	x:+1
Wend
x = 0
Delay 1000
While x < 1000
    While AppSuspended()
     Delay 1
    Wend
	Cls
	DrawText X , 200 , 100
	Flip
	x:+1
Wend



degac(Posted 2007) [#6]
Thanks! A simple and elegant solution.