So, I've had this code for quite some time for setting up my context.
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, GL11.GL_TRUE);
And this has worked fine for the most part. However, if the current GPU does not support these settings, I get a runtimeException on:
glfwCreateWindow
I would not like to catch this exception, but would like to check that the demands of the app are met prior to the crash and properly notify the user that their graphics card doesn't support my app.
I thought the hints were just hints and attempt to do the above later on when I've created the context.
GLCapabilities g = GL.createCapabilities();
if (!g.OpenGL33) {
String m = "Your graphics card is reported to be: " + glGetString(GL_VENDOR) + ", " + glGetString(GL_RENDERER)
+ ". It has no support for opengl 3.3 If you have several GPUz, try and select the powerful one to run the game.";
throw new ErrorHandler.GameError(m);
}
But it turns out this is too late...
To be frank I don't really know what the above does exactly. I tried to read the opengl documentation, but got instant migranes. And it seems like MacOS (like usual) wants some kind of special treatment.
All I want is opengl-stuff up and including 3.3. I'm not using decrepit stuff or anything fansy. How do I handle this cross platform?
Is it a viable option to just leave the hints out, then check if 3.3 is supported? Am I all set by then? Will a mac like this?