Questions tagged [sfml]

Simple and Fast Multimedia Library - a free, portable API that provides access to graphics, input, audio, etc.

Simple and Fast Multimedia Library is a free, portable multimedia API that provides you low and high level access to graphics, input, audio, etc. You can see it as a modern, object-oriented alternative to SDL.

SFML is available in the following languages:

  • C++
  • C
  • .Net (C#, VB.Net, C++/CLI, ...)
  • Python
  • D
  • Ruby
374 questions
5
votes
1 answer

How to display text and numbers in SFML 2.0

I want to display some text and numerical data over my OpenGL scene in SFML 2.0. I've looked at the SFML 1.6 text tutorials here. But I can't get the code to work. There is (as of yet) no text tutorial for 2.0
Ken
  • 6,116
  • 3
  • 35
  • 51
4
votes
5 answers

Does SFML support these specific features that I require?

I've been working on a game in c++ for about a week and a half, and I've been using SDL. However, my current engine only needs the following from whatever library I use: enable double buffering load an image from path into something that I can…
ultifinitus
  • 1,912
  • 1
  • 16
  • 19
3
votes
1 answer

What happened to sprite::setSize in SFML2?

I'm porting one of my old projects to sfml 2.0, and I had a background that I scaled using sprite.setSize(windowWidth, windowHeight) Now, it seems like setSize has ben removed in 2.0, and I'm wondering what the intended replacement is. I know there…
bobbaluba
  • 132
  • 1
  • 7
1
vote
1 answer

How can I make the text flash?

I want to have text that flashes from green to white and back to green over and over until the window is closed? Below is what I have tried but i cant seem to get it to work, please help me. int main() { sf::RenderWindow…
Matt
  • 11
  • 2
1
vote
0 answers

How can I make the cursor the right size on a 4k monitor?

Since I have a 4k screen, cursor.loadFromSystem(sf::Cursor::Hand)); gives me a cursor that is way too small. Is there a simple way to make the cursor automatically be the right size? (I want my program to work for people with any screen size).
mnr
  • 121
  • 1
0
votes
1 answer

No RenderWindow class in SFML?

In their official tutorials it is said that to draw graphics on screen, i have to use RenderWindow instead of Window. But when i write sf:: RenderWindow window, error pops up saying that there is no RenderWindow in sf:: . I copy-pasted the code…
anonymous
  • 514
  • 1
  • 8
  • 21
0
votes
2 answers

SFML: Monster following player on a straight line

I've searched for this and found a few topics , usually they used a function normalize and using simple vector subtracting which is ok , but how should I do it in sfml ? Instead of using: Movement = p.position() - m.position(); p is the player and…
0
votes
2 answers

Is SFML a game engine?

I am a little confused on the difference between a game engine and an actual game. By making a game, are you making a game engine, or is a game engine a library used to make a game?
0
votes
1 answer

Do I have to clear the entire target with a single color every frame?

Do I have to clear the entire target with a single color every frame? I thought the newly drawn ones will overwrite the old ones.
0
votes
1 answer

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 of hundred times.Because a briefest of pressed…
0
votes
1 answer

SFML test app feels slow/clunky

Similar to this question https://stackoverflow.com/questions/33904998/sfml-extremly-slow-irregular-framerate, I have created a small program to experiment with SFML I have a very simple SFML test application on ubuntu 20.04 using SFML 2.5.1. There…
Bruce Adams
  • 111
  • 2
0
votes
0 answers

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 function in each of the entity class instances. I…
tygzy
  • 129
  • 6
0
votes
0 answers

Graphics look blurry in SFML

I'm working on a 2D game using SFML and many textures (which I'm loading from PNG files, created with Gimp) I use are appearing blurry. They're being drawn without any kind of scaling and transformation, and I have confirmed that smoothing is not…
0
votes
1 answer

SFML function does all the job with setting up timestep?

Usually i set up timestep something like this: timestep=1.0f/60.0f; if(time>=timestep) { update; time-=timestep; } But SFML has the next function: window.setFramerateLimit(). Does it do the same thing i described above?
0x00004
  • 109
  • 6
0
votes
3 answers

sf::mouse::getPosition method help

I am trying to write sf::mouse::getPosition(const Window &Relative To) in a function but I can't write the correct argument in it. Why is that? Here is my Game.cpp File: EDIT: I pasted the current code: #include "Game.h" Game::Game() :…
AliTeo
  • 35
  • 1
  • 7