3 ms·
It's pretty much impossible to draw pixel-perfect lines in OpenGL. Even the library code of SDL2 fails to do it in certain instances, when its 2D drawing functi
by Kenji 10y ago
It's pretty much impossible to draw pixel-perfect lines in OpenGL. Even the library code of SDL2 fails to do it in certain instances, when its 2D drawing functions use OpenGL - and SDL2 is super clean and solid like a rock. Sometimes, you're even better off using images (!!) to draw lines. The sad thing is that Bresenham's line algorithm is so very simple. Somewhere between my program and the GPU, the communication of where exactly the line starts and ends is lost.