View Full Version : OpenGL Core Profile breaks my app

Jun 23, 2013, 09:09 AM
I know this is a common title, but I don't even know what the problem is. I have been working on porting my OpenGL 1.1 app to 3.2 and I am not getting anything on the screen. I have set up all of my shaders properly, as evidenced by the fact that using a legacy profile gives me gorgeous results. It sounds like I need to set up a VAO, so I did it before I compiled shaders. Still nothing. I am getting no error messages, no crashes, freezes, or anything - just a window with a background color equal to the color I set with glClearColor. I cannot go in to too many details because I am using some Mavericks-specific code and that is under NDA, but even with non-Mavericks stuff running on Mountain Lion I am not getting anything.

Do I need to set up a VBO too? Do vertex arrays not work anymore?

In addition to answering those two questions, can somebody give me a good link to some Cocoa code (as much plain C as possible) that can help? All I can find with Google is a bunch of C++ and C# code that uses syntax I have never seen before, so I can't get much out of them.

Jun 23, 2013, 12:27 PM
Google search terms:
opengl sample site:developer.apple.com

Links to Apple sample code, from the first page of results:

Or visit Apple's main Dev Navigation site:

then click Sample Code on the left, and enter opengl as the search term.

As a strategy, I suggest reversing your current approach of trying to make non-working code work. Instead, take one of the sample projects (presumably known-working), build it, and confirm it works. Then start modifying it to incrementally approach your non-working code. Recompile and rerun frequently (after every change wouldn't be too often). When the code stops working, you've found the critical difference.