fogleman / Craft

A simple Minecraft clone written in C using modern OpenGL (shaders).
http://www.michaelfogleman.com/craft/
MIT License
10.44k stars 1.39k forks source link

[Linux] Crashes X using nouveau #137

Open larbb opened 10 years ago

larbb commented 10 years ago

Here's to how to recreate the issue: Using gdb (with debug symbols) run craft using main as a breakpoint glfwInit(); returns true.

Stepping into create_window (line 2363), the offending line seems to be:

g->window = glfwCreateWindow(
2375            window_width, window_height, "Craft", monitor, NULL);

After executing this line, I am returned back to my login manager.

Opengl version = 3.0 Mesa 8.0.5 Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux

for reference, I am running a NVIDIA GTX 560ti.

EDIT1:

whilst stepping further, this line causes the crash:

glfwMakeContextCurrent((GLFWwindow*) previous);
Bergasms commented 10 years ago

Not 100% sure if this is the case, but it could be because the current glfw is trying to create an openGL context of 3.+, whereas you only have support for 3.0, Nouveau is an open source driver, so it is possible that they are lacking support for some function. Is your graphics driver updated to the current version?

You could try to debug this by downloading and trying to run some of the sample programs from the glfw website and see what it takes to just get a bare bones window up and running.

larbb commented 10 years ago

@Bergasms What OpenGL are we targeting, then? I've been grepping GLFW_CONTEXT_VERSION_MAJOR in the src directory, although I have yet to find anything.

I can confirm it works with NVIDIA's proprietary drivers.