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!!!!!!!

Author
Message
GeneMatlock
10
Years of Service
User Offline
Joined: 9th Jun 2013
Location:
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.
dbWaitKey();
}


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

What is up with it?
Rudolpho
18
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?"
WickedX
15
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.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
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.
GeneMatlock
10
Years of Service
User Offline
Joined: 9th Jun 2013
Location:
Posted: 13th Jun 2013 01:36
Soo,

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.


WHAT IS A MEMBLOCK?

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

http://www.youtube.com/watch?v=0kpSiitk4eI

Just so what is a mem block

Login to post a reply

Server time is: 2024-03-28 08:40:58
Your offset time is: 2024-03-28 08:40:58