opengl-es

Getting stuck at 40 fps even with using CADisplayLink?

依然范特西╮ 提交于 2019-12-20 17:17:13
问题 At first I used NSTimer and ran into the problem of the frame rate being stuck at 40 frames per second. I've read about using CADisplayLink to fix the problem. It seemed to work for a while, but recently, the app starts at 60, then after a little while (about 5 - 20 seconds in) the app starts to run at 40 - 41 fps and gets stuck there. And I'm culling so that there's less draws when objects are out of view, but yet it stays stuck there. A unusual way that does seem to remedy the problem for a

java.lang.RuntimeException: eglSwapBuffers failed: EGL_SUCCESS

此生再无相见时 提交于 2019-12-20 16:53:10
问题 I've an OpenGL application in the Google Play Store and I'm facing a daily exception: java.lang.RuntimeException: eglSwapBuffers failed: EGL_SUCCESS at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1085) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1043) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1369) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1123) The problem is, on all my smartphones I

Android - Draw 3D then 2D with openGL ES

可紊 提交于 2019-12-20 15:34:08
问题 How can i draw a HUD (Text or Bitmaps) after drawing some 3d stuff in openGL ES ?? I tried this: private void switchTo2D(GL10 gl){ gl.glDisable(GL10.GL_DEPTH_TEST); gl.glMatrixMode(GL10.GL_PROJECTION); gl.glPushMatrix(); gl.glLoadIdentity(); gl.glMatrixMode( GL10.GL_PROJECTION ); gl.glLoadIdentity(); GLU.gluOrtho2D( gl, 0, getViewportWidth(), 0, getViewportHeight() ); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); } Someone know how to switch from Perspective to Ortho without

Quartz 2D or OpenGL ES? Pros and cons in the long term, possibility of migration to other platforms

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 14:42:02
问题 I'm having a hard time deciding whether to go with Quartz2D or OpenGL for an iPad game. It will be 2D mostly, but effect-intense (simultaneous lighting effects for 10-30 objects, 10-20 simultaneous animations on the screen). So far, assuming i'm equally dumb in both technologies and have to learn them from the ground, i came to this list. (I've read several topics here, on SO, with names like "Quartz or OpenGL", but i'm still left with some questions) Quartz : Better time-to-market, because

Android OpenGLES Render-to-Texture

陌路散爱 提交于 2019-12-20 14:15:44
问题 I write graphics apps for the iPhone and I'm looking to port my most recent app, 'Layers,' to the Android platform. Layers is painting app that allows users to draw on the screen and create multi-layered paintings with different brushes, colors, etc... and export to PSD. It's got desktop sync, a smudge tool, lots of good stuff... http://www.layersforiphone.com/ I started looking at the Android platform Monday and I've run into a major problem. I use OpenGL to do all the drawing because it

Quartz 2D vs OpenGL ES Learning Curve

隐身守侯 提交于 2019-12-20 14:09:33
问题 I have been developing iPhone Applications for a couple of months. I would like to know your views about the Quartz vs OpenGL ES 1.x or 2.0 learning curve. You can tell your perspective. My Questions are *I am a wannabe game developer, So is it a good idea to first develop in quartz , then move on to OpenGL ES or does it not make an difference *Can you please tell your experiences when you were having the similar question Thanks :) 回答1: Quartz 2D is not applicable for game development IMHO.

How many vertices needed in to draw a cube in OpenGL ES?

泄露秘密 提交于 2019-12-20 12:39:04
问题 I see different number of vertices in different online sites to represent the same cube in OpenGL ES. For Example this is one: float vertices[] = { -width, -height, -depth, // 0 width, -height, -depth, // 1 width, height, -depth, // 2 -width, height, -depth, // 3 -width, -height, depth, // 4 width, -height, depth, // 5 width, height, depth, // 6 -width, height, depth // 7 }; short indices[] = { 0, 2, 1, 0, 3, 2, 1,2,6, 6,5,1, 4,5,6, 6,7,4, 2,3,6, 6,3,7, 0,7,3, 0,4,7, 0,1,5, 0,5,4 }; And here

How to load and display image in OpenGL ES for iphone

妖精的绣舞 提交于 2019-12-20 12:32:21
问题 I'm a newbie and trying to display a sprite on my iPhone screen using OpenGL ES. I know its far simpler and easier to do it with cocos2d but now I'm trying to code directly on OpenGL. Is there any simple yet efficient way to load and display sprites in OpenGL ES. What I've found until now is much much complex. :( 回答1: Here is some code to load a png from bundle: UIImage* image = [UIImage imageNamed:@"PictureName.png"]; GLubyte* imageData = malloc(image.size.width * image.size.height * 4);

Is OpenGL threadsafe for multiple threads with distinct contexts?

旧时模样 提交于 2019-12-20 10:55:35
问题 I know that sharing a single context between threads is bad news. I know that I can safely create and use a context with an offscreen framebuffer on a secondary thread when nothing is happening with GL on the main thread. I haven't yet been able to find a definitive answer to the question of whether I can safely create two contexts on two different threads (say, a main thread drawing to the screen, and a secondary thread doing offscreen drawing work) and have them both making GL function

How is GLKit's GLKMatrix “Column Major”?

馋奶兔 提交于 2019-12-20 10:30:48
问题 Premise A When talking about "Column Major" matrices in linear memory, columns are specified one after another, such that the first 4 entries in memory correspond to the first column in the matrix. "Row Major" matrices, on the other hand, are understood to specify rows one after another, such that the first 4 entries in memory specify the first row of the matrix. A GLKMatrix4 looks like this: union _GLKMatrix4 { struct { float m00, m01, m02, m03; float m10, m11, m12, m13; float m20, m21, m22,