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 / Drawing lines

Author
Message
LeonardInO 49
13
Years of Service
User Offline
Joined: 26th Feb 2011
Location:
Posted: 26th Feb 2011 21:47
I have the book Games & Graphicxs in C++ by Tony Gaddis. I am trying to run a couple of the sample line drawing code. Everything compiles ok but the lines either do not show up or only one or two show up. Does anybody know what may be casueing this. DarkGDK seems to be installed ok. Thanks
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 26th Feb 2011 23:55
Can we see some code?


LeonardInO 49
13
Years of Service
User Offline
Joined: 26th Feb 2011
Location:
Posted: 27th Feb 2011 01:36
// This is an example Dark GDK program.
#include "DarkGDK.h"

void DarkGDK()
{
// Variables for the center points.
int x = 319, y = 239;

// Draw concentric circles.
for (int radius = 50; radius <= 200; radius += 50)
dbCircle(x, y, radius);

// Wait for the user to press a key.
dbWaitKey();
}
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 27th Feb 2011 11:55 Edited at: 27th Feb 2011 12:16
The way the first Gaddis book examples are structured is not the recommended way of using Dark GDK. Usually you have a loop and use dbSync to update the screen. (However, recommended or not, this should still work.)

Do you have NVidia video card? If yes, you might be affected by this bug.

http://forum.thegamecreators.com/?m=forum_view&t=158209&b=15

The circles show up all right on a computer with ATI video card. One thing you can try is to change the program the "recommended way" and redraw your circles every loop like this:



If that fails as well, here are some workaround functions that you can use instead of dbCircle and dbEllipse. (And please, if the above code still doesn't show any circles on your machine and you do have an NVidia card, then add your experience to the problem report thread.)

http://forum.thegamecreators.com/?m=forum_view&t=158250&b=22&p=0
LeonardInO 49
13
Years of Service
User Offline
Joined: 26th Feb 2011
Location:
Posted: 27th Feb 2011 21:46
I do have a nvidia video card running on windows 7 I loooked thorugh all the threads and apparently the problem I am having was never solved, wich sucks because I spen $80 on the book and now I can not even do any of the excercises. Nonoe of the code that invloves drawing lines will not display in the window.
LeonardInO 49
13
Years of Service
User Offline
Joined: 26th Feb 2011
Location:
Posted: 28th Feb 2011 03:24
I just updated the latest version of my nvidia graphics card and it fixed the problem I was having with lines not displaying.

Login to post a reply

Server time is: 2024-11-19 12:34:15
Your offset time is: 2024-11-19 12:34:15