Questions tagged [glsurfaceview]

GLSurfaceView is a subclass of SurfaceView for Android. It provides a dedicated surface for displaying OpenGL ES rendering.

GLSurfaceView extends SurfaceView, providing:

  • EGL context creation and management.
  • Renderer thread management.

The class is just a wrapper around SurfaceView. It's not necessary to use GLSurfaceView to render with OpenGL ES; a plain SurfaceView or TextureView will work. If you want more control over the EGL context lifetime, or better control over when rendering occurs, use one of the other classes.

For a simple example of a game written with GLSurfaceView, see Android Breakout.

Additional details about GLSurfaceView can be found in the graphics architecture document. The appendix on game loops may also be relevant, as games are one of the more common uses for GLSurfaceView. Examples of using GLES with SurfaceView and TextureView can be found in Grafika.

539 questions
0
votes
1 answer

GLSurfaceView as Texture

I've been trying to render a GLSurfaceView on the surface of a OpenGL Cube as a Texture. Is it possible? How to go about it?
Cherry
  • 1
  • 1
0
votes
1 answer

How can I inflate glsurfaceview in android's layout xml

I am trying to put a GLSurfaceView in a xml layout, but when I try to do it my application keeps closing automatically. I think the problem is in layout/activity_main.xml, because I don't know the name of the tag for glsurgaceview. This is my code.…
0
votes
1 answer

Modify Grafika Texture2dProgram to draw picture in picture (or texture in texture)

I am new to openGL so having some issues figure out how to modify grafika texture2dProgram so that I can get a picture in picture effect (or texture in texture). Here is my understanding so far from all the examples: (after surface is ready) Setup…
kungfoo
  • 597
  • 5
  • 16
0
votes
1 answer

How to show UI in GLSurfaceView based game Android?

I am building a game which contains a GLSurfaceView. This GLSurfaceView receives all touch events and based on that game proceeds. Now based on certain conditions i want to show certain dialog box. Say game ends on a double tap, I want to show a…
Abhishek Bansal
  • 5,197
  • 4
  • 40
  • 69
0
votes
1 answer

Android screen rendered really wrong

I'm using a GLSurfaceView to render a live wallpaper behind my apps interface which consists of android UI elements. In the beginning of my app I ask the user if they would like to see this wallpaper or not. ONLY if the user accepts the…
0
votes
2 answers

opengl - how to keep updating a scene forever

For every incoming tweet, I was asked to put a point (corresponding to tweet location) on world map (opengl scene). Some thing like this. I tried to learn OpenGL. I cried. With time, OpenGL started feeling like my friend. He was on the way to become…
kiranpradeep
  • 10,859
  • 4
  • 50
  • 82
0
votes
1 answer

How To Display GlSurfaceView in Phonegap in android

I have requirement in my Project. My project is Video conference call using third party library. I am doing this project in Native android and phonegap. In Native android, After succefully connect video conference call , The thrird party library…
0
votes
1 answer

Android OpenGL SurfaceHolder Callbacks

The Android Docs state that for surfaceCreated, surfaceChanged and surfaceDestroyed: This method is part of the SurfaceHolder.Callback interface, and is not normally called or subclassed by clients of GLSurfaceView However, they are called in my…
Zippy
  • 3,826
  • 5
  • 43
  • 96
0
votes
0 answers

View losing ability to accept key events

I'm a little confused over how key events (back key, volume keys) relate to Views in android. Take for example the problem I currently have: Working OK Create Layout (for example, Relative layout) Add View to Layout (A GL SurfaceView) Run app and…
Zippy
  • 3,826
  • 5
  • 43
  • 96
0
votes
1 answer

3 x 3 filter kernel (blur) on a SurfaceView

I am trying to implement a real time blur on a SurfaceView or GlSurfaceView getting a camera feed and came across this: Grafika https://github.com/google/grafika It has a feature that lets you apply a real time blur filter but the blur is not strong…
Steven Kz
  • 21
  • 3
0
votes
1 answer

How to stop onDrawFrame being called when app is sent into background *before* onDrawFrame is reached

OK, so the title is a little confusing, granted. I'll try to explain in a little more detail. I have a splashscreen which is basically a simple / static loading graphic which is displayed as a 'dialog' over my GLSurfaceView. I load all my…
Zippy
  • 3,826
  • 5
  • 43
  • 96
0
votes
1 answer

How to stop music from starting if app is in background?

OK, I've spent 2 days on this almost and getting nowhere, so posting here in hope that someone can come up with a solution of sorts! In my app, I kick my music off in my onSurfaceChanged method. Seems a pretty good place to do it, as it will start…
Zippy
  • 3,826
  • 5
  • 43
  • 96
0
votes
1 answer

HOW to read pixel data from screen in android using GLES 3

i am using GLES 3 to create 3D textures and render data in surface view. Is it possible to read this data from the screen/texture some how.
0
votes
1 answer

Is GLSurfaceView necessary for drawing a plot?

I'm developing an app that will connect to (my own) oscilloscope, read data via USB and display plots - so just normal oscilloscope. USB is ok, now I have to draw the graphs. As you know (or not) in oscilloscope there are really fast-changing…
zupazt3
  • 966
  • 9
  • 30
0
votes
1 answer

Putting textview on top of GLSurfaceView

Please point me to any links for putting textview on GLSurfaceView.I want to show some varying number in textview. The GLSurfaceView example i am following http://www.learnopengles.com/android-lesson-one-getting-started/ I have modified OnDraw…
Mayank Agarwal
  • 447
  • 1
  • 7
  • 21