BMX NG Bug?

BlitzMax Forums/BlitzMax Programming/BMX NG Bug?

Caton(Posted 2016) [#1]
Blitzmax only starts and updates main loop when my mouse is on app screen.

timer will not update unless I have mouse on app screen and clicking or moving it around.

anyway of fixing this

Import MaxGui.Drivers
Graphics 800,600
While True
Cls
Select WaitEvent()
Case EVENT_WINDOWCLOSE, EVENT_APPTERMINATE
EndGraphics()
End
EndSelect
UpdateGame()
Flip
Wend
EndGraphics
End



RustyKristi(Posted 2016) [#2]
You're inquiring about basic functions and not BMX-NG bug. Read the manual and examples about WaitEvents,

https://en.wikibooks.org/wiki/BlitzMax/Modules/Events/Event_queue


Caton(Posted 2016) [#3]
Could I please have a example? so it works and it updates by it's self, so I don't have to move the mouse around the app screen a bunch of times to get the timer to update.


Derron(Posted 2016) [#4]
Read the document RustyKristi linked to.

Still no clue what to do?

Read it again ... this time carefully.

Still no clue what to do?

Function WaitEvent()

Description: Get the next event from the event queue, waiting if necessary



-> using WaitEvent() waits until an event happened (in this case: your mouse moving around).


Maybe PollEvent will do what you want.



bye
Ron


Caton(Posted 2016) [#5]
okay I tried this.
Graphics 800,600
While Not KeyHit(KEY_ESCAPE)
Cls
Select WaitEvent()
Case EVENT_WINDOWCLOSE, EVENT_APPTERMINATE
EndGraphics()
End
Default
UpdateProgram()
EndSelect
Flip
Wend
EndGraphics
End



Derron(Posted 2016) [#6]
Learn to read... I just tried what I suggested and that worked fine..


bye
Ron


Caton(Posted 2016) [#7]
well it didn't work. when I remove wait event it does work.


Derron(Posted 2016) [#8]
Well...it did work fine here.

Replacing waitevent with pollevent.


Bye
Ron


grable(Posted 2016) [#9]
Timers produce events too, so even WaitEvent() will return when it fires.
Without a more complete sample its hard to know what your really complaining about, because WaitEvent() does exactly what its supposed to do.

SuperStrict

Import MaxGui.Drivers

Graphics 800,600

CreateTimer(60)

While True
	Cls
	
	Select WaitEvent()
		Case EVENT_WINDOWCLOSE, EVENT_APPTERMINATE
			Exit
		Case EVENT_TIMERTICK
			Print "timer update"
	EndSelect
	
	Flip
Wend

EndGraphics
End



Midimaster(Posted 2016) [#10]
Dear Caton,

it is a little bit "difficult" to help you, when you do not read our helps carefully and when you do not follow the instructions. You asked a nearly same question yesterday and I gave you the answer with the TIMER (and some more help)

http://www.blitzbasic.com/Community/post.php?topic=106702&post=1314994

Why do you start a new thread instead of asking for further clarification in the old one?

To use a...
Global Timer=CreateTimer(60)
...is a easy way to care about enough events to kepp your game alive.