lwjglgamedev/lwjglbook-leg

FATAL ERROR in native method error due to renderCrossHair

Paragoumba opened this issue · 0 comments

In the following code:

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
if (opts.compatibleProfile) {
        glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE);
} else {
        // Here
        glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
        glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
}

If the else block is executed, an exception is thrown when the renderCrossHair function call the LWJGL's glPushMatrix native function. The exception is due to the fact that glPushMatrix is not available in compat mode.
Error message: No context is current or a function that is not available in the current context was called