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
0 answers

Android, set value through GLSurfaceView

I try to send a value from my Activity through a GLSurfaceView to the Renderer, but there are some problems with the object in the SurfaceView class. I think I can't access directly to the Renderer from my Activity, I've tried. I get a…
user3630061
0
votes
0 answers

TranslateAnimation doesn't work on layout containing GLSurfaceView

I've got an activity that contains 3 layouts, they are inflated on creation of the activity and the user can switch between them with a slide in / slide out animation (using TranslateAnimation). I've got a custom layout that manage animation when…
0
votes
1 answer

Using 2 SurfaceView lag

I want to display 3D objects with jPCT, so I use a custum GLSurfaceView.Renderer to display what I want. And below, I need to display a camera preview. It's work fine but my problem is when I display the 2 SurfaceView (1 for the object and 1 for the…
Mekiis
  • 5
  • 3
0
votes
1 answer

GLSurfaceView OnToucListener only works when drawing

I'm using an OnTouchListener on a GLSurfaceView, but it appears that it only works while drawing. So, if it takes too much time to draw the frame, I'll get most of the touch events handled, but if the frame is being drawn in less than 16ms, I've no…
dragostis
  • 2,574
  • 2
  • 20
  • 39
0
votes
0 answers

KitKat version destroys GLSurfaceView

KitKat version destroys GLSurfaceView when mediaplayer containing glsurfaceview is gone to background Description: I have a sample app with mediaplayer containing glsurfaceview plays local video.If user goes to device settings page and come back to…
0
votes
4 answers

No empty constructor error, SurfaceHolder.callback

I am trying to display the camera view using a class extends surfaceview and implements surfaceholder.callback. in my main activity ViewActivity, as shown below, i instantiate an object from the SurfaceHolderActivity and set it as a view using…
user3558352
0
votes
1 answer

GLSurfaceView scrollTo does nothing

I've been trying for a while to vertically scroll a GLSurfaceView that's not displayed in its entirety. I feel a bit dumb posting such a short explanation of my question, but that's all I can muster: I know the window is getting the click and drag…
0
votes
1 answer

Unable to use GL11ExtensionPack in Monodroid

I'm using a GLSurfaceView and need to use some of the methods in the IGL11ExtensionPack (GlGenRenderbuffersOES(), for example). In the native Android examples I've seen, this is simply done by casting the GL10 object provided by the framework to a…
joates
  • 1,103
  • 2
  • 11
  • 22
0
votes
1 answer

How to do clean up in native heap when opengl context lost in GLSurfaceview in Android?

I'm making a wrapper for a native 3d engine. and I used GLSurfaceView to establish egl context for my engine. The problem is that, when GLSurfaceView lose its egl context (onPause, etc), I really wanna free the memory the engine used. However, there…
laugher
  • 33
  • 8
0
votes
1 answer

Record GLSurfaceView on < Android 4.3

I'm developing an app for applying effects to the camera image in real-time. Currently I'm using the MediaMuxer class in combination with MediaCodec. Those classes were implemented with Android 4.3. Now I wanted to redesign my app and make it…
chris6523
  • 530
  • 2
  • 8
  • 18
0
votes
0 answers

Seekbar progress changed but GLSurface view not affected

I am developing app in which i want to give brightness to my GLsurfaceView on progress changed of Seekbar. The progress changed but GLsurfaceView can't be effected means i can't increment or decrement brightness eventhough color are also not applied…
Piyush
  • 18,895
  • 5
  • 32
  • 63
0
votes
2 answers

Android - Overlaying a color on OpenGL ES Surface Render

This is going to be a really short question without any code, so I feel I shouldn't be asking it, but I can't find any information on it online. I want to lay a color over my entire screen, or more correct terms would be the surface render, in…
josephoneill
  • 853
  • 2
  • 10
  • 33
0
votes
1 answer

GLSurfaceView does not detect gestures android

I am trying to make a simple 2D game using Opengl es 2. I am using GLSurfaceView. I am trying to detect fling gesture on the view but it does not detect anything. Why is this? Following is the code :- Tried to declare the gesture detecter inside…
Swati Rawat
  • 1,729
  • 1
  • 19
  • 34
0
votes
1 answer

Using OpenGL in InputMethod service

I'm developing a concept-keyboard and I need to drop animated shadows on keys. It is possible to use OpenGL ES while subclassing InputMethodService? If I'd use a GLSurfaceView in onCreateInputView, will it conflict with the current visible activity…
user781847
0
votes
0 answers

Adding ImageView on top of GLSurfaceView cause black screen on start

I found this explanation to draw a button on top of GLSurfaceView very useful, but every time just after starting my app I got black-screen for some 500-1000 ms. After that evrything is drawn correctly. Someone suggested to try…
n4v4j0
  • 1
  • 1