glsurfaceview

passing instructions from UI thread to Rendering thread (GLSurfaceView)

独自空忆成欢 提交于 2019-12-04 16:19:54
The Setup : A RelativeLayout with a GLSurfaceView and a Button as shown in the image.. The Problem: Lets say I have other triangle models (The one in the picture being the initial model)... I wish to change the models cyclically on click of the button. Since button is on the UI thread and glSurfaceView runs on a separate thread, I don't exactly know how to pass the info/instruction to it. I know there is this thing called Handler in Android which might be useful in this case... But I need some help here.. Edit: If Handler is the right way, I need to know how to add Looper to that Handler...

Android Camera Live Filter

限于喜欢 提交于 2019-12-04 04:44:33
What is the best way for Camera Live filters. I am recently using GPUImage Library from Link: https://github.com/CyberAgent/android-gpuimagelibrary . Than I have found SurfaceView and GLSurfaceView. Problem is: How to apply live filter to camera using SurfaceView or GLSurfaceView. Thanks in advance. DAVE This link uses Texture View https://github.com/google/grafika/blob/master/app/src/main/java/com/android/grafika/LiveCameraActivity.java This uses surface view to play a movie..u can manipulate it for live camera https://github.com/google/grafika/blob/master/app/src/main/java/com/android

GLSurfaceView continuously renders despite changing render mode

北战南征 提交于 2019-12-03 17:47:38
问题 I'm trying to create a GLSurfaceView that displays a map of a game area. When the player moves, the game activity calls highlightSpot, which in turn should trigger a render request. The only time I want to re-draw the view is when the player moves. However, with my current implementation, despite calling setRenderMode(RENDERMODE_WHEN_DIRTY) on my GLSurfaceView, its render mode still seems to be continuous. To check, I threw a single println statement in my onDrawFrame method, and when I run

How to get an EGL display/context to a specific GLSurfaceView

独自空忆成欢 提交于 2019-12-03 13:56:58
问题 This is a follow up to my original Question, which was probably too broad (whereas this one is probably too specific but maybe I can apply Newton's Method). My specific situation is: OpenGL ES 2.0, on Android, using only Java (no JNI/Native code). I am trying to understand how EGL and Android's GLES implimentation work together (or don't). I am having trouble because the EGL interface(API) does not seem well suited to Android's Java centric, Activity based OS. As a specific example: I have

Android Graphic : apk and Skia/OpenGL|ES

只愿长相守 提交于 2019-12-03 12:27:50
Android apk 里面的画图分为2D和3D两种:2D是由 Skia 来实现的,也就是我们在框架图上看到的SGL,SGL也会调用部分 opengl 的内容来实现简单的3D效果;3D部分是由OpenGL|ES实现的,OpenGL|ES是Opengl的嵌入式版本,我们先了解一下Android apk的几种画图方式,然后再来来看一看这一整套的图形体系是怎么建立的。 首先画图都是针对提供给 应用 程序的一块内存填充 数据 , 没去研究过一个Activity是否就对应着底层的一个surface,但是应该都是对这块surface内存进行操作。因此说穿了就是我们要么调用2D 的API画图,要么调用3D的API画图,然后将画下来的图保存在这个内存中,最后这个内存里面的内容会被Opengl渲染以后变为可以在屏幕上的像素信息。 一 、Apk应用主要关心的还是这些API的使用,在Android apk里面画图有2种方式 [2D]: 1、Simple Graphics in View 就是直接使用Android已经实现的一些画图操作,比如说images,shapes,colors,pre-defined animation等等,这些简单的画图操作实际上是由skia来提供的2D图形操作。使用这些预定义好的操作,我们可以实现诸如贴一张背景图啊,画出简单的形状,实现一些简单的动画之类的操作

Using GLSurfaceView class with android xml layouts

岁酱吖の 提交于 2019-12-03 09:10:28
问题 I want to make use of the android xml layouts. I have put a glSurfaceView in a frame layout to use in conjunction with a linear layout like so... <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1"> <android.opengl.GLSurfaceView android:id="@+id/surfaceviewclass" android:layout_width="match_parent" android:layout_height="match_parent"/> </FrameLayout> <LinearLayout android:id="@+id/gamecontrolslayout" android:layout_width="fill

eglCreateWindowSurface fails with java.lang.IllegalArgumentException

匆匆过客 提交于 2019-12-03 08:30:24
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): eglCreateWindowSurface 10-08 18:05:36.490: E/GLSurfaceView(3440): java.lang.IllegalArgumentException: Make sure the SurfaceView or associated SurfaceHolder has a valid Surface 10-08 18:05:36.490: E/GLSurfaceView(3440): at com.google.android.gles_jni.EGLImpl._eglCreateWindowSurface(Native Method) 10-08 18:05:36.490: E/GLSurfaceView(3440): at com.google

GLSurfaceView continuously renders despite changing render mode

故事扮演 提交于 2019-12-03 06:37:52
I'm trying to create a GLSurfaceView that displays a map of a game area. When the player moves, the game activity calls highlightSpot, which in turn should trigger a render request. The only time I want to re-draw the view is when the player moves. However, with my current implementation, despite calling setRenderMode(RENDERMODE_WHEN_DIRTY) on my GLSurfaceView, its render mode still seems to be continuous. To check, I threw a single println statement in my onDrawFrame method, and when I run my application, the output quickly fills up my logcat without the player moving even once-- it's clearly

How do I use Android’s “Surface” classes?

自闭症网瘾萝莉.ら 提交于 2019-12-03 04:23:17
问题 Is there a detailed explanation of Surface, SurfaceHolder, EGLSurface, SurfaceView, GLSurfaceView, SurfaceTexture, and TextureView? In particular: What’s the difference between SurfaceView and TextureView? Do I need to use GLSurfaceView to use OpenGL ES? How do Surface and EGLSurface interact? What does SurfaceTexture do? Why does the stuff I draw on a SurfaceView have to go above or below everything else? What is SurfaceFlinger? How does composition of the status and navigation bars work?

eglCreateWindowSurface fails with java.lang.IllegalArgumentException

匿名 (未验证) 提交于 2019-12-03 03:00:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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): eglCreateWindowSurface 10-08 18:05:36.490: E/GLSurfaceView(3440): java.lang.IllegalArgumentException: Make sure the SurfaceView or associated SurfaceHolder has a valid Surface 10-08 18:05:36.490: E/GLSurfaceView(3440): at com.google.android.gles_jni.EGLImpl._eglCreateWindowSurface(Native Method) 10-08 18