Original Post
Hello,
I have written a very rudimentary D3D11 renderer and am now working with SFML (OpenGL). I am only interested in 2D games at the moment so I was just rendering quads to the screen in D3D and would like to do the same thing with GL in SFML.
However, I have one big problem. In order to work directly with the hardware I have to be in floating point coordinates, which is not only inconvenient for me, but is causing some bleed in my program. For example, I have a texture atlas with a single black pixel, surrounded by some blue pixel blocks representing buttons. I want to use that single black pixel and scale it up 1920x1080 times and use it as a black background. But when i do so I get some bleeding and there is a gradation of blue on my screen. I have a feeling this is due to floating point inaccuracy.
I need my games to be pixel accurate and I was wondering how I could do this in GL/D3D without having to resort to floating point numbers. At the same time, I don't only want to be able to run my game in 1920x1080 but at any resolution that the user wants in windowed mode. I am a bit lost as to how I would represent this with ints, as I don't want my character to move farther on the screen in windowed mode than in full screen, because if I say move 30 pixels left, 30 pixels is a lot in a 200x200 window but not much in a 1920x1080 fullscreen mode.
Does anyone know how to do this or am I stuck using the basic graphics package in SFML. I spent significant time learning D3D and basic 3D graphics principles and to be honest I don't want to sink anymore time there right now. I am not interested in 3D at all and am a bit peeved that I have to learn all this 3D stuff just to get a 2D game running very efficiently on the 3D hardware. Does anyone have an idea?
Thanks.
-Dave Ottley
I have written a very rudimentary D3D11 renderer and am now working with SFML (OpenGL). I am only interested in 2D games at the moment so I was just rendering quads to the screen in D3D and would like to do the same thing with GL in SFML.
However, I have one big problem. In order to work directly with the hardware I have to be in floating point coordinates, which is not only inconvenient for me, but is causing some bleed in my program. For example, I have a texture atlas with a single black pixel, surrounded by some blue pixel blocks representing buttons. I want to use that single black pixel and scale it up 1920x1080 times and use it as a black background. But when i do so I get some bleeding and there is a gradation of blue on my screen. I have a feeling this is due to floating point inaccuracy.
I need my games to be pixel accurate and I was wondering how I could do this in GL/D3D without having to resort to floating point numbers. At the same time, I don't only want to be able to run my game in 1920x1080 but at any resolution that the user wants in windowed mode. I am a bit lost as to how I would represent this with ints, as I don't want my character to move farther on the screen in windowed mode than in full screen, because if I say move 30 pixels left, 30 pixels is a lot in a 200x200 window but not much in a 1920x1080 fullscreen mode.
Does anyone know how to do this or am I stuck using the basic graphics package in SFML. I spent significant time learning D3D and basic 3D graphics principles and to be honest I don't want to sink anymore time there right now. I am not interested in 3D at all and am a bit peeved that I have to learn all this 3D stuff just to get a 2D game running very efficiently on the 3D hardware. Does anyone have an idea?
Thanks.
-Dave Ottley