Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / game loop problems

Author
Message
Rids
13
Years of Service
User Offline
Joined: 11th Nov 2010
Location:
Posted: 11th Nov 2010 12:00
Not sure if this is a C++ issue or DarkGDK...anyway, I have a standard game loop running with dbSyncOn(); dbSyncRate(60); then a while(LoopGDK()); yada yada yada dbSync(); all my curly brackets are in the right place. I have no compile errors, no warnings. The loop is set on a counter and it exits the loop at the right time as much as I can tell. After the loop is exited, I have some dbPrint statements displaying the score. The problem is these statements flash for a split second then disapear. They are not in the loop so I can't figure it out. I put dbWaitKeys infront of the dbprints and after them and they still flash and disappear. I also tried a dbWait(5000) after the dbPrint statements and they still flash and disappear.....any help with this would be greatly appreciated!!!
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 11th Nov 2010 13:47
you explanation is somewhat confusing hehe, mind showing some code? flashing usually happens because after dbSync the text no longer exist on the system, so the next dbSync after it won't draw the text unless you draw it again before this second sync, this is why you see text being drawn in loops in alot of GDK programs

[url][/url]
Nothing's impossible, it's just a matter of time...
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 11th Nov 2010 21:02
As Hassan said, probably a dbSync is missing after the dbPrint statements. It should work in dbPrint, dbSync, dbWaitKey order.
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 13th Nov 2010 00:33 Edited at: 13th Nov 2010 00:36
It sounds like he's trying to dbPrint() after the LoopGDK loop. In which case, the GDK stuff isn't even initialized any more - after breaking out of the LoopGDK loop - as the LoopGDK Handles all of the GDK internals (right?)

But to be sure, how about adding one more dbSync() after that dbPrint and before the dbWait...

JTK

EDIT: Sorry Mireben, I guess I should have completely read your post before responding... late at that!
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 13th Nov 2010 11:34
No problem. At first I was wondering too if it is possible at all to print something after the loop finished, but I tested it before posting and it worked.
Malboro Jones
14
Years of Service
User Offline
Joined: 10th Dec 2009
Location: Wales - UK
Posted: 18th Nov 2010 18:38 Edited at: 18th Nov 2010 18:43
Do you have dbCls() at the start of your loop? if so and the print statements are outside the loop then cls will clear them from the screen, if you put them before sync() then they will show.

Edit:

Sorry, didn't read your question properly

Ye, the commands probably wont work after the loop because "loopGDK" will be false and everything is probably gotten rid of.

Don't make war, make tea.

Login to post a reply

Server time is: 2024-06-30 10:30:03
Your offset time is: 2024-06-30 10:30:03