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 / Getting Started with Dark GDK and DirectX9.0c SDK under Win7 64-bit

Author
Message
scotts7777
14
Years of Service
User Offline
Joined: 14th Mar 2010
Location: Victoria, BC
Posted: 15th Mar 2010 00:39
Hi there,

This is my first post, and I'm looking for some help. I've searched the forums and read through the Dark GDK documentation but can't find answers.

I'm going through the Tony Gaddis book "Getting Started with Games and Graphics in C++" - the book uses MS Visual C++ Express 2008, Dark GDK and DirectX9.0c SDK for all of it's examples.

My problem is that after typing in the very first example of the book (code that draws three circles on the screen) nothing is displayed. Here's the code :

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

I followed all the instructions perfectly, started Visual C++ first, then installed the DirectX SDK, then GDK last. I can run VC++ no problem, I get no errors when compiling, but I don't see any graphics.

I'm running Windows 7 Ultimate 64-bit on a Dell Studio XPS with NVidia graphics. If anyone has any idea, please help!

Thanks
Scott
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 15th Mar 2010 06:42
May be a bug,

http://forum.thegamecreators.com/?m=forum_view&t=156472&b=22

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
scotts7777
14
Years of Service
User Offline
Joined: 14th Mar 2010
Location: Victoria, BC
Posted: 15th Mar 2010 07:04
Thanks for your help. I read that thread you linked to, but their solution was to use an old PC running WinXP.

I really want to be able to use my current laptop with Win7, not have to find an old PC running XP. The book I'm working with "Starting out with Games and Graphics in C++" by Tony Gaddis is copyright (c) 2010, so I'm assuming there is a way to make this work under Vista/Win7.

When I download Dark GDK and DirectX9.0c SDK at http://gdk.thegamecreators.com/?f=downloads it doesn't say anywhere if Win7 is supported, but it does offer help for getting it to work in Vista (run as Admin)

Anyone out there reading the same book as me and using Win7?

Thanks
scotts7777
14
Years of Service
User Offline
Joined: 14th Mar 2010
Location: Victoria, BC
Posted: 15th Mar 2010 08:17
OK, well I've managed to fix the problem!

All I had to do was add a line to my code to make the program run in full-screen mode instead of a Window. I searched around other threads here and found some code with this line :

dbSetWindowOff ();

I added it in, and now I can draw Circles!

Now I'm off to start Chapter 2 of my book - wish me luck!
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th Mar 2010 09:42
Quote: "Thanks for your help. I read that thread you linked to, but their solution was to use an old PC running WinXP. "


So just don't use the standard 2D drawing functions? Try making a cube or something.

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 15th Mar 2010 15:41 Edited at: 15th Mar 2010 15:47
There have been several complaints about this already (mainly from people who are using that book, since circles are used right in the first chapter). It seems that the problem is present in various degrees on different computers. On my machine, your dbSetWindowOff method does not solve the issue.

Have you tried if re-drawing the circles every loop helps or not? A Dark GDK program should contain a "main loop" which continuously redraws the screen. Try if you see the circles with this code (this helps on my computer):



(The dbWaitKey is not needed in this case, because you can exit the program by pressing the Escape key. You can try commenting out the dbCLS as well, which clears the screen before redrawing - but if you have the bug, the circles will be cleared anyway.)

If you continue to have problems with circles, ellipses or dots, and especially if the above code does not work for you, then please add your experience to the bug reports thread, describing the problem and your hardware configuration. You can also try the code snippets posted in the bug report thread and describe what result they produce on your machine:

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

Finally, as a workaround, here are replacement functions which let you draw circles and ellipses, in case dbCircle or dbEllipse don't want to work:

http://forum.thegamecreators.com/?m=forum_view&t=158250&b=22&p=0
scotts7777
14
Years of Service
User Offline
Joined: 14th Mar 2010
Location: Victoria, BC
Posted: 16th Mar 2010 18:48
Thanks - that code snippet works great,

Thanks also for the replacement functions - I'll hang on to them they may come in handy!

Login to post a reply

Server time is: 2024-11-20 03:32:57
Your offset time is: 2024-11-20 03:32:57