Bonjour,

Nous avons un problèùe en OpenGLES sous Android. En effet, nous avons l'affichage d'une scène simple (un pavé pour le sol et un cube) qui s'effectue à la première frame et non à la seconde et suivante. Le code est base sur API OpenSource qui fonctionne parfaitement, notre intégration étant juste un lien avec la classe d'affichage sans modification interne. L'erreur est repertorié 1282, elle peut être un peu tout et n'importe quoi ... Nous avons regarder beaucoup de forum, tester pas mal de choses et nous doutons sur le buffer éventuellement. Un beug autre que OpenGL n'a pas encore été exclus pour le moment également.

Voici le bout de code en question, l'erreur étant soulevé au GlError

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
public void drawCube() {
        GLES20.glUseProgram(cubeProgram);
 
		GLES20.binbuffer(GLES20.ARRAY_BUFFER, cubeProgram.getPosition());
 
        GLES20.glUniform3fv(cubeLightPosParam, 1, lightPosInEyeSpace, 0);
 
        // Set the Model in the shader, used to calculate lighting
        GLES20.glUniformMatrix4fv(cubeModelParam, 1, false, modelCube, 0);
 
        // Set the ModelView in the shader, used to calculate lighting
        GLES20.glUniformMatrix4fv(cubeModelViewParam, 1, false, modelView, 0);
 
        // Set the position of the cube
        GLES20.glVertexAttribPointer(cubePositionParam, COORDS_PER_VERTEX, GLES20.GL_FLOAT,
                false, 0, cubeVertices);
 
        // Set the ModelViewProjection matrix in the shader.
        GLES20.glUniformMatrix4fv(cubeModelViewProjectionParam, 1, false, modelViewProjection, 0);
 
        // Set the normal positions of the cube, again for shading
        GLES20.glVertexAttribPointer(cubeNormalParam, 3, GLES20.GL_FLOAT, false, 0, cubeNormals);
        GLES20.glVertexAttribPointer(cubeColorParam, 4, GLES20.GL_FLOAT, false, 0,
                isLookingAtObject() ? cubeFoundColors : cubeColors);
 
        GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 36);
        checkGLError("Drawing cube");
    }
Merci pour votre attention !