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 / Shapes not showing up-Help!

Author
Message
JACrosman
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location:
Posted: 9th Aug 2009 04:22
Hi,
I have been working out of one of the Gaddis C++ books and have been working through the Dark GDK section. A couple of functions do not display anything at all on the screen when I call them. dbCircle and dbDot. dbLine works fine, I am just wondering if there may be something I am missing? Thanks a bunch!

-Josh
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Aug 2009 21:42
Don't own the book, so a little code would be helpful.

JACrosman
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location:
Posted: 9th Aug 2009 22:01
Ok will do, here is just some simple code where i am trying to make a target like shape.



-Josh
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Aug 2009 22:09 Edited at: 9th Aug 2009 22:09
There's no standard sync loop in that code - your display isn't being updated.

GDK uses a double-buffering system. There are two displays - the one you currently see, and the one you are currently drawing to. Once you have finished drawing, you need to use the dbSync() function to switch the two. Your code doesn't have that.

Replace the dbWaitKey() function call with this:


Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 9th Aug 2009 22:09
Where's the dbSync() call? Where's the call to clear the screen before drawing?

Makes me kind wonder about whether the author actually tested the code.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 9th Aug 2009 22:13
No kidding Lil.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
JACrosman
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location:
Posted: 10th Aug 2009 00:19
Ahh, ok gotcha. Thanks for the help everyone!

-Josh

Login to post a reply

Server time is: 2024-11-20 17:31:17
Your offset time is: 2024-11-20 17:31:17