opengl-es

How to get UIImage from EAGLView?

我只是一个虾纸丫 提交于 2019-12-17 06:06:49
问题 I am trying to get a UIImage from what is displayed in my EAGLView. Any suggestions on how to do this? 回答1: EDIT: as demianturner notes below, you no longer need to render the layer, you can (and should) now use the higher-level [UIView drawViewHierarchyInRect:] . Other than that; this should work the same. An EAGLView is just a kind of view, and its underlying CAEAGLLayer is just a kind of layer. That means, that the standard approach for converting a view/layer into a UIImage will work.

Animation in OpenGL ES view freezes when UIScrollView is dragged on iPhone

不打扰是莪最后的温柔 提交于 2019-12-17 05:49:06
问题 I have an animated transparent OpenGL ES subview (a modification of Apple's template EAGLView class) which draws a rotating sphere. Just like Apple's example, CADisplayLink is used on devices where available. On the same screen, there is a UIScrollView containing UIButtons that can be selected. When the user scrolls the UIScrollView, the animation of my EAGLView freezes. This behavior is reproduced on iOS Simulator 4.2 and on iPhone OS 3.1.3 on an iPhone 2G device. Any ideas on what to do to

Modifying camera output using SurfaceTexture and OpenGL

爷,独闯天下 提交于 2019-12-17 04:45:41
问题 I am trying to filter the stream coming from the camera hardware by running it through an openGL filter, then displaying it in a GLSurfaceView. When openGL goes to render the frame, the LogCat repeatedly spits out an error: [unnamed-3314-0] updateTexImage: clearing GL error: 0x502 0x502 is a generic openGL error, and doesn't really help me track down the problem. This is a sequence of how the code works (or atleast should be working as seen in my head), and I've copied my code below that. I

Modifying camera output using SurfaceTexture and OpenGL

痞子三分冷 提交于 2019-12-17 04:45:09
问题 I am trying to filter the stream coming from the camera hardware by running it through an openGL filter, then displaying it in a GLSurfaceView. When openGL goes to render the frame, the LogCat repeatedly spits out an error: [unnamed-3314-0] updateTexImage: clearing GL error: 0x502 0x502 is a generic openGL error, and doesn't really help me track down the problem. This is a sequence of how the code works (or atleast should be working as seen in my head), and I've copied my code below that. I

GLES10.glGetIntegerv returns 0 in Lollipop only

若如初见. 提交于 2019-12-17 03:09:39
问题 This piece of code used to work in my Nexus 7 2012 KitKat: int[] maxSize = new int[1]; GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0); In KitKat I can obtain the max pixel value correctly, but after the upgrade to factory image Lollipop this snippet of code causes problem as it only returns 0. The logcat showed this output when it reached this method: E/libEGL﹕ call to OpenGL ES API with no current context (logged once per thread) I already have android:hardwareAccelerated="true"

Draw text in OpenGL ES

China☆狼群 提交于 2019-12-16 23:00:25
问题 I'm currently developing a small OpenGL game for the Android platform and I wonder if there's an easy way to render text on top of the rendered frame (like a HUD with the player´s score etc). The text would need to use a custom font also. I've seen an example using a View as an overlay, but I don't know if I want to do that since I might want to port the game to other platforms later. Any ideas? 回答1: The Android SDK doesn't come with any easy way to draw text on OpenGL views. Leaving you with

OpenGL ES Startup

安稳与你 提交于 2019-12-14 04:12:26
问题 I done a 1:1 copy of the iOS App "MohrenJass" to Android. -> Austria Cardgame.. Good training example :) Good introduction to Activity, Views, Canvas, Preference, APIs, and more Now i done the OpenGL ES Sample from the Developer page. I read about OpenGL but i have a Question about it. There are realy some points in it who give me some hard times. Matrix, vertex, shader, fragment, projection, camera,... Its not that i not understand it, but only to know "do this when that" is not enough for

Android — putting the GLSurfaceView.Renderer to sleep (as in Thread.sleep(20)) outside of the OnDrawFrame Method

好久不见. 提交于 2019-12-14 03:57:40
问题 I want to control the rendering rate of my GLSurfaceView.Renderer. I implemented a thread in the class that extends GLSurfaceView, and put it to sleep periodically in a while(true) loop, which did nothing to slow down the renderer. There's a good answer here that suggests putting the GL Thread to sleep by using a Thread.sleep within the Renderer.onDrawFrame() method. I'd like to handle it from outside the Renderer class. How can that be done when an explicit call requires passing in a GL10

Textures not drawing if multiple EAGLViews are used

僤鯓⒐⒋嵵緔 提交于 2019-12-14 03:48:35
问题 I'm having a bit of a problem with Apples EAGLView and Texture2D. If I create an instance of EAGLView and draw some textures, it works great. However, whenever I create a second instance of EAGLView, the textures in the new view(s) aren't drawn. Being new to OpenGL, I've got absolutely now clue as to what is causing this behavior. If somebody would like to help, I've created a small project that reproduces the behavior. The project can be found at http://www.cocoabeans.se/OpenGLESBug.zip Many

Need to use opengl in combination with View

♀尐吖头ヾ 提交于 2019-12-14 03:43:21
问题 I am new in android. I need to use opengl in combination with View Class to draw something. How to do this. plz give me any hints or suggestions... 回答1: You also have the option to combine "normal" android views (Button, ImageView, etc) in a layout with a GlSurfaceView. (i.e. FrameLayout) By doing so you can combine normal android UI with openGL, you can also make a composite view where the openGL view is just part of the layout. This is the way ads are usually displayed overlaying 3D