opengl-es

OpenGL coordinates to match screen coordinates?

梦想与她 提交于 2020-02-01 04:41:45
问题 Android opengl-es view question. So in openGL, the default position of the camera and view is at 0,0. How do you set the view and camera so that it acts basically the same as computer screen coordinates with 0,0 at the top. I've called gl.glOrthof(-screenWidth/2, ScreenWidth/2, -ScreenHeight/2, ScreenHeight/2). But I think this is wrong. I also need to set the camera to view the entire field. I'm not sure how to use gl.glFrustumf to accomplish this task. 回答1: To use your vertex coordinates as

GLKTextureLoader fails when loading a certain texture the first time, but succeeds the second time

落花浮王杯 提交于 2020-02-01 01:35:13
问题 I'm making an iPhone application with OpenGL ES 2.0 using the GLKit. I'm using GLKTextureLoader to load textures synchronously. The problem is that for a certain texture, it fails to load it the first time. It gives this error: The operation couldn’t be completed. (GLKTextureLoaderErrorDomain error 8.) For this error code, the apple documentation says the following: GLKTextureLoaderErrorUncompressedTextureUpload An uncompressed texture could not be uploaded. Available in iOS 5.0 and later.

filled antialiased poly cocos2d

给你一囗甜甜゛ 提交于 2020-01-30 09:45:33
问题 How can I draw filled poly in Cocos2D framework? Code below draws poly but without antialiasing.What should I change? void ccFillPoly( CGPoint *poli, int points, BOOL closePolygon ) { // Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY // Needed states: GL_VERTEX_ARRAY, // Unneeded states: GL_TEXTURE_2D, GL_TEXTURE_COORD_ARRAY, GL_COLOR_ARRAY glDisable(GL_TEXTURE_2D); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_COLOR_ARRAY);

filled antialiased poly cocos2d

假如想象 提交于 2020-01-30 09:45:10
问题 How can I draw filled poly in Cocos2D framework? Code below draws poly but without antialiasing.What should I change? void ccFillPoly( CGPoint *poli, int points, BOOL closePolygon ) { // Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY // Needed states: GL_VERTEX_ARRAY, // Unneeded states: GL_TEXTURE_2D, GL_TEXTURE_COORD_ARRAY, GL_COLOR_ARRAY glDisable(GL_TEXTURE_2D); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_COLOR_ARRAY);

OpenGL deprecated in IOS 12, how to safely continue to use openGL on ios 12+ device?

帅比萌擦擦* 提交于 2020-01-29 17:46:05
问题 Apple say that Apps built using OpenGL ES will continue to run in iOS 12, but Open GL ES is deprecated in iOS 12. Games and graphics-intensive apps that previously used OpenGL ES should now adopt Metal. But I don't want to migrate my app from OpenGL to Metal because it's the same code for Android and I don't want to create 2 branch, so how can I do to continue to use OpenGL in futur iOS release ? 回答1: You more or less do not. Apple has made it abundantly clear that they are not interested in

+ (Class)layerClass won't work

孤街浪徒 提交于 2020-01-29 06:43:43
问题 I'm building an OpenGL application and on eaglview.m + (Class)layerClass wont work. If i try to run it I get: "Undefined symbols for architecture i386: "_OBJC_CLASS_$_CAEAGLLayer", referenced from: objc-class-ref in GLView.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status" How can I fix this? 回答1: You need to add the OpenGL and potentially the QuartzCore frameworks to the target to link them. 来源: https://stackoverflow.com/questions/6251111/classlayerclass

+ (Class)layerClass won't work

人盡茶涼 提交于 2020-01-29 06:37:29
问题 I'm building an OpenGL application and on eaglview.m + (Class)layerClass wont work. If i try to run it I get: "Undefined symbols for architecture i386: "_OBJC_CLASS_$_CAEAGLLayer", referenced from: objc-class-ref in GLView.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status" How can I fix this? 回答1: You need to add the OpenGL and potentially the QuartzCore frameworks to the target to link them. 来源: https://stackoverflow.com/questions/6251111/classlayerclass

+ (Class)layerClass won't work

杀马特。学长 韩版系。学妹 提交于 2020-01-29 06:37:06
问题 I'm building an OpenGL application and on eaglview.m + (Class)layerClass wont work. If i try to run it I get: "Undefined symbols for architecture i386: "_OBJC_CLASS_$_CAEAGLLayer", referenced from: objc-class-ref in GLView.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status" How can I fix this? 回答1: You need to add the OpenGL and potentially the QuartzCore frameworks to the target to link them. 来源: https://stackoverflow.com/questions/6251111/classlayerclass

Fast Screen Recording of iOS App

坚强是说给别人听的谎言 提交于 2020-01-26 01:18:26
问题 I'm new to OpenGL ES. I'm trying to write code for screen recording of iOS apps, especially games. I'm using the 'render to texture' method described with code in this answer to capture screen and write the video for a cocos2d game. One modification I made was that, when I call CVOpenGLESTextureCacheCreate then I'm using [EAGLContext currentContext] instead of [[GPUImageOpenGLESContext sharedImageProcessingOpenGLESContext] context] It does record the video but there are two issues (1)- When

ClassCaseException on GL11ExtensionPack. Rendering to texture on OpenGL android

时光怂恿深爱的人放手 提交于 2020-01-25 11:19:46
问题 I'm trying to render to a texture (really thought it would be easier than this!) I found this resource: which seems to be exactly what I want I'm getting a ClassCastException however, on GL11ExtensionPack gl11ep = (GL11ExtensionPack) gl; Can anyone tell me why? public void renderToTexture(GLRenderer glRenderer, GL10 gl) { boolean checkIfContextSupportsExtension = checkIfContextSupportsExtension(gl, "GL_OES_framebuffer_object"); if(checkIfContextSupportsExtension) { GL11ExtensionPack gl11ep =