TextureRenderer: Could not find PixelFormat

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

TextureRenderer: Could not find PixelFormat

sranger
Just recently updated to JOGL 2.3.1 and a co-worker using our graphics API is now receiving a "Could not find PixelFormat" when creating a new TextureRenderer object (new TextureRenderer(width, height, true). Looking at the source code, it seems like the default format is GL_BGRA; is there anything I need to enable in the GLCapabilities for that to work correctly? Anything he needs to enable through the context before creating the object?

Thanks!
Stephen



 - Stephen
Reply | Threaded
Open this post in threaded view
|

Re: TextureRenderer: Could not find PixelFormat

gouessej
Administrator
Hi

Does it have anything to do with this regression?
https://jogamp.org/bugzilla/show_bug.cgi?id=1157
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: TextureRenderer: Could not find PixelFormat

sranger
Yes, that looks like the error he was receiving. The default TextureRenderer chooses a GL_BGR/GL_BGRA format without checking if it's acceptable.

If you look in TextureRenderer.init(int width, int height); it uses TYPE_INT_ARGB_PRE if alpha, and TYPE_INT_RGB, if no alpha for the BufferedImage and then in AWTTextureData, it selects GL.GL_RGBA as the internal format in the constructor, but then when it calls AWTTextureData.createFromImage(GLProfile, BufferedImage), it uses GL_BGRA for the GLPixelAttributes object (line 217) which is where it throws the error.

I'm sorry I don't have time at work to debug and test a fix myself but if you need anything else that might help, just let me know.


 - Stephen
Reply | Threaded
Open this post in threaded view
|

Re: TextureRenderer: Could not find PixelFormat

sranger
I threw together a sample and posted it at the bug tracker; the same sample worked with 2.2.0 but not with 2.3.0.

Thanks!


 - Stephen
Reply | Threaded
Open this post in threaded view
|

Re: TextureRenderer: Could not find PixelFormat

gouessej
Administrator
Thanks, it's gonna be helpful.
Julien Gouesse | Personal blog | Website