I have Mac 10.6 and XCode 3.2.6 and I have yet to find any tutorial on getting the base OpenGL code to work properly via XCode. Do i go into interface builder and drag an NSOpenGL view onto my main window or do i do the custom view? Do i still have to put the original glut code in my main program or is there an NS* equivalent? Do the NSEvents go into the main program or should they be defined somewhere else?
I got the Cocoa for Programming and have looked at various other tutorials but they all date back to Leopard or before and some the Next Step API has been changed throughout all MAC OSX releases.
I have successfully written an opengl application using GLUT specifically to handle all my events via the VI editor and a makefile which links up the opengl frameworks that i need but now i would like to move to XCode.
Any help, links or whatever else is appreciated. thanks!
Before you go any further, start looking at your code a bit harder. You have more ‘[’ than ‘]’! It’s nothing to do with OpenGL yet, just Objective C - although this would be an issue in every programming language.
thanks for the help - that worked and now I have a rotating red triangle! just been looking at the code too long. i have heard that integrating the Interface Builder for OpenGL can be aggravating because most people are used to doing everything from scratch so some of the concepts are difficult to pick up at first. I am definitely experiencing this. Just have to continue to push forward.
I haven’t even gone over the Quartz stuff yet or the Core Animator stuff; i guess maybe i should have.
@Bruce - it seems that I have some things working how i want in my basecode. I have subclassed NSOpenGLView and am drawing a simple triangle in Ortho mode(pixel space) but in the reshape function the triangle isnt being redrawn correctly within the scope of the viewport. I have heard from a couple of people now that even putting the projection code in the reshape is the wrong idea. I don’t know though. I also would like for the program to just quit and the Xcode debug window to close when i press the ESC key or what not. I know this is some sort of NSEvent but just now trying to figure out how to perform that task. It is getting cumbersome have to Apple + Q to quit every time and close the debug window manually.
Anyway any help on the resizing issue or any hints would be appreciated. thanks!