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 / dbCircle, dbLines or dbDot not working!

Author
Message
jmv
15
Years of Service
User Offline
Joined: 19th Aug 2009
Location:
Posted: 19th Aug 2009 22:49
Relatively new to Visual C++ Studio Express Edition.

Got the basic "Hello World" to show up but when I inputed this code to print some basic circles got a blank screen as output. Any suggestions? Also dbLines and dbDot does not work.

// 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();
}

Using Windows Vista if that's any help.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 19th Aug 2009 23:36
You need to call dbSync() to update the screen.

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 20th Aug 2009 05:35
I don't see you calling dbInk () to set your pen's foreground color.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
jmv
15
Years of Service
User Offline
Joined: 19th Aug 2009
Location:
Posted: 20th Aug 2009 21:13
Thanks for the suggestion but neither one worked and I put both in.

// This is an example Dark GDK program.
#include "DarkGDK.h"

void DarkGDK()
{
DWORD blue = dbRGB(255,0,0);
DWORD black = dbRGB(255,255,255);
// Variables for the center points.
int x = 319, y = 239,radius = 50;

// Draw concentric circles.
dbSync();
dbInk(blue,black);
dbCircle(x, y,radius);




// Wait for the user to press a key.
dbWaitKey();
}


Resulting output



I know the color changes worked because I added dbPrint at the end of the same program and got the text color to change.






Any other suggestions? Could it be Windows Vista or some setup options I am missing?
jmv
15
Years of Service
User Offline
Joined: 19th Aug 2009
Location:
Posted: 20th Aug 2009 21:36
I also noticed I cannot change the background color. It is always black even if I change the values.(Notice for black in my coding I put 255,255,255 instead of the standard 0,0,0 for black). Could this be the problem too?
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 20th Aug 2009 22:09
Try the following:




And, for the record,

DWORD black = dbRGB (0, 0, 0);
DWORD blue = dbRGB (0, 0, 255);

As a matter of C/C++ style, it wasn't necessary for purposes of this example to store your colors, center co-ordinates or radius as variables before passing them to dbCircle function. You could have used literals.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
jmv
15
Years of Service
User Offline
Joined: 19th Aug 2009
Location:
Posted: 21st Aug 2009 01:13
First, thanks lilith and Bran Flakes for your help.

Unfortunately it's not the coding that's the problem.

I went ahead and installed Visual C++ Express edition on my older PC that had Windows XP on it as well as DirectX and Dark GDK.

Started it up and plug in the original code and tada.



So obviously it's a operating systems problems and not a coding one. Trouble is I'm not that savy on operating systems so I wouldn't even know where to begin to correct the problem.

Hopefully someone who knows operating systems might have a suggestion and read this thread.
MFC Coder
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location:
Posted: 23rd Aug 2009 17:16
jmv, seems you got your hands on the Gaddis book

It is a good intro to DarkGDK.

MFC Coder
rbailey64bit
15
Years of Service
User Offline
Joined: 10th Sep 2009
Location:
Posted: 11th Sep 2009 05:31
I'm just wondering if JMV ever got those 3 commands to work in Vista. I have the same problem here, but just saw a classmate who had it working in Vista. He didn't know why... neither did I. I suspect it was related to his having an Intel based video driver, and I an NVidea driver.....
MxM111
14
Years of Service
User Offline
Joined: 3rd Oct 2009
Location:
Posted: 3rd Oct 2009 08:15
I have similar problem with Vista and NVIDIA card. I can draw a line, but not circle or ellipse.
logicandchaos
15
Years of Service
User Offline
Joined: 22nd Sep 2009
Location:
Posted: 19th Nov 2009 04:48
dbDot does not appear on the screen for me, i have vista and nvidea, i think it's a bug with them or something there is another thread on it http://forum.thegamecreators.com/?m=forum_view&t=157918&b=22&p=0

logicandchaos

Login to post a reply

Server time is: 2024-10-01 18:37:54
Your offset time is: 2024-10-01 18:37:54