Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid OpenGL ES Textures Showing On Black screen on Some Samsung devices
    primarykey
    data
    text
    <p>I recently worked on a live wallpaper application. In that i found out my Android live wallpaper has an odd issue. I use my HTC Wildfire S, Samsung Galaxy tab, Motorola Droid Millstone, Samsung galaxy pop to test my wallpaper along with the emulator and all is working fine, but on Samsung handsets (Samsung Galaxy S II and Samsung Galaxy Player have the symptom) the screen just stays Black for initial launch. But once we move to settings screen and return to preview its working fine.After a little debugging with those handsets I was able to find out that the wallpaper loads correctly, but the textures aren't just showing up. I tried searching about the problem, but didn't found anything helpful.</p> <p>I bind a texture form the native code. In that am using the OPEN GL library to bind wallpaper . My opengl library intiation is like following </p> <pre><code> glEnable(GL_TEXTURE_2D); glGenTextures(1, &amp;textureConverted); glBindTexture(GL_TEXTURE_2D,textureConverted); //...and bind it to our array __android_log_print(ANDROID_LOG_DEBUG, "NDK initOpenGL()", "binded texture" ); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); //Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); //GL_REPEAT); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); //GL_REPEAT); glTexImage2D(GL_TEXTURE_2D, /* target */ 0, /* level */ GL_RGBA, /* internal format */ textureWidth, /* width */ textureHeight, /* height */ 0, /* border */ GL_RGBA, /* format */ GL_UNSIGNED_BYTE,/* type */ NULL); //setup simple shading glShadeModel(GL_FLAT); //check_gl_error("glShademo_comdel"); glColor4x(0x10000, 0x10000, 0x10000, 0x10000); </code></pre> <p>and in my drawFunction</p> <pre><code> glClear(GL_COLOR_BUFFER_BIT); int max; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &amp;max); __android_log_print(ANDROID_LOG_DEBUG, "NDK drawFrame()", "GL_MAX_TEXTURE_SIZE: %d", max); glBindTexture(GL_TEXTURE_2D,textureConverted); int rect[4] = {0, textureHeight, textureWidth, nTextureHeight}; glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, rect); glTexSubImage2D(GL_TEXTURE_2D, /* target */ 0, /* level */ 0, /* xoffset */ 0, /* yoffset */ textureWidth, textureHeight, GL_RGBA, /* format */ GL_UNSIGNED_BYTE, /* type */ pFrameConverted-&gt;data[0]); glDrawTexiOES(0, 0, 0, drawWidth, drawHeight); //drawWidth is th screenwidth and drawheight is the screenheight </code></pre> <p>Why doesn't this work on Samsung phones?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload