¡@

Home 

2014/10/16 ¤W¤È 08:14:16

android Programming Glossary: gl10

Modifying camera output using SurfaceTexture and OpenGL

http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl

_delegate delegate _delegate public void onSurfaceCreated GL10 unused EGLConfig config mDirectVideo new DirectVideo texture.. 1.0f delegate.startCamera texture public void onDrawFrame GL10 unused float mtx new float 16 GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT.. mtx mDirectVideo.draw public void onSurfaceChanged GL10 unused int width int height GLES20.glViewport 0 0 width height..

Is Opengl Development GPU Dependant?

http://stackoverflow.com/questions/17229066/is-opengl-development-gpu-dependant

myGlsurface myGlsurfaceView public void onDrawFrame GL10 gl line.draw dx dy ux uy @Override public void onSurfaceCreated.. dx dy ux uy @Override public void onSurfaceCreated GL10 gl EGLConfig config Log.i JO onSurfaceCreated Set the background.. @Override public void onSurfaceChanged GL10 gl int width int height Adjust the viewport based on geometry..

Taking screenshot of Android OpenGL

http://stackoverflow.com/questions/3310990/taking-screenshot-of-android-opengl

glContext.glReadPixels 0 0 width height GL10.GL_RGBA GL10.GL_UNSIGNED_BYTE buf int data new int size buf.asIntBuffer.. glContext.glReadPixels 0 0 width height GL10.GL_RGBA GL10.GL_UNSIGNED_BYTE buf int data new int size buf.asIntBuffer .get.. a correct screenshot You have to put into Your onDrawFrame GL10 gl handler the following code if screenshot int screenshotSize..

Overlay images onto Camera preview SurfaceView

http://stackoverflow.com/questions/3548666/overlay-images-onto-camera-preview-surfaceview

mCube new Cube public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT.. mCube new Cube public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT gl.glMatrixMode.. onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT gl.glMatrixMode GL10.GL_MODELVIEW gl.glLoadIdentity..

Android: GLES20: Called unimplemented OpenGL ES API

http://stackoverflow.com/questions/5926316/android-gles20-called-unimplemented-opengl-es-api

EGLConfigChooser @Override public EGLConfig chooseConfig EGL10 egl EGLDisplay display EGLConfig configs new EGLConfig 1 int.. num_config new int 1 boolean check false int configSpec EGL10.EGL_DEPTH_SIZE 16 EGL10.EGL_NONE check egl.eglInitialize display.. check false int configSpec EGL10.EGL_DEPTH_SIZE 16 EGL10.EGL_NONE check egl.eglInitialize display new int 2 0 if check..

Android OpenGL 3D picking

http://stackoverflow.com/questions/6699387/android-opengl-3d-picking

mg new MatrixGrabber ... public void onDrawFrame GL10 gl gl.glDisable GL10.GL_COLOR_MATERIAL gl.glDisable GL10.GL_BLEND.. ... public void onDrawFrame GL10 gl gl.glDisable GL10.GL_COLOR_MATERIAL gl.glDisable GL10.GL_BLEND gl.glDisable GL10.GL_LIGHTING.. GL10 gl gl.glDisable GL10.GL_COLOR_MATERIAL gl.glDisable GL10.GL_BLEND gl.glDisable GL10.GL_LIGHTING Background drawing if..

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

context int camera_texture public void onSurfaceCreated GL10 unused EGLConfig config initShapes GLES20.glClearColor 0.0f.. shader return shader public void onDrawFrame GL10 unused GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT GLES20.GL_DEPTH_BUFFER_BIT.. gvTexCoordHandle public void onSurfaceChanged GL10 unused int width int height GLES20.glViewport 0 0 width height..

Android OpenGL Texture Compression

http://stackoverflow.com/questions/9148795/android-opengl-texture-compression

if you're not using ETC1 public void onSurfaceCreated GL10 gl EGLConfig config String s gl.glGetString GL10.GL_EXTENSIONS.. GL10 gl EGLConfig config String s gl.glGetString GL10.GL_EXTENSIONS if s.contains GL_IMG_texture_compression_pvrtc.. instead of glTexImage2D public void onDrawFrame GL10 gl .... gl.glCompressedTexImage2D GL10.GL_TEXTURE_2D level internalformat..

Modifying camera output using SurfaceTexture and OpenGL

http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl

MainActivity delegate public MyGL20Renderer MainActivity _delegate delegate _delegate public void onSurfaceCreated GL10 unused EGLConfig config mDirectVideo new DirectVideo texture texture createTexture GLES20.glClearColor 0.5f 0.5f 0.5f 1.0f.. texture createTexture GLES20.glClearColor 0.5f 0.5f 0.5f 1.0f delegate.startCamera texture public void onDrawFrame GL10 unused float mtx new float 16 GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT GLES20.GL_DEPTH_BUFFER_BIT surface.updateTexImage.. surface.updateTexImage surface.getTransformMatrix mtx mDirectVideo.draw public void onSurfaceChanged GL10 unused int width int height GLES20.glViewport 0 0 width height static public int loadShader int type String shaderCode..

Is Opengl Development GPU Dependant?

http://stackoverflow.com/questions/17229066/is-opengl-development-gpu-dependant

myGlsurfaceView Log.i JO MyRenderer this.main mainActivity myGlsurface myGlsurfaceView public void onDrawFrame GL10 gl line.draw dx dy ux uy @Override public void onSurfaceCreated GL10 gl EGLConfig config Log.i JO onSurfaceCreated Set the.. myGlsurfaceView public void onDrawFrame GL10 gl line.draw dx dy ux uy @Override public void onSurfaceCreated GL10 gl EGLConfig config Log.i JO onSurfaceCreated Set the background frame color GLES20.glClearColor 0.0f 0.0f 0.0f 1.0f Create.. GLES20.GL_BLEND GLES20.glBlendFunc GLES20.GL_ONE GLES20.GL_ONE_MINUS_SRC_ALPHA @Override public void onSurfaceChanged GL10 gl int width int height Adjust the viewport based on geometry changes such as screen rotation GLES20.glViewport 0 0 width..

Taking screenshot of Android OpenGL

http://stackoverflow.com/questions/3310990/taking-screenshot-of-android-opengl

buf ByteBuffer.allocateDirect size 4 buf.order ByteOrder.nativeOrder glContext.glReadPixels 0 0 width height GL10.GL_RGBA GL10.GL_UNSIGNED_BYTE buf int data new int size buf.asIntBuffer .get data buf null Bitmap bitmap Bitmap.createBitmap.. ByteBuffer.allocateDirect size 4 buf.order ByteOrder.nativeOrder glContext.glReadPixels 0 0 width height GL10.GL_RGBA GL10.GL_UNSIGNED_BYTE buf int data new int size buf.asIntBuffer .get data buf null Bitmap bitmap Bitmap.createBitmap width height.. Sorry for the late response... In order to perform a correct screenshot You have to put into Your onDrawFrame GL10 gl handler the following code if screenshot int screenshotSize width height ByteBuffer bb ByteBuffer.allocateDirect screenshotSize..

Overlay images onto Camera preview SurfaceView

http://stackoverflow.com/questions/3548666/overlay-images-onto-camera-preview-surfaceview

useTranslucentBackground mTranslucentBackground useTranslucentBackground mCube new Cube public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT gl.glMatrixMode GL10.GL_MODELVIEW gl.glLoadIdentity gl.glTranslatef.. mTranslucentBackground useTranslucentBackground mCube new Cube public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT gl.glMatrixMode GL10.GL_MODELVIEW gl.glLoadIdentity gl.glTranslatef 0 0 5.0f.. useTranslucentBackground mCube new Cube public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT gl.glMatrixMode GL10.GL_MODELVIEW gl.glLoadIdentity gl.glTranslatef 0 0 5.0f gl.glRotatef mAngle 0..

