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 / Dark GDK c++ express 2008, 2D bitmap bugs?

Author
Message
Yakumo
16
Years of Service
User Offline
Joined: 6th Dec 2007
Location:
Posted: 7th Dec 2007 03:25
I've been using dbLine to draw lines to bitmap(1) one after the other, the problem is if I draw 2 lines this way, only the first line actually shows when I copy bitmap(1) to bitmap(0) (the screen)

I wrote a simplest example possible demo (below) to demonstrate/prove this.

If I try drawing 3 lines in a row to bitmap(1) then NONE of the lines are showing up when I dbCopyBitmap(1,0)

Any idea's?

Also I suspect it's a bug that dbCLS only clears bitmap(0) and not the current selected bitmap.



Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 7th Dec 2007 12:02
While I'm not sure if that code you posted should work, I can tell you that Sephnroth's Image extension allows you to draw onto textures
Yakumo
16
Years of Service
User Offline
Joined: 6th Dec 2007
Location:
Posted: 7th Dec 2007 15:02
Also, seeing as the code above is so simple, I'd be interested to know if anyone can figure out why it just locks as soon as it's painted the first screen (not using bitmap(1) ) I increase the bitmap and screen size (via changing xRes, yRes vars) to 800x600 or in fact anything higher than 640x480, even just 1 pixel more on either the X or Y res causes this lock, and I just can't see why at all.

Yakumo
16
Years of Service
User Offline
Joined: 6th Dec 2007
Location:
Posted: 7th Dec 2007 22:59 Edited at: 9th Dec 2007 01:41
Ahah, I've fixed the resolution change issue myself I have now successfully tested code on 800x600, 1400x1050 with no crash (the dbline line remains a problem)

I just needed to add dbSetDisplayMode(xRes, yRes, 32); at the very top of the DarkGDK ( void ) function, before setting the sync, or other display properties.

Perhaps this is only an issue on Vista, but it does seem strange that it is so important to set this and yet it is not in either of the Templates examples Dark GDK installs for you.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 9th Dec 2007 05:10
I had a similar problem to this, but printing text to a bitmap. If you use a color other than 0 for the background color with dbInk(), it ought to work. I.E., use the same color twice.
Yakumo
16
Years of Service
User Offline
Joined: 6th Dec 2007
Location:
Posted: 9th Dec 2007 16:28
Thanks for the suggestion, I've just tried that, I'm afraid it made no difference at all though
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 10th Dec 2007 16:49
I recently got "BIT" - I made a couple objects, set the displaymode - and things seemed ... well broke!

I've learned that my little "DarkGDK" Class Suite - needs to Execute SetWindowMode or NOT, Resolution (DisplayMode), and then IF window mode - I use SEtWindowPosition - otherwise DO NOT CALL IT.

Then... then move on and create objects etc. Seem Simple? Took me forever to figure out why "VARIOUS" things were'nt working - all tracked back to this.

Yakumo
16
Years of Service
User Offline
Joined: 6th Dec 2007
Location:
Posted: 11th Dec 2007 05:17
I worked it out!

Do not dbLockPixels/dbUnlockPixels and use dbLine (or other 2d drawing commands from dark gdk)

*only* use dbLockPixels/dbUnlockPixels when using dbGetPixelsPointer and writing directly to the memory.

If you dbLockPixels and then use DarkGDK 2d commands, unexpected or partial results will occur.

Login to post a reply

Server time is: 2024-11-19 20:35:07
Your offset time is: 2024-11-19 20:35:07