glsurfaceview

Drawing Android UI on top of GLSurfaceView

点点圈 提交于 2019-11-30 13:42:14
For my game, I am thinking of drawing UI elements (TextView for displaying time elapsed, Buttons for pausing/restarting game) on top of my GLSurfaceView using RelativeLayout... Till now, I was drawing all the UI elements myself directly to surfaceView but considering the wide options available from Android UI (like changing typeface of font and color), I have decided to use it. Questions: Is it good practice to draw UI elements on top of GLSurfaceView or is it better to draw all the UI stuff myself directly to GLSurfaceView ? I will be updating the content of the UI elements (Say TextView )

Recording a Surface using MediaCodec

别来无恙 提交于 2019-11-30 08:51:11
So, In my application, I am able to show effects(like blur filter, gaussian) to video that comes from Camera using GPUImage library. Basically, I (library) will take the input from the Camera, get's the raw byte data, converts it into RGBA format from YUV format, then applies effects to this image and displays on the Surface of GLSurfaceView using OpenGL. finally, to the user, it looks like a video with effects applied. Now I want to record the frames of Surface as a video using MediaCodec API. but this discussion says that we can not pass a predefined Surface to the MediaCodec . I have seen

How to properly use setZOrderMediaOverlay on Android?

你。 提交于 2019-11-30 07:17:59
Like many others, I am trying to draw 3D objects (using GLSurfaceView) on camera preview (using SurfaceView), along with some buttons placed on top. I actually got a prototype working, but I could not get the onResume working correctly. After a resume, GLSurfaceView stays behind and is not visible anymore. I know that it is working, because I can see the drawing fine if I remove the SurfaceView from the layout. The target is Nexus One, running stock 2.3.3 ROM. Here's the layout xml: <com.example.cameratest.GLPreview android:id="@+id/cubes" android:layout_width="fill_parent" android:layout

How can I use Multiple GLSurfaceView components in the same Layout?

安稳与你 提交于 2019-11-30 06:03:40
I'm writing an Information Visualization API for Android and ran into a problem trying to place two units of a custom GLSurfaceView into a Layout. The Custom GLSurfaceView at this point is simply an extension of the GLSurfaceView to eliminate possible faults caused by custom methods. When I have both components added in layout and start the application it runs. But nothing is drawn, seems like it enters an infinite loop. because debug messages inside the Renderers are printed into the LogCat. However, It works perfectly fine if I only use one of the custom GLSurfaceView components. I read that

Display black screen while capture screenshot of GLSurfaceView

折月煮酒 提交于 2019-11-29 23:31:27
问题 I am wandering for seven hours for solving my issue. I have created project in which i m using GLSurfaceView on which i have set one image and after that i have implement different effects on it using EffectFactory class. But my Problem is when i have taken a screen shot with effected image it always shows as a black screen instead of with image. I know that may be its because of SurFaceview . But If any suggestion which might be helpful for me. Thanks in Advance. Here is my code. public

绘制三角形

倖福魔咒の 提交于 2019-11-29 21:44:27
绘制一个三角形的步骤: 创建 OpenGLES 环境(可以借助于 GLSurfaceView 创建的上下文对象); 编译并链接着色器程序; 指定着色器程序,为着色器程序中的变量赋值; 绘制。 基于 GLSurfaceView 搭建 OpenGLES 环境 简单自定义 GLSurfaceView。 package com.byteflow.app; import android.content.Context; import android.opengl.GLSurfaceView; import android.util.AttributeSet; import android.util.Log; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; public class MyGLSurfaceView extends GLSurfaceView { private static final String TAG = "MyGLSurfaceView"; public static final int IMAGE_FORMAT_RGBA = 0x01; public static final int IMAGE_FORMAT_NV21 =

TextureView vs. GLSurfaceView or How to use GLSurfaceView with EGL14

青春壹個敷衍的年華 提交于 2019-11-29 20:20:03
I am getting confused with EGL. My GLSurfaceView creates an EGLContext. Now I create a shared context. Now I need to use a EGLExtension. The Method I have to use is called (>=API18): EGLExt.eglPresentationTimeANDROID(android.opengl.EGLDisplay display, android.opengl.EGLSurface surface, long time); The Problem is, that the GLSurfaceView does only creates javax.microedition.khronos.egl.EGLContext s. Which tells me, NOT to use GLSurfaceView. So I tried TextureView, which is slightly similar, with the difference that you have to handle your own EGL stuff. Which is good for that purpose. But: The

Drawing Android UI on top of GLSurfaceView

ε祈祈猫儿з 提交于 2019-11-29 19:15:28
问题 For my game, I am thinking of drawing UI elements (TextView for displaying time elapsed, Buttons for pausing/restarting game) on top of my GLSurfaceView using RelativeLayout... Till now, I was drawing all the UI elements myself directly to surfaceView but considering the wide options available from Android UI (like changing typeface of font and color), I have decided to use it. Questions: Is it good practice to draw UI elements on top of GLSurfaceView or is it better to draw all the UI stuff

glsurfaceview inside a scrollview, moving but not clipping

拈花ヽ惹草 提交于 2019-11-29 16:31:24
I have a scrollview with a linear layout inside. One of the elements inside this linearlayout is a glsurfaceview. This all works correctly and when I scroll the glsurfaceview moves up and down however when the glsurfaceview reaches the top or bottom of where it should of the scrollview where it should be clipped it is not and is continued outside of the scrollview. This screenshot should make it clearer: Don't think it's completly nessecary but here is my layout.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout

GLSurfaceView displaying black on Nexus 7 with Android 4.2

坚强是说给别人听的谎言 提交于 2019-11-29 13:53:24
I have an OpenGL ES2.0 app that is working on devices running various Android versions from 2.2 up to 4.1. However I have been told that when running it on a Nexus 7 with Android 4.2 the 3D graphics in the App are all black. The Action Bar and dialogs work fine though. I have tried it on an emulated Nexus 7 with Intel Atom processor, HAX and GPU enabled running 4.2.2 and that works OK. I would have preferred to run the ARM image but that doesn't seem to include Open GL ES2.0 Does anyone have any insight into what might be causing this problem on the Nexus 7 and how to work around it? One