# How do I check why is no output on screen?

I'm using OpenGL 3.3+, and I'm trying to create an orthographic projection to draw on screen. I have the model data in a buffer:

X    Y
0,   0
50,  100
100, 0


And I create my Model-View-Projection matrix as follows:

glm::mat4 projection = glm::ortho(0.f, 100.f, 0.f, 100.f);
glm::mat4 view = glm::lookAt(
glm::vec3(0, 0, 5),
glm::vec3(0, 0, 0),
glm::vec3(0, 1, 0)
);
glm::mat4 model = glm::mat4(1);

glm::mat4 mvp = projection * view * model;


In my debugging efforts, I used the values from the model buffer and did the same operations the shader was doing, but on the CPU using GLM:

glm::vec4 pos(x, y, 1.0, 1.0);
posicao = mvp * posicao;


And got these results:

X    Y
-1, -1
0,   1
1,  -1


Which were as expected, as the Vertex Shader's code is plain simply multiplying the matrix by the incoming vec4(vec2(x, y), 1, 1). In my understanding, this should've outputted a triangle on my screen, but it's blank. What are some ways I can debug this?

• Have you tried an OpenGL debugger like gdebugger? They'll let you know what's actually getting stored in the VBOs and the contents of various buffers. – MichaelHouse May 2 '14 at 14:50
• Yes, using GDebugger, I can see the buffers and they're all correct, the shaders, the matrix being sent to the shader, it's all correct, that's why I don't understand why it won't appear. – Délisson Junio May 2 '14 at 15:27
• Have you tried disabling backface culling or inverting your winding order? I find it's much easier to start with a working example, then move on from there. – MichaelHouse May 2 '14 at 15:57

• Another way you could end up with a blank screen is if your glClearColor call is not where you think it is, or there is an additional one. – Ryan1729 Aug 10 '17 at 13:23