ok i found errors in your code:
- you need to find the sTexture location in the shader program
- texture non square doesn't work. I force 512*512 for the test

For the second point, i have no idea why it works in an activity and
not in
the LWP.


diff --git a/src/cxa/lineswallpaper/GLES20LinesRenderer.java b/src/cxa/
lineswallpaper/GLES20LinesRenderer.java
index 7b9c5c5..730edec 100644
--- a/src/cxa/lineswallpaper/GLES20LinesRenderer.java
+++ b/src/cxa/lineswallpaper/GLES20LinesRenderer.java
@@ -80,6 +80,7 @@ public class GLES20LinesRenderer implements
GLSurfaceView.Renderer {

        private int position_handle_;
        private int texture_handle_;
+       private int texture_loc_;
        private int line_MVP_matrix_handle_;

        private int line_position_handle_;
@@ -236,8 +237,8 @@ public class GLES20LinesRenderer implements
GLSurfaceView.Renderer {
                surface_width_ = width;
                surface_height_ = height;

-               framebuffer_width_ = width;
-               framebuffer_height_ = height;
+               framebuffer_width_ = 512;//width;
+               framebuffer_height_ = 512;//height;
                /*
                 * framebuffer_width_ = 1 << (int)(Math.log(width)/
Math.log(2));
                 * if(framebuffer_width_ == surface_width_)
framebuffer_width_ >>= 1;
@@ -265,6 +266,7 @@ public class GLES20LinesRenderer implements
GLSurfaceView.Renderer {

                GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
                GLES20.glBindTexture(GLES20.GL_TEXTURE_2D,
target_texture_);
+        GLES20.glUniform1i(texture_loc_,0);

 
triangle_vertices_.position(TRIANGLE_VERTICES_DATA_POS_OFFSET);
                GLES20.glVertexAttribPointer(position_handle_, 3,
GLES20.GL_FLOAT,
@@ -376,6 +378,13 @@ public class GLES20LinesRenderer implements
GLSurfaceView.Renderer {
                        throw new RuntimeException(
                                        "Could not get attrib location
for aTextureCoord");
                }
+        texture_loc_ = GLES20.glGetUniformLocation(program_,
"sTexture");
+        Log.i("lolo","" + texture_loc_);
+        checkGlError("glGetAttribLocation sTexture");
+        if (texture_loc_ == -1) {
+            throw new RuntimeException(
+                    "Could not get attrib location for sTexture");
+        }

                MVP_matrix_handle_ = GLES20
                                .glGetUniformLocation(program_,
"uMVPMatrix");


On 16 fév, 18:52, Michael <[email protected]> wrote:
> I am testing my live wallpaper on a Galaxy Tab, and it works.
>
> On Feb 16, 5:12 am, laurent mallet <[email protected]> wrote:
>
>
>
>
>
>
>
> > The blurred lines livewallpaper doesn't work on Samsung Galaxy S (and
> > Galaxy Tab), Droid, and Milestone. It works only on my Nexus One.
> > The GLWallpaperService doesn't work either. We have a black screen or
> > green screen. That's strange because many LWP with OpenGL ES 1.x as
> > Aquarium are working. Using baksmali, we can see that they use 
> > thehttp://www.rbgrn.net/code.
>
> > On 16 fév, 02:03, Michael <[email protected]> wrote:
>
> > > In the time before my first post was approved by the moderators, I
> > > found a solution 
> > > athttps://github.com/ghisguth/blurred-lines-live/blob/master/src/cxa/li...
> > > .

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to