Android: GLES20: Called unimplemented OpenGL ES API

http://stackoverflow.com/questions/5926316/android-gles20-called-unimplemented-opengl-es-api

GLSurfaceView this mGLSurfaceView.setEGLConfigChooser new EGLConfigChooser @Override public EGLConfig chooseConfig EGL10 egl EGLDisplay display EGLConfig configs new EGLConfig 1 int num_config new int 1 boolean check false int configSpec EGL10.EGL_DEPTH_SIZE.. egl EGLDisplay display EGLConfig configs new EGLConfig 1 int num_config new int 1 boolean check false int configSpec EGL10.EGL_DEPTH_SIZE 16 EGL10.EGL_NONE check egl.eglInitialize display new int 2 0 if check return null check false check egl.eglChooseConfig.. EGLConfig configs new EGLConfig 1 int num_config new int 1 boolean check false int configSpec EGL10.EGL_DEPTH_SIZE 16 EGL10.EGL_NONE check egl.eglInitialize display new int 2 0 if check return null check false check egl.eglChooseConfig display..

Android OpenGL 3D picking

http://stackoverflow.com/questions/6699387/android-opengl-3d-picking

GLSurfaceView.Renderer public PointCloud ptCloud MatrixGrabber mg new MatrixGrabber ... public void onDrawFrame GL10 gl gl.glDisable GL10.GL_COLOR_MATERIAL gl.glDisable GL10.GL_BLEND gl.glDisable GL10.GL_LIGHTING Background drawing if customBackground.. public PointCloud ptCloud MatrixGrabber mg new MatrixGrabber ... public void onDrawFrame GL10 gl gl.glDisable GL10.GL_COLOR_MATERIAL gl.glDisable GL10.GL_BLEND gl.glDisable GL10.GL_LIGHTING Background drawing if customBackground gl.glClearColor.. mg new MatrixGrabber ... public void onDrawFrame GL10 gl gl.glDisable GL10.GL_COLOR_MATERIAL gl.glDisable GL10.GL_BLEND gl.glDisable GL10.GL_LIGHTING Background drawing if customBackground gl.glClearColor backgroundRed backgroundGreen..

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

private int gvSamplerHandle private static Context context int camera_texture public void onSurfaceCreated GL10 unused EGLConfig config initShapes GLES20.glClearColor 0.0f 1.0f 0.2f 1.0f Debug.out Hello init. Shaders int vertexShader.. compile it GLES20.glShaderSource shader shaderCode GLES20.glCompileShader shader return shader public void onDrawFrame GL10 unused GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT GLES20.GL_DEPTH_BUFFER_BIT if camera_texture null return Add program to.. maPositionHandle GLES20.glDisableVertexAttribArray gvTexCoordHandle public void onSurfaceChanged GL10 unused int width int height GLES20.glViewport 0 0 width height public void takeContext Context ocontext Debug.out Take context..

Android OpenGL Texture Compression

http://stackoverflow.com/questions/9148795/android-opengl-texture-compression

assets. Determine which extensions are available in the device if you're not using ETC1 public void onSurfaceCreated GL10 gl EGLConfig config String s gl.glGetString GL10.GL_EXTENSIONS if s.contains GL_IMG_texture_compression_pvrtc Use PVR compressed.. in the device if you're not using ETC1 public void onSurfaceCreated GL10 gl EGLConfig config String s gl.glGetString GL10.GL_EXTENSIONS if s.contains GL_IMG_texture_compression_pvrtc Use PVR compressed textures else if s.contains GL_AMD_compressed_ATC_texture.. Load compressed texture as raw data. Use glCompressedTexImage2D instead of glTexImage2D public void onDrawFrame GL10 gl .... gl.glCompressedTexImage2D GL10.GL_TEXTURE_2D level internalformat width height border imageSize data share improve..