Hi,
I'm writing a simple game engine and I'm using glfw. I'm trying to make this work on both Mac and Windows. I'm a bit confused about what happens on Win. This is the way I initialize glfw:
if (!glfwInit())
exit(-1);
//glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
//glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
//glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
//glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
window = glfwCreateWindow(width, height, appName, NULL, NULL);
if (!window) {
glfwTerminate();
exit(-1);
}
glfwMakeContextCurrent(window);
With this initialization, everything works and I can render correctly a test quad on the screen. Just to give you an idea, this is the renderer and OpenGL version I get:
Renderer: Quadro NVS 295/PCIe/SSE2
OpenGL version supported 3.3.0
If however I uncomment the first three glfwWindowHint, everything works but I don't see anything on the screen (the same happens on the Mac). I still see that the OpenGL version supported is 3.3.0. Why the quad stops being rendered when I hint the GL version? For completeness, these are the shaders I'm using (very simple)
#version 330 core
layout(location=0) in vec3 g_position;
layout(location=2) in vec2 g_texcoord;
uniform mat4 g_mvMat;
uniform mat4 g_projMat;
out vec2 Tex;
void main ()
{
Tex = g_texcoord;
gl_Position = g_projMat * g_mvMat * vec4 ( g_position, 1.0 );
}
#version 330 core
in vec3 Position;
in vec2 Tex;
out vec4 fragColor;
uniform sampler2D Tex1;
void main()
{
vec4 texColor = texture( Tex1, Tex );
if (texColor.a < 0.5)
discard;
fragColor = texColor;
}
Thanks!