Hey!
I'm new to SFML and just migrate my current project to it. I previously used SDL for drawing and event management but it has some flaws like missing keyboard input and other things.
My project is written in C# with SFML.Net, but i think this doesn't matter in my case. I compose a lot of graphics in my project from one source texture. With SDL it looked really good, but now i have the problem that seams appear in my GUI system:
That's the code i use to draw a texture on the screen:
public static void DrawTexture
( RenderTarget target,
Texture texture,
IntRect targetPos,
IntRect
? sourcePos,
bool tileTexture
){ texture
.Repeated = true; texture
.Smooth = false; using (Sprite sprite
= new Sprite
(texture
)) { if (sourcePos
!= null) sprite
.TextureRect = sourcePos
.Value; else sprite
.TextureRect = new IntRect
(0,
0,
(int)texture
.Size.X,
(int)texture
.Size.Y); sprite
.Position = new Vector2f
(targetPos
.Left + 0
.5f, targetPos
.Top + 0
.5f
); if (!tileTexture
) { sprite
.Scale = new SFML
.Window.Vector2f((float)targetPos
.Width / sprite
.TextureRect.Width,
(float)targetPos
.Height / sprite
.TextureRect.Height); sprite
.Draw(target, RenderStates
.Default); } else { sprite
.Scale = new Vector2f
(1,
1); while (sprite
.Position.X <= targetPos
.Left + targetPos
.Width - sprite
.TextureRect.Width) { sprite
.Draw(target, RenderStates
.Default); sprite
.Position = new Vector2f
(sprite
.Position.X + sprite
.TextureRect.Width, sprite
.Position.Y); } } }} Is there any way to get SFML to create pixel perfect graphics?
Greetings
Felix Qu.