This is weird. I'm trying to draw a rectangle with an 'outside' border, so I use draw_line with an Y coordinate 1 pixel less than the rectangle's. But the border is drawn with 1-pixel gap!
I don't understand why... If I draw two lines one with an Y of 100 and another one with Y value of 99, they should appear together... Am I right?
I don't have a gap. Just goes to show that draw_line should not use GL_LINE but instead do it's own magic - GL_LINE is a mess I will never understand :(
For consistency's sake, I am probably going to rip out draw_triangle, draw_quad and draw_line and replace them by independent pieces of code that will create a 1x1 pixel white texture and use that. Window#draw_xx will remain as a shortcut for Gosu::draw_xx. I just wish I had time to get to it faster :)
Oh and as far as contributions go, does anyone have any idea how draw_line *should* work? I think it's fine that draw_quad excludes its bottom-right pixel, but I am not sure what to do about draw_line.
> I don't have a gap. Just goes to show that draw_line should not use GL_LINE but instead do it's own magic - GL_LINE is a mess I will never understand :(
:(
> Oh and as far as contributions go, does anyone have any idea how draw_line *should* work? I think it's fine that draw_quad excludes its bottom-right pixel, but I am not sure what to do about draw_line.
draw_quad excludes pixels? Why? If we tell draw_quad to draw a rectangle in the given coordinates, why does it exclude the last col & row of pixels? It's not intuitive (at least not for me).
Maybe the actual explanation is that I just hand things to OpenGL which does the same, and that it has never made my code uglier to justify a change :)
It's just a bit complicated to think about the lines now …
What is the resolution of your window and what is the native resolution of your monitor? If you are running in fullscreen, then try setting the window resolution the same as your monitor's native resolution.
Wow, you are raising a VERY valid point. Thanks. It never occured to me that when I do the full-screen stretching via OpenGL, one-pixel lines lose their last bit of sense.
For now only Linux is affected, but other platforms will follow. Changing the resolution is not worth the hassle. The Linux port has become a lot less problematic since I gave up.
TopicGosu / Gosu Exchange / What am I doing wrong when drawing primitives?