Log in or register to post comments

glError (0x502)

April 18, 2013 - 11:42am #1

I created my project using the Android SDK version 2.0.31 and based on ImageTargets I am adapting my project. I'm just using the OpenGL 2.0 removed the lines of 1.0.
Anyway, just putting in MVC pattern and functions usandos my native language.
My project is compiling and everything, however when it detects a target it displays the following message:

after renderFrame MyApp () glError (0x502)
I / QCAR (800): Java_com_MyApp_RenderizaAR_renderizaFrame

This message comes from SampleUtils :: checkGlError.

ok, you will tell me that the bug is in rendereizaFrame, but it is equal to extamente RenderFrame Image of targets.

I have no idea what I have to look. Could give me a hint?

Thank you.


In portuguese:

Criei meu projeto no Android usando a versão do SDK 2.0.31 e com base no ImageTargets estou adaptando meu projeto. Estou usando apenas o OpenGl 2.0 retirei as linhas do 1.0.
Enfim, apenas colocando em padrão MVC e usandos funções da minha lingua nativa.
Meu projeto está compilando e tudo, porem quando detecta um alvo ele apresenta a seguinte mensagem:
after MyApp renderFrame() glError (0x502)
I/QCAR(800): Java_com_MyApp_RenderizaAR_renderizaFrame

Essa mensagem vem da SampleUtils::checkGlError.

ok, você vai me dizer que o erro está na rendereizaFrame, porém ela está extamente igual com a RenderFrame do Image targets.

Não tenho mais idéia do que eu tenho que olhar. Poderiam me dar uma dica?




Plain text icon log.txt60.48 KB

glError (0x502)

April 22, 2013 - 12:34pm #10

Great !

glError (0x502)

April 22, 2013 - 10:15am #9

I found out why!
Eliminating the lines that use OPENGL 1.0, I have not seen that test # ifndef USE_OPENGL_ES_1_1 was a conditional test of denial initRendering function ().
Then I removed the lines:

shaderProgramID = SampleUtils::createProgramFromBuffer(cubeMeshVertexShader,

    vertexHandle = glGetAttribLocation(shaderProgramID,
    normalHandle = glGetAttribLocation(shaderProgramID,
    textureCoordHandle = glGetAttribLocation(shaderProgramID,
    mvpMatrixHandle = glGetUniformLocation(shaderProgramID,
    texSampler2DHandle = glGetUniformLocation(shaderProgramID,

I restored them, and stopped giving the error.
Thank you.

glError (0x502)

April 20, 2013 - 1:35pm #8

Hi, thanks for the code ZIP file;

actually, in that code I don't see anything wrong;

could you add this line right at the beginning of the renderFrame() method:

SampleUtils::checkGlError("ImageTargets renderFrame - beginning");


And see if it makes any difference ?

also, I see in your code you use two different meshes, depending on the texture index; one is the teapot, and one is a custom mesh;

what you could do is to try to only render the teapot (i.e. use the teapot mesh in all cases) and see if that makes a difference...

this could tell something more on the problem (for instance, it could be related to your mesh...)





glError (0x502)

April 19, 2013 - 12:02pm #7

I put the lines after glDrawElements but still continues when the error is to show the image.
I am attaching my imagetarget.cpp this message

Package icon ImageTargets.zip5.3 KB

glError (0x502)

April 19, 2013 - 11:32am #6

Ok. In your code you should see these lines at the end of the renderFrame() function:


Could you try moving those 3 lines and put them right after the line glDrawElements( ... ) which is inside the "for loop" ?

glError (0x502)

April 19, 2013 - 11:16am #5

 The application runs and the camera works. This error happens when it detects the target! Is not the picture shows!

glError (0x502)

April 19, 2013 - 11:13am #4

Hi, does that error message prevents your app from running ? do you get a crash ?

if you see the message but the app run, you can ignore it (as that depends very much on the GPU driver)


glError (0x502)

April 19, 2013 - 8:55am #3

I practically copy ImageTarget.cpp, just changed the signature. The SamplesUtil.cpp and Texture.cpp are equal (copied verbatim).
Because it is a mistake to believe that the OpenGL error is not in Java, right?
any ideas?

glError (0x502)

April 18, 2013 - 2:03pm #2


are you calling the renderFrame cuntion from the OpenGL rendering thread ?

if not, that could be one reason for the error.

Log in or register to post comments