Top of my head the #ifdefine sounds very fishy as this is a compile
time check.
Yes, your pixel format and context should be built and you should have
your OpenGL fully initialized prior to drawing. Usually an member
variable like fInit that is set in initialization is what you want.
On Nov 22, 2004, at 9:30 AM, Danielle MacNevin wrote:
Hi all,
I have encountered an interesting problem that has had me stumped for
the last little while. I have been developing an openGL application
that will be part of a larger X-code project.
I started to develop it as a stand alone application, which used
initWithCoder to begin the execution and sub-classed MyOpenGLView to
create the openGL view. In this stand alone application the program
is running correctly and the objects in the scene look wonderful.
The problem arises when I try to add my app to the existing project.
When I add my code to the larger project, the objects in the scene do
not seem to be displayed correctly. Which is extremely confusing to
me since there was no code changed when I added my stand alone app to
the larger project.
There are a few small differences between the setup of the larger
project and the setup of the stand alone app. Namely I cannot use
initWithCoder to begin execution of the program (since there is
already an entry point into the program), so I have had to move my
generation of a pixel format and openGL context. I have moved this so
that it is only called once when I originally setup the initial openGL
window. However I am generating the same pixel format and openGL
context as before.
Also, in the larger application, the window that I have to generate my
openGL view into, is no longer a MyOpenGLView, but is a custom view.
I'm not sure if I am missing any important information pertaining to
this situation, so if you have any comments they would be greatly
appreciated :)
Also, if you would like me to clarify any of the above information
please feel free to ask!
I also have one small question. Before the execution of the drawRect
method should the pixel format and openGL context be completely
generated? I was thinking of using an #ifdefine statement to generate
my pixel format and openGL context within the drawRect funtion, so
that it would only be called once, but would be called at least once
when the program entered execution of my app.
Thanks
Danielle
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden