Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
billybaloop
Posts: 20
Registered: ‎11-15-2010
My Device: Not Specified

Re: OpenGl Textures

how do you access that layer from code?

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: OpenGl Textures

From code or from OpenGL?

 

Code:

getARGB(int[]...)

 

With the format being 0xAARRGGBB.

 

OpenGL:

Use GL_UNSIGNED_BYTE for "type" and GL_RGBA for "format" and "internalformat".

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Contributor
billybaloop
Posts: 20
Registered: ‎11-15-2010
My Device: Not Specified

Re: OpenGl Textures

Yes, So that seems to indicate RGBA 8888 information is available. Not to be a nuisance, but contrary to your previous answer.

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: OpenGl Textures

It's not stored in the Bitmap (from what I can tell) in RGBA8888 format, it's stored in RGB565 format with a separate "layer" (as stated previously) for alpha.

 

The function converts the values from RGB565 to RGB888 when the function is called. It's not to hard to convert from 565 to 888 (http://stackoverflow.com/questions/2442576/how-does-one-convert-16-bit-rgb565-to-24-bit-rgb888) but a performance hit does occur.

 

Though I'll leave it up to you if you want to search for it but someone a while ago made a post stating that using alpha causes a large performance hit when drawing with Graphics. I can only presume that this has to do with the conversion.

 

Instead of Bitmap->drawBitmap (where it simply copies and pastes from the Bitmap to the screen buffer) we have Bitmap->drawBitmap (where it needs to convert the values to RGB8888 and copy the alpha into the image, repeat the process for the screen buffer, apply the alpha for the pixels to the sceen buffer pixels, then convert back into RGB565 and place back into the screen buffer).

 

Hope that clears up the supposed contradiction.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.