2 Replies - 2100 Views - Last Post: 30 May 2013 - 06:14 AM Rate Topic: -----

#1 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 194
  • View blog
  • Posts: 1,099
  • Joined: 13-March 09

OpenGL ES 1.0 - Transparent Background \w setZOrderOnTop(false)

Posted 29 May 2013 - 06:17 PM

Hi.
My SurfaceView used to have a transparent background when setting setZOrderOnTop(true);
But now, because i want to be able to display a SlidingDrawer abow it, i've changed it to setZOrderOnTop(false);

But now the background is black no matter what i set glClearColor to.
Is it even possible to make the background transparent while setZOrderOnTop is false?
And if so, how?

I've been searching for hours, but i can't find anything about it.

Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: OpenGL ES 1.0 - Transparent Background \w setZOrderOnTop(false)

#2 Kainyu  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 14
  • Joined: 14-March 13

Re: OpenGL ES 1.0 - Transparent Background \w setZOrderOnTop(false)

Posted 30 May 2013 - 01:27 AM

I really have no idea about this but it intrigued me so I googled a little found differing answers:

"GLSurfaceView cannot really have a background. The way a surface view works is by cutting a hole through your Activity's window and showing another surface behind. Setting setZOrderOnTop(true) moves the surface above the Activity's window."

Is one he solved the problem by rendering the background to a polygon behind everything else.

Another used glsurfaceview like so

glRenderer  = new OpenGLRenderer(context);
view = new GLSurfaceView(context);
view.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
view.setRenderer(glRenderer);
view.getHolder().setFormat(PixelFormat.RGBA_8888);
view.getHolder().setFormat(PixelFormat.TRANSLUCENT);
view.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);


Then used framelayout to put a view under glsurfaceview?

I don't know much about OpenGL ES so I don't know how much help these will be but thought i'd put them up anyways.
Was This Post Helpful? 0
  • +
  • -

#3 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 194
  • View blog
  • Posts: 1,099
  • Joined: 13-March 09

Re: OpenGL ES 1.0 - Transparent Background \w setZOrderOnTop(false)

Posted 30 May 2013 - 06:14 AM

The polygon-solution sounds like a good one. Did he say how he got bitmap if whatever is behind the View?

Also tried those settings before, but didn't help.

I'm actually using a RelativeLayout, but it should work just as well.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1