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 / dbLine not working correctly?

Author
Message
InsanitY
14
Years of Service
User Offline
Joined: 6th Aug 2009
Location: The Netherlands
Posted: 26th Aug 2010 11:48 Edited at: 26th Aug 2010 19:31
Hi,

I'm trying to draw a grid on the screen using the dbLine function. It appears it isn't working as it should, though. When I use the code



There is a space of 9 pixels between every line, while it should be 7 ("iCurrentX += 8)", right? Or is my basics-math off? :/ So am I doing something wrong, or is there a bug in the function?
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 26th Aug 2010 17:30
It should be 7 and it really is 7. How did you verify the space between the lines?

By the way, the dbScreenWidth() coordinate is not on the screen. The coordinates go from 0 to dbScreenWidth()-1. Therefore you can use the < sign instead of <= in the loop.
InsanitY
14
Years of Service
User Offline
Joined: 6th Aug 2009
Location: The Netherlands
Posted: 26th Aug 2010 19:40
You are right about the screen wide, didn't think of the '0' coordinates.

I verified the space with print screen -> paste in both MS Paint and GIMP. I now used an 100*100 image in my program, it was over 100 pixels with the same testing method. Apparently DarkGDK stretches the image, because when I made a screendump from the image in the Windows Image Viewer, it was still 100*100.

So I guess it has nothing to do with the dbLine() function, but with DarkGDK stretching the screen? Odd stuff.
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 27th Aug 2010 18:46
I don't know why it is stretched when you use print screen. Have you tried using a DirectX screen capture program like Fraps? That should give you more accurate result. There is also a command to take a screenshot from the Dark GDK program itself: dbGetImage. I did have a problem with image stretching when I used it, but then I was informed that it has an extra parameter to prevent stretching:

http://forum.thegamecreators.com/?m=forum_view&t=166599&b=15
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Aug 2010 21:15
If the screen size differs from the window size the output will be resized

[b]
InsanitY
14
Years of Service
User Offline
Joined: 6th Aug 2009
Location: The Netherlands
Posted: 1st Sep 2010 21:54
Even when using windowed mode? o__0 Because that doesn't make sense, does it?
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 3rd Sep 2010 20:32 Edited at: 3rd Sep 2010 20:36
I thought for a while about Diggsey's post. I think he meant that if you set your window resolution to some pixel * pixel value and then maximize the window to fill the screen, or resize the window by dragging its corner, then the picture will be distorted. Then if you take a screenshot, the distortion will be reflected on the screenshot as well, so the pixel values will not be correct. Diggsey did I understand correctly what you wanted to say?

Login to post a reply

Server time is: 2024-07-02 09:00:41
Your offset time is: 2024-07-02 09:00:41