View previous topic :: View next topic |
Author |
Message |
dav1d
Joined: 12 Sep 2011 Posts: 40
|
Posted: Sun Feb 12, 2012 7:45 am Post subject: Forward compatibel? |
|
|
Code: | void init_glfw3(int width, int height) {
if(!glfwInit()) {
throw new Exception("glfwInit failure: " ~ to!string(glfwErrorString(glfwGetError())));
}
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 0);
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
//glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
GLFWwindow win = glfwOpenWindow(width, height, GLFW_WINDOWED, "BraLa - Minecraft on a higher level", null);
if(!win) {
throw new Exception("Failed to create window: " ~ to!string(glfwErrorString(glfwGetError())));
}
glfwSwapInterval(0); // change this to 1?
}
|
Shouldn't that chose the highest available context?
"DerelictGL3.reload();" returns 3.0. |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sun Feb 12, 2012 7:56 am Post subject: |
|
|
You told GLFW to create a 3.0 context when you used the window hints, major and minor. So you got what you asked for. Documentation on GLFW3 is sparse, but I *think* you can get the highest available if you drop those two window hints. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
dav1d
Joined: 12 Sep 2011 Posts: 40
|
Posted: Sun Feb 12, 2012 8:03 am Post subject: |
|
|
This throws an Error: Invalid value for parameter
Code: | to!string(glfwErrorString(glfwGetError())) |
|
|
Back to top |
|
|
dav1d
Joined: 12 Sep 2011 Posts: 40
|
Posted: Sun Feb 12, 2012 8:09 am Post subject: |
|
|
Interesting
Code: | glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 4);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 1); | and Code: | glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 4);
//glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 1); |
Give me both a OpenGL 3.3 context.
But: Code: | glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 4);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2); | Gives me an error: "A platform-specific error occurred"
My graphics card should be 4.2 ready (GTX 560 TI)
//Edit: glxinfo output:
Code: | ─[ArchBox][/tmp/glfw]╼ glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 560 Ti/PCI/SSE2
OpenGL version string: 4.2.0 NVIDIA 290.10
OpenGL shading language version string: 4.20 NVIDIA via Cg compiler
OpenGL extensions: |
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|