I found one problem during the migration to jogl 2.3.1. For some reason code for crating new drawable texture fails with an error. I try to create empty canvas to draw on it later: The code: TextureRenderer tr = new TextureRenderer(128, 128, true, true); And the error is: com.jogamp.opengl.GLException: Could not find PixelFormat for format and/or type: PixelAttributes[fmt 0x80e1, type 0x8367, null] at com.jogamp.opengl.util.GLPixelBuffer$GLPixelAttributes.<init>(GLPixelBuffer.java:494) ~[jogl-all-2.3.1.jar:2.3.1] at com.jogamp.opengl.util.GLPixelBuffer$GLPixelAttributes.<init>(GLPixelBuffer.java:460) ~[jogl-all-2.3.1.jar:2.3.1] at com.jogamp.opengl.util.texture.awt.AWTTextureData.createFromImage(AWTTextureData.java:217) ~[jogl-all-2.3.1.jar:2.3.1] at com.jogamp.opengl.util.texture.awt.AWTTextureData.<init>(AWTTextureData.java:127) ~[jogl-all-2.3.1.jar:2.3.1] at com.jogamp.opengl.util.awt.TextureRenderer.init(TextureRenderer.java:636) ~[jogl-all-2.3.1.jar:2.3.1] at com.jogamp.opengl.util.awt.TextureRenderer.<init>(TextureRenderer.java:139) ~[jogl-all-2.3.1.jar:2.3.1] at com.jogamp.opengl.util.awt.TextureRenderer.<init>(TextureRenderer.java:130) ~[jogl-all-2.3.1.jar:2.3.1] at kendzi.jogl.texture.builder.BwFileTextureBuilder.loadTextureRenderer(BwFileTextureBuilder.java:102) ~[kendzi3d.jar:?]
Where is the image file?
The error is generated in constructor of class TextureRenderer. That constructor don't take any image as argument. And I would like to crate empty canvas only. So it is no image file here.
Please provide a small example. Which profile do you use? The problem occurs here: https://github.com/sgothel/jogl/blob/master/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java#L636 https://github.com/sgothel/jogl/blob/master/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java#L217 I don't know why GL.GL_BGRA and GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV are supported to build a pixel attribute.
It should return a pixel format: https://github.com/sgothel/jogl/blob/master/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java#L278 Maybe this post helps to understand what "_REV" means in GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV: https://lists.apple.com/archives/mac-opengl/2007/Nov/msg00134.html
This answer might help: http://stackoverflow.com/a/28121321
I'm using GL2 profile. Example code you can find here: https://gist.github.com/kendzi/ef37408e22cfe3af5f6e
Additionally that same error is thrown on Windows 7 64
So as I understand the bug is that pixel format GL_UNSIGNED_INT_8_8_8_8_REV is missing in switch right? https://github.com/sgothel/jogl/blob/1744cccaa63fa27b399b032c7767de2115ba2c7a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java#L279 Because as I check the image is created as glFormat: GL.GL_BGRA, glDataType: GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV.
commit 84ece839cae076e69a8b56b6b8ef266153afaac6: GLPixelBuffer.GLPixelAttributes.getPixelFormat() doesn't handle glDataType GL_UNSIGNED_INT_8_8_8_8_REV +++ Note: Please test and either set to verify if working or reopen if issue still exists!
I try to test your fix. To do that I download source code of JOGL. To compile it I install additional retired packages using command from manual: apt-get install openjdk-7-jre openjdk-7-jdk ant git-all p7zip-full gcc libgl1-mesa-dev libglu1-mesa-dev xorg-dev libice-dev libsm-dev libx11-dev libxext-dev libxxf86vm-dev libxinerama-dev libxrandr-dev libxrender-dev libxcursor-dev libudev-dev libc6-dev g++ libstdc++6 libstdc++-4.9-dev After that my application stop to working in eclipse. Each time I run it I get an error: # A fatal error has been detected by the Java Runtime Environment: # Problematic frame: # C [libpthread.so.0+0x9c84] pthread_mutex_lock+0x4 I don't have idea how to fix that. I will be grateful for any advice.
Created attachment 749 [details] Some strange error after compiling jogl...
Please use this build: http://jogamp.org/deployment/archive/master/gluegen_896-joal_622-jogl_1450-jocl_1093/
*** Bug 1157 has been marked as a duplicate of this bug. ***
I really would like to test you fix but after next few hours is not working... First, I solved the problem with segment fault. After hours of trials I fount that it is caused by some magic JAVA_TOOL_OPTIONS environment value: Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar It looks that it added by Ubuntu by default and after compiling JOGL localy it started crashing. I really don't wont to know why and don't care. I simply force to clean that environment variable and I'm finally able to run my application... The second problem is that I downloaded you build and is not working. After trials I decompiled file jogl-all.jar from your build and found: http://jogamp.org/deployment/archive/master/gluegen_896-joal_622-jogl_1450-jocl_1093/jar/jogl-all.jar case 32992: if (5121 == paramInt2) { localPixelFormat = PixelFormat.BGR888; } break; case 32993: switch (paramInt2) { case 32821: localPixelFormat = PixelFormat.ARGB8888; break; case 5121: localPixelFormat = PixelFormat.BGRA8888; } break; } return localPixelFormat; } So your fix is missing there...
(In reply to Kendzi from comment #14) > I really would like to test you fix but after next few hours is not > working... > > First, I solved the problem with segment fault. After hours of trials I > fount that it is caused by some magic JAVA_TOOL_OPTIONS environment value: > Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar > It looks that it added by Ubuntu by default and after compiling JOGL localy > it started crashing. I really don't wont to know why and don't care. I > simply force to clean that environment variable and I'm finally able to run > my application... Horrible situation, sorry to hear that. Oh well .. is it really one of the Ubuntu packages doing that? Since I tried compiling w/ vanilla Debian 8 and Ubuntu 15 lately: <http://jogamp.org/doc/misc/HowTo-JogAmp-BuildTest-Debian8.1.0-Ubuntu15.04-64bit.txt> Usually I use Debian .. of course :) > > The second problem is that I downloaded you build and is not working. After > trials I decompiled file jogl-all.jar from your build and found: > http://jogamp.org/deployment/archive/master/gluegen_896-joal_622-jogl_1450- > jocl_1093/jar/jogl-all.jar > > case 32992: > if (5121 == paramInt2) { > localPixelFormat = PixelFormat.BGR888; > } > break; > case 32993: > switch (paramInt2) > { > case 32821: > localPixelFormat = PixelFormat.ARGB8888; > break; > case 5121: > localPixelFormat = PixelFormat.BGRA8888; > } > break; > } > return localPixelFormat; > } > > So your fix is missing there... This is correct .. sorry for the confusion. Well, another build is underway, will aggregate it later tonight.
(In reply to Sven Gothel from comment #15) > > > > > So your fix is missing there... > > This is correct .. sorry for the confusion. > > Well, another build is underway, will aggregate it later tonight. available: <http://jogamp.org/deployment/archive/master/gluegen_896-joal_622-jogl_1451-jocl_1094/> also deployed to out local maven as 2.3.2-rc-20150927
I tested and is working fine