Bind VBO, glGetError 0x501

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

Bind VBO, glGetError 0x501

Vasilij
Hello,

I have found some strange behavior by bind VBO.

First of all i use GL2ES2; jogl 2.1.5; my program runs at RasPi and Windows 7 64Bit with Intel Grafik Card.
Error is occur only on RAsPi.

My program create BufferedImage at first, then bind that as Texture:
                int[] texId = new int[1];
               
                gl.glPixelStorei( GL2ES2.GL_UNPACK_ALIGNMENT, 2 ); // PixelSpeicherModus
               
                gl.glGenTextures( 1, texId, 0 );
                textureId = texId[0];
               
               
                gl.glBindTexture(GL2ES2.GL_TEXTURE_2D, texId[0]);
               
                /* load the image data into a texture */
                gl.glTexImage2D(GL2ES2.GL_TEXTURE_2D, 0, GL2ES2.GL_RGBA, width, height, 0, GL2ES2.GL_RGBA, GL2ES2.GL_UNSIGNED_BYTE, pixelBuffer);
               
                /* texture filter*/
                gl.glTexParameteri(GL2ES2.GL_TEXTURE_2D, GL2ES2.GL_TEXTURE_MIN_FILTER, GL2ES2.GL_LINEAR);
               
                gl.glBindTexture(GL2ES2.GL_TEXTURE_2D, 0);
               
               

 then a bind the VBO:
                int[] tmp = new int[1];
                gl.glGenBuffers(1, tmp, 0);
                vboId = tmp[0];
               
               
                gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, vboId);
                {
                        gl.glBufferData(GL2ES2.GL_ARRAY_BUFFER, verticesData.length*4, vertices, GL2ES2.GL_STATIC_DRAW);
                }
                gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, 0);

The length of BufferedImage is always different, and if the dimension is 1936*80 Pixels, all is fine, nut if dimension is 2240*80 Pixels, i get an GLError 0x501.
I guess, that the length is important.

Please can somebody give me advice, why i get that error.
Reply | Threaded
Open this post in threaded view
|

Re: Bind VBO, glGetError 0x501

gouessej
Administrator
Hi

0x501 means GL_INVALID_VALUE. The image is probably too big for the Raspberry Pi (2048 * 2048 as far as I know). There is nothing strange as you can get this maximum value by using glGetIntegerv with GL.GL_MAX_TEXTURE_SIZE.

1936 < 2048 but 2240 > 1936
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Bind VBO, glGetError 0x501

Vasilij
YES, you are right!

Thank you very much!
Reply | Threaded
Open this post in threaded view
|

Re: Bind VBO, glGetError 0x501

gouessej
Administrator
You're welcome. Maybe this limit isn't the same on all kinds of Raspberry Pi, that's why I advise you to query OpenGL to get it. If you need to resize the image before creating the texture, look at how it is done in LibGDX or in ardor3d-android.
Julien Gouesse | Personal blog | Website