I have been studying OpenGL and SDL lately, and I am pretty confused about the coordinate system in SDL and glOrtho. I read several manuals about the SDL coordinate system, which says that the coordinates go from (0,0) to (w, h), which does not make sense to me. If, if the width goes from 0 to w, it means that there is one additional pixel.
In addition, using the OpenGL glOrtho function, I saw all the examples in which the coordinate system was changed to one similar to SDL, in the following form:
glOrtho (0, screenWidth, screenHeight, 0, 1, -1);
However, doesn't it make sense to do this instead ?:
glOrtho (0, screenWidth-1, screenHeight-1, 0, 1, -1);
Hope you guys can clarify this to me, thanks.
source share