Questions tagged [sfml]
Simple and Fast Multimedia Library - a free, portable API that provides access to graphics, input, audio, etc.
377 questions
1
vote
1
answer
172
views
How to properly change resolution dynamically in SFML?
I am working on creating an options menu through which I can change resolution and toggle full screen mode. I am allowing only those resolutions that have aspect ratio 16:9, as my game was originally ...
3
votes
1
answer
149
views
How to determine drivers placement in a race with shortcuts and offroading?
Thinking of doing a little Micro Machines clone in SFML/C++.
I know Micro Machines 'ai' was handled by having 2d array positions (or tiles) marked as being 'on-track' or 'off-track and directing the ...
0
votes
1
answer
87
views
When does SFML deal with user input
I have an SFML programme using window.setFramerateLimit() to determine the time step of the game.
I have a game loop that looks like this:
...
0
votes
1
answer
501
views
Implementing a Fixed Time Step?
This has been bugging me for few days now. I'm trying to stop movement jittering in my game. I've looked towards semi and fixed time steps - moving towards the latter below so I can really understand (...
0
votes
1
answer
201
views
How to develop a game on a 2015 MacBook Pro without learning Metal?
I'm on Mac and OpenGL and Vulcan are not supported. Even worse, I'm on a 2015 MBP 13". Yeah, can't do much with that.
I spent a full year learning C++ and I have no patience to try and learn ...
0
votes
1
answer
740
views
Should networking and rendering be separated in multiple threads?
I've been trying to code a multiplayer client/server prototype game using SFML's networking.
My server and client use TcpSelectors to wait for a certain amount of time for incoming packets without ...
1
vote
1
answer
443
views
Creating a Renderer class using SFML
I currently have a Renderer class, which as in the example code, looks like this:
...
1
vote
0
answers
438
views
Raycasting floor/ceiling textures sliding
I'm writing a raycasting engine in C++ and SFML.
I have the wall texturing done and I'm trying to get floor and ceiling texturing right.
I almost got it but the textures are "sliding" when ...
0
votes
1
answer
81
views
Viewport offset from top also creates a gap at the bottom
I am trying to do something really basic with sf::View.
On a 1280x720 pixel window. I need to place a viewport which is 560x560 with a 160px gap from the top.
What ...
-1
votes
2
answers
343
views
Why does the setPosition function in SFML require the x and y arguments both floating-point numbers, not integers?
Why do the coordinates x and y in the 2D game both floating-point numbers, not integers? For example, the SFML setPosition function requires two floating-point ...
0
votes
3
answers
153
views
Should the coordinates, and rotation angles of all the sprites be stored in variables?
I've learned that magic numbers are bad in code. However, should the coordinates, and rotation angles of all the sprites be stored in variables? Is the convention in game development to leave those ...
-1
votes
1
answer
154
views
Are there any practical applications for clearing the screen with a specific color?
Why is it common in the 2D game frameworks for the clear function to have the option of clearing the entire screen with a color? Why is this option available to us? Are there any practical ...
0
votes
1
answer
73
views
I did changed the text of a graphical text and set its new center origin. Should I reposition it in dead center again?
Should I re-position a graphical text in the dead center again, which I previously do, after editing the text of the graphical text, recalculate its new center origin of the text? I did see that with ...
1
vote
1
answer
164
views
When detecting a keyboard key is released. What happened if the key is released at the end of the game loop?
When detecting a keyboard key is released. What happened if the key is released at the end of the game loop, how could the pollEvent function, which is at the top of the game loop, and it is a brand ...
0
votes
1
answer
278
views
When implementing pressing Enter to restart the game, should I use Keyboard::IsKeyPressed or use Event::KeyReleased in some way?
When implementing pressing Enter to restart the game, should I use Keyboard::IsKeyPressed or use Event::KeyReleased in some way? I am afraid that Keyboard::IsKeyPressed will restart the game in excess ...
0
votes
1
answer
113
views
SFML: Object's shape not rendered on the window [closed]
I want to be able to render sf::CircleShape (representing pointwise charges) when pressing mouse buttons on the window. The problem is easy enough, however the ...
0
votes
0
answers
72
views
problems with displaying sfml textures
I have created a kind of framework for a game that combines box2d and sfml. All game scenes are stored in the Game class. The scenes also contain information about static and dynamic objects: ...
0
votes
1
answer
185
views
1
vote
2
answers
1k
views
Centering Image inside ImGui window causes bug
I've tried drawing RenderTexture directly to the ImGui window and I've stumbled upon a bug. Everything is drawn correctly until I center ImGui Image inside the ImGui window.
Centered Image:
Not ...
1
vote
1
answer
190
views
How to allow infinite custom inputs?
Summary: What approach should I take to allow custom inputs saved in a file be interpreted in the engine?
So I am making a game engine similar to Mugen where I want characters to have their own ...
0
votes
2
answers
1k
views
Smooth out movement of the snake in a 2d Snake game
I am working on a 2-D snake game in C++ with the SFML library. I would like to smooth out the movement of my snake as it looks extremely choppy currently.
How the Snake moves
The snake is made up of a ...
0
votes
2
answers
215
views
How do you disable frame skips in a game, in SFML preferably
by frame skip off i mean that the game should just slow down if the fps drops, just like in terraria, i got this code currently and want to implement it to it:
...
2
votes
0
answers
171
views
How can an Entity trigger changes to the world in C++?
I'm writing a simple physics based game in C++ using SFML. I want to trigger a scene change when my playerCharacter collides with a door. Since C++ does not have any native Event Sender/Listener ...
0
votes
0
answers
90
views
Instance vs individual updating
I am making a game in SFML, and whilst I was making an AI moving system I was wondering which would be better, If I was to instance update all my entities at once, or individually update them via a ...
0
votes
1
answer
131
views
Confused, maybe the mistake ik is the foreach loop
I dont know why but my jump method does not work. My character can only jump on one single object. The other obstacle haven't any influence on the player. I really don't see my mistake
...