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 / Scripting Help - Windows 7 & Circles

Author
Message
Darkbluedeath
12
Years of Service
User Offline
Joined: 27th Aug 2011
Location:
Posted: 28th Aug 2011 03:42
Ok i have some basic questions and im going to upload my scripting.

Im running Windows 7, Visual Studios 2008 Express, and i have Dark GDK uploaded and it works fine, well sorta.

Im having trouble making circles, no matter what i do it wont work.

Here is my scripting!

#include \"darkGDK.h\"

void DarkGDK()
{
dbLine(320,0,320,480); //center line that will be needed to be deleated for final project
dbLine(300,60,340,60);
dbLine(300,60,300,140);
dbLine(340,60,340,140);
dbLine(280,100,360,100);
dbLine(300,140,340,140);
dbLine(310,140,310,160);
dbLine(330,140,330,160);
dbLine(260,160,310,160);
dbLine(330,160,380,160);
dbLine(260,160,260,280);
dbLine(380,160,380,280);
dbLine(260,280,380,280);
dbLine(380,180,460,120);
dbLine(380,200,480,120);
dbLine(460,120,480,120);
dbLine(470,120,440,100);
dbLine(470,120,500,100);
dbLine(470,120,460,100);
dbLine(470,120,480,100);
dbLine(440,100,460,100);
dbLine(500,100,480,100);
dbBox(308,105,310,110);
dbBox(328,105,330,110);
dbLine(260,180,220,200);
dbLine(220,200,300,280);
dbLine(260,200,250,210);
dbLine(250,210,320,280);
dbCircle(308,105,50);

dbWaitKey();


}

when i click debug it works but it just doesnt show the circle that i put in there.. i dont know how to fix that.. i also have trouble with colors and a few more things..

Can anyone help me figure out whats wrong

Darkbluedeath
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 28th Aug 2011 12:06 Edited at: 28th Aug 2011 12:13
Do you have NVidia video card? If yes, you are affected by this ancient bug:

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

First of all, update your video card drivers. I've had that problem for a long-long time but with the latest NVidia drivers, it does not happen any more, it seems to be fixed.

If the driver update doesn't help (but it should), then place your drawing commands into a game loop. Are you using the Gaddis book? I've seen some people posting code from that book and it seems to start exercises by one-time drawing onto the screen, without game loops. When you create a new Dark GDK project from the game template, you can see that there is a while loop which keeps the drawing commands continuously repeating. This may solve the issue:



If that still doesn't help, then look for alternative ways for drawing circles, instead of dbCircle and dbEllipse. Here is one workaround option, which creates circles/ellipses from short line segments (it's ugly but at least you can see something on the screen):

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

I have seen this plugin recommended too, but I haven't tested it so I don't know how well it works, or whether it still works with the latest version of Dark GDK:

http://forum.thegamecreators.com/?m=forum_view&b=5&t=69221&p=0

I hope one of these steps will fix your problem.

(P.S. When you post code, then please put it into code blocks. It doesn't only make the post shorter but it preserves the special characters and indentation as well.)
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 28th Aug 2011 16:04
you don't have dbSyncOn/dbSyncRate, you don't have dbSync, and you don't have LoopGDK (neccessary if you want the window to be updated, like respond to "X" click or mouse movement etc.)

Darkbluedeath
12
Years of Service
User Offline
Joined: 27th Aug 2011
Location:
Posted: 29th Aug 2011 00:31
Ok thank you for the help guys, but after doing some research i noticed that i didnt have the updated patch for my DarkGDK Include/Lib

after i updated that and ripped i over and replaced the old files (from 2006) its working fine now, so far i can do circles, dots, ellipses

so that worked for me

Darkbluedeath
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 29th Aug 2011 08:07 Edited at: 29th Aug 2011 08:08
@Hassan: that's true, but it should still work. By default (if you don't use dbSyncOn) the program operates in auto-sync mode, it updates the screen without dbSync. Try running that program in Visual Studio and you should see all the lines and the circle on the screen. The OP says that only the circle does not appear, so it's very probably the famous circle/ellipse bug. For me a recent video driver update solved that issue, I hope it will help him as well.

@Darkbluedeath: and what's your problem with colours?
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 29th Aug 2011 17:11
@Mireben: Oh, i never knew of such feature, sorry for the useless advice there

Login to post a reply

Server time is: 2024-04-24 02:14:40
Your offset time is: 2024-04-24 02:14:40