FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Forward compatibel?

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
dav1d



Joined: 12 Sep 2011
Posts: 40

PostPosted: Sun Feb 12, 2012 7:45 am    Post subject: Forward compatibel? Reply with quote

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
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sun Feb 12, 2012 7:56 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
dav1d



Joined: 12 Sep 2011
Posts: 40

PostPosted: Sun Feb 12, 2012 8:03 am    Post subject: Reply with quote

This throws an Error: Invalid value for parameter

Code:
to!string(glfwErrorString(glfwGetError()))
Back to top
View user's profile Send private message
dav1d



Joined: 12 Sep 2011
Posts: 40

PostPosted: Sun Feb 12, 2012 8:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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