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 / dbSprite and dbLine

Author
Message
MoZhe
13
Years of Service
User Offline
Joined: 11th May 2011
Location:
Posted: 11th May 2011 16:27
#include "DarkGDK.h"

void DarkGDK ( void )
{
int x=dbScreenWidth()/2;
int y=dbScreenHeight()/2;

dbSetImageColorKey(0,255,0);
dbLoadImage("UFO.bmp",1);
dbSprite(1,x,y,1);

dbLine(x,0,x,y*2);
dbLine(0,y,x*2,y);

dbWaitKey();
}

I can't see the line,somebody who can help me??

MoZhe
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 3rd Jul 2011 15:49
Welcome MoZhe, you will need to provide more detail regarding your question; are you experiencing a runtime or compile time error? (Missing line?)
Quote: "I can't see the line"


Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 3rd Jul 2011 16:59 Edited at: 3rd Jul 2011 17:00
He means that he can't see the line that he draws on the screen.

MoZhe: The reason is that as soon as you create a sprite, Dark GDK introduces a blue backdrop and that covers the lines. The solution is to redraw the lines every loop. A game usually has a game loop that is still missing from your program. Try this:

tangy
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location:
Posted: 10th Jul 2011 21:41
could also be the nvidia card bug. i had the same problem (your code should still work). at the very top of your main function add the line dbSetWindowOff(); and you will go into full screen mode instead of windowed mode. when i started working in full screen mode, about 90% of my problems/bugs went away.

-hahahahaha
vitinho444
14
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 11th Jul 2011 14:11
The problem i think its that the line is outside the loop like Mireben said. Try his code and it should work

Learning C++
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
MoZhe
13
Years of Service
User Offline
Joined: 11th May 2011
Location:
Posted: 12th Jul 2011 06:22
3Q so much

MoZhe

Login to post a reply

Server time is: 2024-11-19 09:38:24
Your offset time is: 2024-11-19 09:38:24