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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


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

Re: OpenGl Textures

how do you access that layer from code?

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, 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.
Contributor
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.

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, 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.