Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

UniEdit

macrumors newbie
Original poster
Jun 13, 2013
6
0
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.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,731
8,407
A sea of green
Google search terms:
opengl sample site:developer.apple.com

Links to Apple sample code, from the first page of results:
https://developer.apple.com/library/mac/#samplecode/CocoaGL/Introduction/Intro.html
http://developer.apple.com/library/mac/#samplecode/GLEssentials/Introduction/Intro.html


Or visit Apple's main Dev Navigation site:
https://developer.apple.com/library/mac/navigation/index.html

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.