我最近一直在学习OpenGL和SDL,而且我对SDL和glOrtho中的坐标系感到困惑.我已经阅读了一些关于SDL坐标系的教程,其中坐标从(0,0)到(w,h),这对我来说没有意义.如果宽度从0变为w,那么这意味着有一个额外的像素.
此外,使用OpenGL glOrtho函数,我已经看到所有将坐标系更改为类似于SDL的示例,采用以下形式:
glOrtho (0, screenWidth, screenHeight, 0, 1, -1);
Run Code Online (Sandbox Code Playgroud)
但是,这样做是否更有意义?:
glOrtho (0, screenWidth-1, screenHeight-1, 0, 1, -1);
Run Code Online (Sandbox Code Playgroud)
希望你们能为我澄清一下,谢谢.