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

Configuring multiple Activities each containing a GLSurfaceView within a TabHost

My set-up is as follows: a TabHost has two child Activities, each with a single GLSurfaceView as content. The two Activities are of course forwarding their onPause() and onResume() events to their GLSurfaceViews. The first Activity works as…
Rodskjegg
  • 489
  • 5
  • 2
0
votes
1 answer

Android OpenGL ES drawArray with pixel instead of range [-1,1]

i´m new to openGL and want to draw lines on an GLSurfaceView. I switched from canvas to openGL cause of the performance. I know that OpenGL is more likely for 3D drawings, so pixel are not used because of this. I want to draw 2D graphics like lines…
atpanos
  • 473
  • 6
  • 9
0
votes
1 answer

Menu to launch GLSurfaceViews

I wrote a cellphone interface for a measurement device. I have a bunch of distinct functional screens in the from of GLSurfaceViews. I can launch the renders correctly, but I can't figure out how to make the back button work. My render code looks…
Mikhail
  • 7,749
  • 11
  • 62
  • 136
0
votes
2 answers

Android - GLSurface, errror while closing

Every time I occur an error while I close the app. I dont know why? Its occur only on 2.3.7. Everything working fine on 3.2 and 4 FATAL EXCEPTION: main java.lang.NullPointerException at…
goodm
  • 7,275
  • 6
  • 31
  • 55
-1
votes
0 answers

Create Skia Context from GLSurfaceView

I'm trying to create a Skia Context inside my GLSurfaceView to draw to an OpengL Texture using Skia. This is my code: Java/Kotlin part: class SkiaPreviewView(context: Context): GLSurfaceView(context), GLSurfaceView.Renderer { init { …
mrousavy
  • 857
  • 8
  • 25
-1
votes
1 answer

How to feed the video frames directly to Encoder surface, without using Decoder?

I am developing a video compressor app where the general architecture everyone follow is first decode the video frames on the Output surface of decoder then swap those buffer directly to the Input surface and then encode it. Here we are using both…
Mohan
  • 53
  • 5
-1
votes
1 answer

GLSurfaceView crashes on device rotation / orientation change - NullPointerException

I have a GLSurfaceView that previews the camera and works fine in portrait. I've started to try and implement recording video in landscape, but get a strange error when the orientation changes. I do not override the OnConfigurationChanged method,…
JCutting8
  • 732
  • 9
  • 29
-1
votes
1 answer

Surface View Preview is stretched vertically

I am working on Live Streaming application using RTMP. I am in the initial state, I successful done lot of things but now stuck on one place. I am using Surface view and my video is little bit stretched vertically. Codes are below: This is my…
-1
votes
1 answer

How to modify transform matrix get from getTransformMatrix()

I could get the transform matrix(4x4) from surface by getTransformMatrix(), but I don't know how to set scale x,y or set pivot x,y of it. I don't know the matrix structure in this case. Help me. Here is the code: private SurfaceTexture…
Trung NT Nguyen
  • 403
  • 2
  • 14
-1
votes
2 answers

GLSurfaceView over Google MapView

Need to overlay two views. A GLSurfaceView and a MapView. My map view is following the code from the following Github location: Android Google Maps v2 The GLSurfaceView needs to be on top of the map view which I believe I just use zOrderOnTop(true);…
-1
votes
1 answer

GLSurfaceView is not working

I write a simple code to test GLSurfaceView. package com.jeobin.test; import android.app.Activity; import android.os.Bundle; import android.opengl.GLSurfaceView; public class MainActivity extends Activity { GLSurfaceView view; @Override …
-1
votes
1 answer

Problems showing a 3D model inside a glsurfaceview with opengl in android

I am trying to draw a simple cube in a glsurfaceview but i dont get a clean representation. I want to get only drawn a simple cube. My own renderer import javax.microedition.khronos.egl.EGLConfig; import…
unotki
  • 1
  • 1
-2
votes
1 answer

How to pass a PDF file to GlSurfaceView and render it?

I am new to openGlSurfaceView in android. I want to pass a PDF file to this surface view. Also I want to include a zoom in/out option for the PDF file. As I came across, drawing triangle and its 3D view, rotation only given. Can any one help me in…
Ammu
  • 97
  • 1
  • 10
-2
votes
1 answer

OpenGL with Android widgets contorls

I would like to use an accelerated 2d Graphics (OpenGL) together with standard android controls widgets in order to interact with objects in OpenGL. RayPicking is already implemented. Though I can select the objects. But how does it work with views…
1 2 3
35
36