1
General / Opengl 3 + SFML 2 + Mac OS X Mountain Lion
« on: December 14, 2012, 08:14:24 am »
I'm having some difficulties with this program. It compiles fine and everything and no OpenGL error is thrown during execution but what I see is just a black window (see clear color). How's that? (Here's Utility.hpp and Utility.cpp)
On a side note. Mac OS X Mountain Lion supports almost every procedure of OpenGL 3.2 but the card is listed as OpenGL 2.1 card. But as you can see I can use all the function of OpenGL 3.2 without having any "undefined identifier" error. Maybe SFML creates an OpenGL 2 context?
Fragment shader
Vertex shader
On a side note. Mac OS X Mountain Lion supports almost every procedure of OpenGL 3.2 but the card is listed as OpenGL 2.1 card. But as you can see I can use all the function of OpenGL 3.2 without having any "undefined identifier" error. Maybe SFML creates an OpenGL 2 context?
Fragment shader
#version 120
varying vec4 pass_Color;
void main(void) {
gl_FragColor = pass_Color;
}
varying vec4 pass_Color;
void main(void) {
gl_FragColor = pass_Color;
}
Vertex shader
#version 120
uniform mat4 ModelMatrix;
uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
attribute vec4 in_Color;
attribute vec4 in_Position;
varying vec4 pass_Color;
void main(void) {
gl_Position = (ProjectionMatrix * ViewMatrix * ModelMatrix) * in_Position;
pass_Color = in_Color;
}
uniform mat4 ModelMatrix;
uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
attribute vec4 in_Color;
attribute vec4 in_Position;
varying vec4 pass_Color;
void main(void) {
gl_Position = (ProjectionMatrix * ViewMatrix * ModelMatrix) * in_Position;
pass_Color = in_Color;
}