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 / My Dark GDK executables Run, but do not display anything!!!!!!!

Years of Service
User Offline
Joined: 9th Jun 2013
Posted: 10th Jun 2013 19:37
I have copied source code for a program that displays circles,

it is a student recourse from the book "Starting out with games and graphics in c++ by Tony Gaddis"

My fikle executes with out any errors. but the screen is blank!

a Black box of nothing and no circles!

Tjhe code is simple and looks like this;

// 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.

This code runs fine, buit just presents a plain black screen !

What is up with it?
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 11th Jun 2013 02:48
Try slapping in a call to dbSync() before the dbWaitKey() call.
If that doesn't help, try calling dbSync() twice; it will swap the buffers so the first time it is called it might swap an empty backbuffer to the screen before it renders to the new backbuffer.

"Why do programmers get Halloween and Christmas mixed up?"
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 11th Jun 2013 05:16 Edited at: 11th Jun 2013 05:35
Your code works for me. There is a known bug with the dbCircle() function and certain older NVIDIA graphic cards.
Years of Service
User Offline
Joined: 5th Dec 2009
Posted: 11th Jun 2013 06:56
To make a circle reliably, use a memblock and write the circle in the memblock using math. Then create an image from the memblock and display the image where you want the circle. I have NVIDIA and found that method works for every vid card.

The fastest code is the code never written.
Years of Service
User Offline
Joined: 9th Jun 2013
Posted: 13th Jun 2013 01:36

u could all be winners. I tried alternative code that worked so the graphics card may be bugged/outdated, and that'd be the reason why the dbSync; won't work.


Ye I have done circles with math before without the darkGDK, i used this guys brilliant tutorials.

Just so what is a mem block

Login to post a reply

Server time is: 2023-09-25 04:09:40
Your offset time is: 2023-09-25 04:09:40