Hello,
I've used opengl 1.2 for quite many years and want to expand to opengl 3.2+ now. I have a mini mac (osx 1.7.3 Nvidia GeForce 9400) and have looked into several webpages with OpenGL examples. So far I haven't gotten any one to work. The examples on opengl-tutorial.org don't compile - respectivly Link.
I have installed GLEW (1.7.0) and GLFW (2.7.2) manualy which compiled with no errors or warnings. Installed with sudo.
Now I have tried to put together a minimalistic programm (from the different example sources). This compiles and links but shows nothing but a black screen. If I set glClearColor it will clear the screen to the set color. But nothing is drawn. Here's the code:
// Include standard headers
#include <stdio.h>
#include <stdlib.h>

I also tried one with vertex and fragment shaders with the same result that nothing is drawn. Just a black screen.

Hope any one with more experiance on the subject can give me a hint what the cause of the problem might be.

Yours,
Crashdog

menzel

02-06-2012, 01:25 AM

Hi,

you will need to use a VertexArrayObject, per default VAO 0 is bound which will lead to an INVALID_OPERATION if you try to draw something.
A vertex and fragment shader is also mandatory.
Note that GLEW will throw an INVALID_ENUM as it tries to get the extension list with a deprecated call, you can ignore the error but you will have to live without any extensions (GLEW still does not play well with core).

Crashdog

02-08-2012, 10:14 AM

Hello,
@menzel, thanks for your input.

So far the only source of examples I could find that works are these https://github.com/beelsebob/Cocoa-GL-Tutorial. The link came from a thread in the opengl in the Macintosh section. All other examples using glew and glfw had different issues. Either not compilable or do not run as expected. I could compile the previously mentioned opengl-tutorial.org examples my making my own Makefile. But resulting in the same problem that nothing is drawn to the screen. As I'm still new to OGL 3.2+ I can't say what the cause is and it might just as well be my lack of knowledge.
However the examples from beelzebob are woking fine on osx 10.7.3 with nvidia 9400 chip using OGL 3.2 and glsl 150 core.

Just thought I mention that here in case some other OGL 3.2+ (OSX) newbie has similar issues and is looking for a starting point.

And just to mention it, I also tried compiling the glew / glfw examples on an Ubuntu 10.xx machine which has similar issues as the mac.