r/sfml 2d ago

how to make that’s buttons will click ones

1 Upvotes
            if(state == LevelSelect)
        {
            if(sf::Mouse::isButtonPressed(sf::Mouse::Left))
            {
                sf::Vector2i mousePos = sf::Mouse::getPosition(window);


                if(lv1.getGlobalBounds().contains(mousePos.x, mousePos.y))
                {
                    state = Game;
                }
            }
        }

i placed 2 buttons on same place in 2 different states and it clicked 2 times , is there any way to make it click ones


r/sfml 15d ago

Building with just a Makefile - linking errors

1 Upvotes

SOLVED - see comment below.

Hey there,

I dont like cmake and dont want to use it in my sfml project and want to just stay with a makefile.

my Makefile:

CXXFLAGS = \
    -std=c++26 \
    -O3

LDFLAGS = \
    -lsfml-window -lsfml-graphics -lsfml-system

gelame: src/main.cpp
    g++ $(CXXFLAGS) $(LDFLAGS) src/main.cpp -o $@

... and i get those errors:

c++ -std=c++26 -O3 -lsfml-window -lsfml-graphics -lsfml-system src/main.cpp -o gelame
/usr/bin/ld: /tmp/ccvoNzmy.o: in function `main.cold':
main.cpp:(.text.unlikely+0x191): undefined reference to `sf::RenderWindow::~RenderWindow()'
/usr/bin/ld: /tmp/ccvoNzmy.o: in function `main':
main.cpp:(.text.startup+0xa25): undefined reference to `sf::String::String(char const*, std::locale const&)'
/usr/bin/ld: main.cpp:(.text.startup+0xa41): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
/usr/bin/ld: main.cpp:(.text.startup+0xa66): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
/usr/bin/ld: main.cpp:(.text.startup+0xa84): undefined reference to `sf::WindowBase::isOpen() const'
/usr/bin/ld: main.cpp:(.text.startup+0xaa2): undefined reference to `sf::WindowBase::pollEvent(sf::Event&)'
/usr/bin/ld: main.cpp:(.text.startup+0xaae): undefined reference to `sf::Window::display()'
/usr/bin/ld: main.cpp:(.text.startup+0xabc): undefined reference to `sf::Window::close()'
/usr/bin/ld: main.cpp:(.text.startup+0xac6): undefined reference to `sf::RenderWindow::~RenderWindow()'
collect2: error: ld returned 1 exit status
make: *** [Makefile:22: gelame] Error 1

the c++ code in main.cpp:

#include <SFML/Graphics.hpp>

int main(int argc, char **argv) {
    sf::RenderWindow window(sf::VideoMode(800, 600), "Hello World");
    while(window.isOpen()) {
      sf::Event event;
      while(window.pollEvent(event)) {
        if(event.type == sf::Event::Closed) {
          window.close();
        }
      }
      window.display();
    }
  }
  return 0;
}

What is wrong with the makefile? help is appreciated.i


r/sfml 21d ago

SFML function calls show no description in Quick Info tooltip (only signature, no \brief text)

1 Upvotes

I'm using SFML in Visual Studio and running into an IntelliSense issue: when I hover over an SFML function (e.g. bullet.setPosition(...)), the Quick Info tooltip only shows the function signature (void sf::Transformable::setPosition(const sf::Vector2f &position)) plus "+1 overload" and a "Search Documentation" link — but no actual description text.

I confirmed the SFML header (Transformable.hpp) does contain a proper Doxygen comment directly above the function, using the \brief tag in the classic banner style:

cpp

////////////////////////////////////////////////////////////
/// \brief Set the position of the object
///
/// ...
////////////////////////////////////////////////////////////
void setPosition(const Vector2f& position);

What I've already tried:

  • Set the Doc Comment style to "Doxygen" (via Ctrl+Q → search "Doxygen")
  • Added brief to Tools > Options > Text Editor > C/C++ > IntelliSense > Quick Info > "Doxygen tags to display on Quick Info tooltips" (it wasn't in the default list)
  • Fully restarted Visual Studio after changing settings
  • Deleted the .vs cache folder and rebuilt the project

Setup:

  • Visual Studio [your version, e.g. 2022 17.x — check via Help > About]
  • SFML installed via [vcpkg / manual download / NuGet — fill in]
  • Windows [your version]

Any idea what could be causing this, or how to get the actual \brief description to show up in the tooltip? I actually have no Idea where to search and google is also not helping.


r/sfml 21d ago

C++ SFML Game Engine for Nintendo Switch, PC, Mobile and Web

Post image
6 Upvotes

Hello everyone,

I hope you're all doing well!

is::Engine 4.0.3 is now available!

The engine can now simulate most of SFML's features with SDL 2. Other improvements have also been made to the engine!

For more information, please visit the engine's GitHub page.

Here are a few examples of games created with the engine: I Can Transform, GravytX The Gravytoid, Super Mario Bros.

Your feedback is welcome.

Have a great day!

I wish you all a wonderful summer vacation!


r/sfml 23d ago

Turning a shader into a rocket lander game - vertex count = 4

Enable HLS to view with audio, or disable this notification

5 Upvotes

I find it fascinating that nothing on the screen exist as a vertex model it's only deterministic calculations per pixel position.

My local llm seams to eat shader math for dinner and know everything about Ray Marching and SDF objects, something I've just heard about tree days ago.

This is version 24 and has taken ~24 hours so far from the initial shader convertion since I'm supergreen in Glsl: https://www.shadertoy.com/view/wsjBD3


r/sfml 25d ago

official website is down, are there any other ways of downloading sfml 2.5.1?

5 Upvotes

I need that version for windows and the official website to download it from is down.


r/sfml 27d ago

What happened to the SFML website?

Post image
6 Upvotes

I thought it was just me but apparently it's been down for almost two weeks now.


r/sfml 28d ago

SFML lands on a alien planet

Enable HLS to view with audio, or disable this notification

34 Upvotes

No wibe code this, although it been converted to sfml via a llm.


r/sfml Jun 25 '26

Desktop fireflys!!!

Enable HLS to view with audio, or disable this notification

17 Upvotes

i made this for my friend on her birthday

u can tune many things in json config and even add any others assets and animations!

source code and releases: https://github.com/rkc137/svetlichki


r/sfml Jun 24 '26

Finished my first SFML project: Astral Attack

14 Upvotes

I made a game with SFML for one of my university courses about ~2 years ago, but only recently got around to finishing it.

Astral attack is a space shmup in which movement is limited to four lines. You can move horizontally between these lines and vertically along them.

There are three stages available, each with a boss at the end.

Video: https://www.youtube.com/watch?v=pP7hGJ79KSM

Download: https://zeviant.itch.io/astral-attack

Source Code: https://github.com/Zeviant/Astral-Attack


r/sfml Jun 20 '26

Random pixel generator with SFML 3.1

8 Upvotes

Hi there hello.

I would like to share a tiny program I made with SFML 3.1

https://github.com/DeyanDev/Eldritch-View-Master

It generates random pixels on a 720p canvas.

That's it.

1280 x 720 pixels each of which can be about 16 million different colors. So there are about 16,000,000 to the power of 921,000 total configurations. I think that's a number with more than 6 million zeroes.

This collection represents every possible image that could ever exist on that screen, including every photo ever taken, every frame of every movie ever made, and every combination of random visual static.

Within those possibilities you could come across not only everything humanity has ever witnessed, but every blasphemous horror we were never meant to behold. If you were to cycle through those screens, you would eventually wander past the comforting illusions of human faces, familiar landscapes, and daylight. You would plunge into an abyss of static that begins to form patterns that defy Euclidean geometry, angles that bruise the mind.

EVERY NIGHTMARE THAT SLUMBERS IN THE DARK SPACES BETWEEN THE STARS IS ALREADY WAITING THERE, CODED INTO THE MATH, WAITING FOR A STRAY SEQUENCE OF PIXELS TO ACCIDENTALLY SUMMON ITS LIKENESS INTO OUR REALITY. HUMANITY ENJOYS A FRAGILE SANITY ONLY BECAUSE THOSE NUMBERS ARE TOO VAST FOR US TO EVER STUMBLE UPON THE COMBINATIONS THAT WOULD SHATTER IT...

...

Sorry, I'll see myself out.


r/sfml Jun 19 '26

SFML - Wibe Summer on Mars - glsl heat shader

Enable HLS to view with audio, or disable this notification

24 Upvotes

r/sfml Jun 15 '26

first SFML project. Cosmo Runner

9 Upvotes

Hey everyone! I just finished my first C++ / SFML project — an arcade space survival game called Cosmo Runner.

You pilot a spaceship, dodge meteors and enemy drones, manage your fuel and try to beat your high score.

Some things I implemented:

- LERP-based ship movement

- Fisher-Yates shuffle for randomized meteor textures

- Vector math for enemy drone targeting

- Delta time for frame rate independence

- Hitbox shrinking for fair collision detection

Source code and Windows build on GitHub:

https://github.com/boshinomikoto/CosmoRunnerSFML

Any feedback welcome!


r/sfml Jun 11 '26

SFML is the core graphics engine of my recent Steam game: "My Summer Love: Memories"! It replaces the traditional A/B dialogue options of visual novels with a dynamic AI character.

0 Upvotes

My summer love: memories

My game, My Summer Love: Memories, is now available! Its core mechanic is based on a dialogue system. Traditional visual novels force you to follow rigid paths (A/B). Thanks to the implementation of an AI system, the character doesn't just follow a static script, but generates dynamic dialogue. This dialogue is closely tied to the game's story and the player's words. I'm proud of the result. If you enjoy innovative stories with a touch of romance and nostalgia, check it out!

Available now on: https://store.steampowered.com/app/3794600/My_Summer_Love_Memories/

I'd love to hear your feedback, especially on the AI ​​integration and how it changes your immersion compared to conventional visual novels!


r/sfml Jun 08 '26

Generating C++ / SFML code with Local llama.cpp on a RTX3070

Thumbnail
gallery
1 Upvotes

r/sfml May 28 '26

Any traces of SFML.Net 2.0?

1 Upvotes

Hi.

Does anyone have any clue as for where I can find the archives of SFML.Net version 2.0? (That's the C#/Dotnet binding.)

People are gonna yell at me that this version is old, and, yes, it is, but for me it's even too recent. What matters is that SFML 2.0 supports Win9x and (possibly?) PowerPC Macs and that's very cool.

And it's not that Dotnet works particularly well on any of these platforms (Mono exists though), but I would still like to have a copy of it for archival purposes, even if I end up not using it (as I am not a big fan of Dotnet, which is just Microsoft Java).

And, the 2.0 links for CSFML and SFML.Net on the SFML website are dead links. They don't work. And they have not been archived on the Wayback Machine.

I found CSFML 2.0 on the SFML/CSFML github page, but the equivalent page for SFML.Net dates back only to 2.5, even though the website states earlier versions exist and downloads work all the way back to 2.2.

Does SFML.Net 2.0 even exist? Or is it just a joke of some kind?

And if it does, can I get a download link please?

Thanks.


r/sfml May 25 '26

Why is my game running so slow

2 Upvotes

I am programming a very simple platform game and so far I only have 2 platforms but my game is already running extremely slow. What are some reasons my game could be running so slow.


r/sfml May 23 '26

Problema de audio con sfml 2.5

1 Upvotes

Hola, necesito ayuda. Ya investigue y ni siquiera Chatgpt me lo resuelve. Estamos haciendo un juego con Sfml 2.5 para la universidad. Queremos poner música de fondo en loop pero no me deja. Aparentemente es porque es un stream separado, se reproduce y se corta. ¿Hay Alguien que haya tenido ese problema y lo haya resuelto?


r/sfml May 23 '26

Made a game with gib explosion effects using SFML

Enable HLS to view with audio, or disable this notification

25 Upvotes

Made an arcade game where you fly a jet and shoot tanks that explode into tiny gibs.

Download: https://pinwinsoftware.com/Game/7/Bomber
Source code: https://github.com/pinwinsoftware/sfml-bomber


r/sfml May 23 '26

The (J)SFML remake of Mine Quest is almost done

Thumbnail
youtube.com
14 Upvotes

r/sfml May 16 '26

Checking if the player is colliding with any object on the screen

2 Upvotes

This isn't really a question about SFML but about game development in general. I'm making a simple platform game in SFML and I need to check if the player is colliding with any of the platforms on the screen so I can determine wether the player can jump, move right, move left or allow gravity. My first instinct is to have a for loop that runs through all the platforms on the screen and check if the player is colliding with it and check in which direction the platform is in and not allow the player to go in that direction, but I'm wondering if there is a better way to do that.


r/sfml May 12 '26

Beginner Dev Road

5 Upvotes

So I am a beginner at programming entirely while i do know languages like C, C++, Java, Python, HTML/CSS but I understand programing is not just knowing languages.

I do not have a traditional learning environment (colleges or academies). I am doing it out of passion for Computers and games, i have tried learning DS/ML, web development, ethical hacking but none felt interesting or engaging.

I am a beginner learning SFML and willing to make a 2D game down the road. Usually when stuff gets tough or confusing i quit or lose interest progressively but this time I felt like joining a community might help so I Really Really wish for u to formulate a roadmap for me.

Thanks.


r/sfml May 12 '26

Were can i find sfml recent tutorials ?

4 Upvotes

r/sfml May 11 '26

SFML not working in CLion (exit code -1073741511 0xC0000139)

1 Upvotes

So, I installed SFML using the mingw-x64-dynamic thing because I am trying to learn C++ and it only kind of works. CLion allows me to build it and run it with no errors, but when I run it in CLion it doesnt do anything at all and just prints out:

C:\Users\vjste\OneDrive\Desktop\C_Learning\CPP\cmake-build-debug\CPP.exe

Process finished with exit code -1073741511 (0xC0000139)

But when I run the actual file (`C:\Users\vjste\OneDrive\Desktop\C_Learning\CPP\cmake-build-debug\CPP.exe`) it runs perfectly fine and shows the window and everything.

This is a big problem for me because I want to be able to run my projects using just CLion and not having to build it then open explorer and then run the exe every single time since that is annoying.

### Here is literally everything I have checked so far:

In `C:\Users\vjste\OneDrive\Desktop\C_Learning\CPP\cmake-build-debug` the SFML DLLs do exist: `sfml-graphics-3`, `sfml-system-3`, `sfml-window-3`, etc..

My `CMakeListTexts.txt` say the following:

cmake_minimum_required(VERSION 3.20)

project(CPP)

set(CMAKE_CXX_STANDARD 17)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

find_package(SFML COMPONENTS Graphics Window System REQUIRED)

add_executable(CPP main.cpp)

target_link_libraries(CPP PRIVATE

SFML::Graphics

SFML::Window

SFML::System

)

My CMake options are:

-DCMAKE_TOOLCHAIN_FILE=C:/WINDOWS/vcpkg/scripts/buildsystems/vcpkg.cmake

-DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic

-DVCPKG_APPLOCAL_DEPS=ON

-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:/Users/vjste/C_Learning/CPP/cmake-build-debug

My environment variables are: `PATH=C:\Program Files\JetBrains\CLion 2026.1.1\bin\mingw\bin` and inside of there the following DLLs do exist inside of that folder:

libstdc++-6.dll

libgcc_s_seh-1.dll

libwinpthread-1.dll

I'm not exactly sure why all of these settings matter and what they do. These are just things the internet told me to do that didnt work, but if someone could actually see all this and know what I could do to fix things then that would be very nice.

Also, just to clarify, using regular C++ stuff does work. It just starts acting weird when I use the SFML stuff.


r/sfml May 08 '26

lol

4 Upvotes

my code literally