[android-developers] Re: OpenGL ES 2.0 for Live Wallpapers

2011-02-18 Thread laurent mallet
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 meicpal...@gmail.com wrote:
 I am testing my live wallpaper on a Galaxy Tab, and it works.

 On Feb 16, 5:12 am, laurent mallet laurent.mal...@gmail.com 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 meicpal...@gmail.com 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL ES 2.0 for Live Wallpapers

2011-02-17 Thread laurent mallet
My Galaxy Tab ROM is XWJJ4. The problem with OpenGL ES 2.0
Livewallpaper seems related to FBO. If i use them, it crashes on many
phones. Only my N1 (CM7 alpha version 47) works.

On 16 fév, 18:52, Michael meicpal...@gmail.com wrote:
 I am testing my live wallpaper on a Galaxy Tab, and it works.

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


[android-developers] Re: OpenGL ES 2.0 for Live Wallpapers

2011-02-17 Thread laurent mallet
I tried your livewallpaper with the official (carier Orange) ROM on my
GalaxyTab and it doesn't work either. The problem is clearly the FBO.
When you use a FBO in a LiveWallPaper, on your main surface you will
have a Black Screen. The problem doesn't really crash your phone but
you have no painting.

If i remove your FBO and draw lines without blur, your LWP is working
on all my devices (N1, A101, Galaxy S, Galaxy Tab, Milestone ...)
otherwise only N1.

The same code in an Activity has no problem.

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


[android-developers] Re: OpenGL ES 2.0 for Live Wallpapers

2011-02-16 Thread laurent mallet
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 the
http://www.rbgrn.net/ code.

On 16 fév, 02:03, Michael meicpal...@gmail.com 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL ES 2.0 for Live Wallpapers

2011-02-16 Thread Michael
I am testing my live wallpaper on a Galaxy Tab, and it works.


On Feb 16, 5:12 am, laurent mallet laurent.mal...@gmail.com 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 meicpal...@gmail.com 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: OpenGL ES 2.0 for Live Wallpapers

2011-02-15 Thread String
Having used GLWallpaperService for several live wallpapers (and if you're 
reading this, Robert, my thanks) - albeit no OGLES2.0 - my advice would be 
to just extend it for the methods you need. It's a very straightforward port 
from GLSurfaceView; the methods line up very nicely, so if OGLES2.0 adds one 
that you need, just try implementing it with the same footprint, and see how 
it goes.

String

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

[android-developers] Re: OpenGL ES 2.0 for Live Wallpapers

2011-02-15 Thread Michael
In the time before my first post was approved by the moderators, I
found a solution at 
https://github.com/ghisguth/blurred-lines-live/blob/master/src/cxa/lineswallpaper/Wallpaper.java
.

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