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
7
votes
1 answer

Button and GLSurfaceView

I have a GLSurfaceView where I show some animations using OpenGL. I now want to add a button to this view. How is this accomplished? Can it be done without involving the xml layout?
Marcus Johansson
  • 2,626
  • 2
  • 24
  • 44
7
votes
1 answer

android view or surfaceView, which should i use?

Ive been trying to make a scrollable/zoomable app and everything has gone great except for drawing bitmaps. It is a very large image (6656 by 4096) that i have split into tiles. There is a rectangle array that the bitmaps are drawn to, and it…
jfisk
  • 6,125
  • 20
  • 77
  • 113
7
votes
2 answers

setPreviewTexture failed in MTK device

Recently I am learning android Camera and OpenglES by grafika (Thanks fadden).It's good on most device, but I encounter bugs in some device, espacially MTK device(such as MT6580,MT8163...). For example, when "CameraCaptureActivity" run in MTK. I am…
orcs Yang
  • 113
  • 1
  • 7
7
votes
1 answer

Image effects with rotation and pinch to zoom using GLSurfaceView Android

I was developing an application to apply effects/rotation/pinch to zoom in-out functionality on image. I have downloaded demo application from https://github.com/Grishu/ImageEffects. It works well, now my problems/questions are as below: Apply…
Hiren Dabhi
  • 3,693
  • 5
  • 37
  • 59
7
votes
0 answers

Single black flicker when adding GLSurfaceView

I use a GLSurfaceView inside a CompoundView to implement a fancy navigation. Currently the GLSurfaceView is created when a subsection is selected, not right at the start. My problem is that the screen flickers for an instant when the GLSurfaceView…
stefs
  • 18,341
  • 6
  • 40
  • 47
7
votes
2 answers

eglCreateWindowSurface fails with java.lang.IllegalArgumentException

When trying to press the back button quickly during launching some Activities with GLSurfaceView, eglCreateWindowSurface fails with java.lang.IllegalArgumentException. I got the following errors: 10-08 18:05:36.490: E/GLSurfaceView(3440):…
Dalinaum
  • 1,142
  • 13
  • 18
6
votes
0 answers

Synchronization of Android Views on top of GLSurfaceView

Is there a good way to draw standard Android View objects on top of a GLSurfaceView and synchronize the movement between the two layers? My layout looks like The…
6
votes
1 answer

Pinch-Zoom with GLSurfaceView

I have a following problem - I am developing an application and i decided for the GLSurfaceView because i needed openGl for a better and more natural page curl animation. Having achieved that, now i find myself in a bit of a problem, since i cannot…
Nemanja
  • 1,505
  • 12
  • 24
6
votes
0 answers

How to make Circular Mask and Clip GLSurfaceView?

I work with an SDK that provides a rectangular GLSurfaceView through a callback. I want to be able to render this view in a circular layout. (i.e.) I would like to display the view on a circular view It's showing Circle shape when I overlay…
user11862491
6
votes
2 answers

Overlay Transparent GLSurfaceview onto existing view in android?

Hi I have been trying to overlay a GLSurfaceview onto an existing view.The code below shows how I overlay. The only thing that doesnt work is the transparency of the glsurfaceview on top. view = new GLSurfaceView(this); …
user560571
  • 1,977
  • 3
  • 17
  • 17
6
votes
2 answers

Android glSurfaceView with overlay using XML/Java

I started an Android OpenGL application and I have the following classes: class A extends Activity class B extends GlSurfaceView implements Renderer When class A's onCreate is called, it creates an object of type class B and…
madiyaan damha
  • 2,917
  • 5
  • 21
  • 15
6
votes
1 answer

How to save bitmap from GLSurfaceView (Only bitmap, not whole texture)

I am using this code to give multiple effect on bitmap that is on GlSurfaceView. apply-effects-on-image-using-effects Now, I want to save the bitmap. They have given the code to save the bitmap but with that, whole GlSurfaceView is going to be saved…
Shreyash Mahajan
  • 23,386
  • 35
  • 116
  • 188
6
votes
1 answer

Android WebRTC customize remote and local view

I am implementing the webrtc in an Android project and I am based on this sample in github. This example uses the libjingle library. This is how the video render view is created: // Create video renderers. …
Ultimo_m
  • 4,724
  • 4
  • 38
  • 60
6
votes
1 answer

Is it possible to use GPUImageView/ GLSurfaceview in recycler view?

I am working on photo editing app. I am using GPUImageView to apply effects.I want to display multiple thumbnail size images with different different effects in recycler view so that user gets the idea how image will look after applying that effect.
Deepak
  • 121
  • 12
6
votes
1 answer

IllegalArgumentException Surface.nativeLockCanvas , Choreographer, BufferQueue

I have a complex application that creates multiple Bitmap objets and uses them to create BitmapDrawables. I know this might be a tough question to answer, but any help in pointing me in the right direction would be much appreciated. I have run tests…
ChrisVollo
  • 157
  • 1
  • 3
  • 15
1 2
3
35 36