Reputation: 83
Platform - iOS. Language - Object c, OpenGL.
I have to put 2 UIViews for opengl rendering.
For example, one is rotating triangle(3D), and another is jumping square(3D) in a UIWindow.
They animate forever in different thread.
Each Thread may call function "glDrawArrays" to render object. (Maybe 10 ftps?)
They have own "Frame and Render Buffers", "command pipe line" and "thread".
Command pipe line what I mean is like following codes.
For example
glBindTexture(GL_TEXTURE_2D, texture);
glTranslatef(1.5, 0, 1);
glScalef(0.5,0.5, 1.0);
glMultMatrixf(someMetrix);
I can't not understand glXXXs function's usage.
For example, glBindTexture.
I want to bind texture to one buffer and bind another texture to another buffer by different thread.
I cant imagine , when i see the prototype of function "glBindTexture".
There is no parameter "binding WHERE".
glXXX functions looks likes putting and binding on same area.
Please, guide me.
Thanks.
Upvotes: 0
Views: 630
Reputation: 1138
You have to remember that your brain is currently working in an object-oriented way. The real key to understanding OpenGL ES is that it is procedural. You are binding the texture to now, not to something. Whatever is being used now will use that texture.
Follow this tutorial as far as it takes you: http://iphonedevelopment.blogspot.com/2010/10/opengl-es-20-for-ios-chapter-1.html
And pick up Phillip Rideout's iPhone 3D Programming book on OpenGL ES: http://www.amazon.com/iPhone-Programming-Developing-Graphical-Applications/dp/0596804822/ref=ntt_at_ep_dpt_1
Upvotes: 0
Reputation: 755
May be the below link will be helpful to you...
http://gamesfromwithin.com/using-multiple-opengl-views-and-uikit
I think best way is first learn openGL ES and try to implement single view, then putting multiple views will be quite easy for you.
Upvotes: 2