muyoungko
muyoungko

Reputation: 83

how to put 2 EAGLLayer in a one UIView

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

Answers (2)

Matisse VerDuyn
Matisse VerDuyn

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

LebRon
LebRon

Reputation: 755

May be the below link will be helpful to you...

http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html

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

Related Questions