0

I try the following code, but without any success :

I create my texture like this :

glActiveTexture(GL_TEXTURE0);
glGenTextures(1, @Tex);
glBindTexture(GL_TEXTURE_2D, Tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
TJGLUtils.JavaClass.texImage2D(GL_TEXTURE_2D, // target: Integer;
                                     0, // level: Integer;
                                     aBitmap, // bitmap: JBitmap;
                                     0); // border: Integer  => 
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 100, 100, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil);
glBindTexture(GL_TEXTURE_2D, 0);

then later in my main render loop i try to draw the texture with glDrawTexiOES like this :

eglMakeCurrent(eglGetCurrentDisplay, SharedSurface, SharedSurface,
  SharedContext);

glViewport(Round(FContentRect.Left * FScale), Round(FContentRect.Top * FScale), Round(FContentRect.Width * FScale),
 Round(FContentRect.Height * FScale));

glDepthMask(1);
glClearDepthf(1);
glClearStencil(0);
glClearColor(0, 0, 0, 0);
glClear(GL_DEPTH_BUFFER_BIT or GL_STENCIL_BUFFER_BIT or GL_COLOR_BUFFER_BIT);

glBindTexture(GL_TEXTURE_2D, Tex);

aParams[0] := 0;
aParams[1] := 0;
aParams[2] := 100;
aParams[3] := 100;
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, @aParams[0]);

glDrawTexiOES(0, 0, 0, 100, 100);

eglSwapBuffers(SharedDisplay, SharedSurface);

but it's not work :( what did i miss ?

NOTE: the function crash on this line: glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, @aParams[0]); with error 1280

4

1 に答える 1