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 / Text Texture

Author
Message
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 21st Feb 2009 22:58 Edited at: 21st Feb 2009 22:59
Hi,
For my game I need to be able to dynamically create text into an image. This can then be applied to a 3D plain. I do not want the text being shown anywhere other than the 3D plain.

At the moment I am first calling dbGetImage to get the contents of what was on the screen first. I then draw the text on the screen and then call dbGetImage again. I now have the text loaded as an image ready for texturing on the plain. However the text has just been placed on the screen so I have to paste the image of what was there before over the top of the text.

As you can see this solution isnt great for performance and bit of work around.

Is there any other way I could do this more efficiently or better?

Thanks,
Alex

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd Feb 2009 00:23 Edited at: 22nd Feb 2009 00:23
Use bitmap 1 instead of bitmap 0 (the screen).

dbSetCurrentBitmap(1);
<do stuff>
dbSetCurrentBitmap(0);

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 22nd Feb 2009 01:31 Edited at: 22nd Feb 2009 01:33
Thanks I never knew you could do that

How can I save the bitmap or get it into a an image slot instead of bitmap slot?

Thanks,
Alex

Edit:
oh, use dbSaveBitmap() it is not in the documentation though

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 22nd Feb 2009 12:19
Is there anyway to get the bitmap slot straight into an image slot instead of having to save it to the disk first?

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 22nd Feb 2009 12:50 Edited at: 22nd Feb 2009 13:12
dbSavebitmap does not work, I guess thats why it was not in the documentation

Edit:

Now using memblocks got it all working

Login to post a reply

Server time is: 2024-11-25 15:44:34
Your offset time is: 2024-11-25 15:44:34