Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8973179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:23:18+00:00 2026-06-15T18:23:18+00:00

Here is my code, i can’t found where does the problem hides. bool setupGraphics(int

  • 0

Here is my code, i can’t found where does the problem hides.

bool setupGraphics(int w, int h) {
    printGLString("Version", GL_VERSION);
    printGLString("Vendor", GL_VENDOR);
    printGLString("Renderer", GL_RENDERER);
    printGLString("Extensions", GL_EXTENSIONS);

    glViewport(0, 0, w, h);
    checkGlError("glViewport");

    glEnable(GL_DEPTH_TEST);

    LOGI("setupGraphics(%d, %d)", w, h);
    gProgram = createProgram(gVertexShader, gFragmentShader);
    if (!gProgram) {
        LOGE("Could not create program.");
        return false;
    }
    gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
    checkGlError("glGetAttribLocation");

    //Init texture.
    makeCheckImage();  
    checkGlError("init texture1");
    glGenTextures(1, gTextureHandler);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexImage2D(GL_TEXTURE_2D, 0, 4, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, checkImage);
    glBindTexture(GL_TEXTURE_2D, gTextureHandler[0]);
    checkGlError("init texture2");

    gTextureUniformHandler = glGetUniformLocation(gProgram, "uTexture");
    gTextureCoordinateHandler = glGetAttribLocation(gProgram, "vTexCoordinate");
    checkGlError("init texture");

    return true;
}

And the logs:

I/libgl2jni(30066): GL Version = OpenGL ES 2.0 build 1.8.GOOGLENEXUS.ED945322@2112805
I/libgl2jni(30066): GL Vendor = Imagination Technologies
I/libgl2jni(30066): GL Renderer = PowerVR SGX 540
I/libgl2jni(30066): GL Extensions = GL_EXT_debug_marker GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_vertex_half_float GL_OES_texture_float GL_OES_texture_half_float GL_OES_element_index_uint GL_OES_mapbuffer GL_OES_fragment_precision_high GL_OES_compressed_ETC1_RGB8_texture GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_required_internalformat GL_OES_depth_texture GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_standard_derivatives GL_OES_vertex_array_object GL_OES_egl_sync GL_EXT_multi_draw_arrays GL_EXT_texture_format_BGRA8888 GL_EXT_discard_framebuffer GL_EXT_shader_texture_lod GL_IMG_shader_binary GL_IMG_texture_compression_pvrtc GL_IMG_texture_npot GL_IMG_texture_format_BGRA8888 GL_IMG_read_format GL_IMG_program_binary GL_IMG_multisampled_render_to_texture
I/libgl2jni(30066): setupGraphics(480, 800)
I/libgl2jni(30066): after init texture2() glError (invalide operation)

if i Comment glTexImage2D(GL_TEXTURE_2D, 0, 4, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, checkImage);
glBindTexture(GL_TEXTURE_2D, gTextureHandler[0]);
then everything goes fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:23:19+00:00Added an answer on June 15, 2026 at 6:23 pm

    I solved this problem by myself. The error is caused by the inconsistent parameter in glTexImage2D. If i change it to glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, checkImage);, then error doesn’t exist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering what this snippet exactly does? (found here: http://code.google.com/p/google-app-engine-samples/source/browse/trunk/django_example/django_bootstrap.py ) # Make
Here's my code...we can find a button tag in this code. There for button
you can view full source code here dpaste.com/hold/167199 Error: delete() takes exactly 2 arguments
There is a weird code here that I need to make work.. can you
This is a fairly weird case, you can see the code here: http://jsfiddle.net/zpZtH/2/
For some reason my bind events won't work. You can see my code here:
Here is the code relevant to my question: http://jsfiddle.net/mkerny45/V23NK/ As you can see there
Here is my code (well, some of it). The question I have is, can
How can i reset a display:none and add some value here is the code
I found this code from here: http://www.cssportal.com/form-elements/text-box.htm But the problem is you can still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.