This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Blitting a color keyed surface on the display


Blitting a color keyed surface on the display

Postby Nacho84 » Nov 10, 2010 @ 3:34am

Hi! I've got a simple question: How can I blit a color keyed 2D surface to the display? I've been scanning through the documentation and none of the available blit functions in ClassEDisplay (ie. Blt, BltFast and BltFx) seem to have the capability of doing that. I'm aware I can use the Blt and BltFast methods from the display's buffer field, but since I'm using OpenGL I cannot do that.

Cheers,

--Nacho
Nacho84
pm Member
 
Posts: 82
Joined: Dec 15, 2007 @ 12:00pm
Location: Buenos Aires, Argentina


Re: Blitting a color keyed surface on the display

Postby edge » Nov 16, 2010 @ 3:05pm

Hi Nacho,

If your app supports both software rendering and OpenGL, you'll need to handle color keying in two different ways:
- Set the colorkey of the surface before uploading it to OpenGL. In the UploadTexture call, set 'upload as rgba' to true
- Use display->SetShading(E3D_TEXTURE | EFX_COLORKEY) before using any blitting calls in software rendering mode

You can use any of these two methods in the same codebase, without having to use preprocessor macro's like #ifdef

Johan
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum