eaglview

Multiple EAGLViews but only one copy of each texture - how?

。_饼干妹妹 提交于 2020-02-02 09:12:20
问题 I have an app running on iPad which is using lots of textures, rendering into one EAGLView. Now I need a second EAGLView, sharing textures with the first. I can get both views rendering fine, in parallel, on screen, by fixing some design mistakes in Apple's code (e.g. the default ViewController needs some tweaks to support multiple child EAGLView objects). But I can't get the textures to be shared. I cannot duplicate the textures (that would double memory usage - and we're using most of the

Multiple EAGLViews but only one copy of each texture - how?

元气小坏坏 提交于 2020-02-02 09:10:13
问题 I have an app running on iPad which is using lots of textures, rendering into one EAGLView. Now I need a second EAGLView, sharing textures with the first. I can get both views rendering fine, in parallel, on screen, by fixing some design mistakes in Apple's code (e.g. the default ViewController needs some tweaks to support multiple child EAGLView objects). But I can't get the textures to be shared. I cannot duplicate the textures (that would double memory usage - and we're using most of the

glDrawArrays crash with EXC_BAD_ACCESS

天大地大妈咪最大 提交于 2020-01-14 19:52:29
问题 I'm writing an iPhone application which uses UIView with a CAEAGLayer as its layer. Everything is fine and working apart from 1 small problem: sometimes it crashes with EXC_BAD_ACCESS and the following stack trace: [EAGLView draw] glDrawArrays_Exec PrepareToDraw DrawFramebufferMakeResident AttachmentMakeResident TextureMakeResident memmove it crashes on the line: glVertexPointer(3, GL_FLOAT, 0, vertexCoordinates); glTexCoordPointer(2, GL_FLOAT, 0, textureCoordinates); glBindTexture(GL_TEXTURE

How do I grab an image from my EAGLLayer ?

China☆狼群 提交于 2020-01-11 03:41:12
问题 I'm looking for way to grab the content of my opengl (as UIImage) and then save it into a file. I'm now giving glReadPixels a try though I'm not sure I'm doing the right thing as of what kind of malloc I should be doing. I gather that on OSX it's GL_BGRA but on the iPhone that doesn't work... 回答1: All OpenGL|ES complient GL-implementations have to support GL_RGBA as a parameter to glReadPixels. If your OpenGL|Es supports the GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES extension you can also query

Check iOS XCode Project Files: openGL Particle Emitter for GLKit

守給你的承諾、 提交于 2020-01-06 03:50:08
问题 I am trying to port the Particle Emitter by Michael Daley to GLKView and found a XCode project where he did this on github - unfortunately heavily bound inside a nice little game. Now I tried to take only the particle emitter out of his game project to reuse it (I need it in 2D) and I made it up to a state without any compile error - but couldn't see nothing... Here is the project file. Could anybody tell me why there is no particle emitter visible? thnx! 来源: https://stackoverflow.com

EAGLView to UIImage timing question

你说的曾经没有我的故事 提交于 2020-01-05 07:51:57
问题 I have a EAGLView that I wish to convert into a UIImage. I can do this with the solution posted here: How to get UIImage from EAGLView? However, I can only accomplish this if a small amount of time has gone by between the creation of the EAGLView and the UIImage. This code, which creates a EAGLView, and then a UIImageView right afterwards, does not work: EAGLView *EAGLphoto = [[EAGLView alloc] initWithImage:photo.workAreaImage]; [theWorkArea.photoArea1 addSubview:EAGLphoto]; //I put a

iOS: Creating an overlay on top of an EAGLView / GLKView

ⅰ亾dé卋堺 提交于 2019-12-24 23:20:12
问题 I'm trying to create an overlay on top of a GLKView (effectively an EAGLView ). I'm aware of the performance impact, but in my situation that's not a problem, since the scene is paused in the background, it merely needs to remain visible. I've created a custom UIView called ReaderView whose only custom code is the following: -(CALayer*)layer { CATextLayer *textLayer = [[CATextLayer alloc] init]; // Layer settings. [textLayer setCornerRadius:5.0f]; // Text settings. [textLayer setFont

Capturing EAGLview content WITH alpha channel on iPhone

拜拜、爱过 提交于 2019-12-18 05:13:30
问题 have been struggling with this issue for quite some time now and couldn't find an answer so far. Basically, what I want to do, is capturing the content of my EAGLview and then use it to merge it with other images. Anyway, the mainproblem is, that everything transparent in my EAGLview renders opaque when saving it to the photoalbum or putting it into a UIImageView. Let me share some code with you, I found somewhere else: - (CGImageRef) glToUIImage { unsigned char buffer[320*480*4];

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.

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