If I understand well, in the vertex shader, the gl_Position built-in variable should get a clip-space value, that means a value between [-1,-1,-1,1] and [1,1,1,1].
for anything drawn with “glDrawArrays(…);” juste before swapping the buffers,I should see a red point in the middle of the screen.
But it doesn’t work, someone could explain me where is the mistake?
The code itself should be correct, but I just tried it in my program and also don’t see the red dot.
My assumption is that due to some odd rounding errors or the resolution, the point is considered “too small” and thus not drawn. If you try to draw some 2D faces instead, you should see a result…
If you are drawing something other than GL_POINTS then I don’t think you will see anything. For example a triangle with the same coordinates will not be drawn at all. Try drawing points with the above shaders and if you are already doing that maybe your depth culls them.