I am still new to OpenGL. I am trying to draw a perfect square on a 1280 by 720 screen using shaders.
I am using the main OpenGL profile, version 3.3. I was stuck with this when I tried to draw a square at 1280 by 720

After some time of searching, I realized that the size is distorted by the size in the viewport, after changing the size of the viewport to 720 by 720, I got this.

In legacy OpenGL, they have a solution to fix this, but now it is deprecated in the Core profile.
Problem: how can I draw a perfect square in 1280 x 720 screens using only the main OpenGL 3.3 profile?
source
share