Questions tagged [sfml]

SFML (Simple Fast Multimedia Library) is a portable and easy to use multimedia API written in C++. You can see it as a modern, object-oriented alternative to SDL. SFML is composed of several packages to perfectly suit your needs. You can use SFML as a minimal windowing system to interface with OpenGL, or as a fully-featured multimedia library for building games or interactive programs.

sfml
Filter by
Sorted by
Tagged with
-1 votes
0 answers
38 views

SFML macOS Display: How to Achieve 1x1 Pixel Rendering?

I am using SFML on macOS. I have noticed that images and text drawn appear to be of poor quality. After taking a screenshot, I discovered that all the "pixels" drawn in SFML are actually 2x2 ...
Davide42's user avatar
-4 votes
0 answers
19 views

Raycasting FishEye problems [closed]

How do I fixed this [Google](https://pastebin.com/8qTAdy95) the code worked fine if I put float shape_height = round(1000.f* projection /rad); but when I tried doing float shape_height = round(...
user24269153's user avatar
-3 votes
0 answers
54 views

SFML library static link

I'm trying to create a program using the SFML libraries. I downloaded the archive from the official website and from the lib folder I took the files libsfml-audio-s.a, libsfml-graphics-s.a, libsfml-...
Trigun751's user avatar
-2 votes
0 answers
32 views

Segmentation fault caused by FFMPEG / SFML on Macos

I'm trying to code a basic video player function to use it in a game it's supposed to get a sfml window and a video link as inputs and run the video: extern "C" { #include <libavcodec/...
Med ali Damergi ReTr0's user avatar
0 votes
1 answer
41 views

SFML conversion from (int to string) text appearing as a dot

#include <SFML/Graphics.hpp> #include <iostream> #include <string> using namespace std; struct patrat { long double greutate; //mass sf::RectangleShape shape; long ...
Oliver Jeworrek's user avatar
0 votes
1 answer
25 views

Can somebody figure out whats wrong in this sfml code for CHESS

sorry for writing bad code i am new to cpp so the problem is the sprites location is not changing no matter what i do.i cant figure out. #include \<SFML/Graphics.hpp\> #include \<vector\> #...
Tony Prajapati's user avatar
-4 votes
0 answers
92 views

Why is this Python code running faster and more accurate than the C++ code? [closed]

I created an app where two squares of different masses collide with each other and compute pi, like in 3Blue1Browns video https://www.youtube.com/watch?v=jsYwFizhncE . I already made this app in ...
T4 Vertix oli's user avatar
-1 votes
0 answers
35 views

Undefined reference to "Game::*" C++ SFML lib [duplicate]

I have been trying to get the SFML library to work in VS Code using this tutorial. When i try to compile using Wingw64, it gives undefined references to my class. I'm on a 64-bit windows. ERRORS: C:/...
plex's user avatar
  • 1
1 vote
1 answer
48 views

Is there any way to configure VS code to work with SFML library directly with the "Run Code" button?

I've been trying to use the SFML library with Visual Studio Code and the C/C++ v1.19.9 Microsoft extension. My goal is to configure Visual Studio Code to compile and run SFML code directly from the ...
David's user avatar
  • 19
1 vote
1 answer
34 views

SFML/C++ Why does my method to move the enemy towards the player stop working when the player is moving?

the only other code used in this from anywhere else is Player::getPosition(), which is just returning playerSprite.getPosition() and Game::update which passes Player::getPosition() to this function sf:...
Amp's user avatar
  • 21
-1 votes
0 answers
19 views

Can't run built SFML project from Xcode template

I've downloaded SFML-2.6.1 and created Xcode project from template on my M1 Mac. Although project is building, it can not run, raising this error in the Xcode terminal: dyld[7793]: Library not loaded: ...
zolars's user avatar
  • 67
0 votes
1 answer
39 views

How to render sprites for a snake game using SFML and C++

The game works fine, but its using rectangle shapes and I want to render the snake parts using Sprites. Here is the code (Yeah It's not that clean I just wanted to get this working): #include <SFML/...
b09's user avatar
  • 1
-2 votes
1 answer
53 views

VS2022 C++ empty directory for audio file. CMake; SFML

I did absolutely everything according to the instructions and it came out as usual, I read the documentation, this error is not specified, in the console in quotes should be the directory of the audio ...
Ego Solus's user avatar
1 vote
2 answers
66 views

target_include_directories syntax?

Program3 ├── CMakeLists.txt ├── CMakePresets.json ├── CPPs ├── Program3.cpp // this is example code i'm trying to run ├── Program3.txt // this is the premade .cpp file that came with the cmake ...
Daniel Wrzesinski's user avatar
0 votes
0 answers
18 views

My SFML program is not redrawing my sorted array of sqaures

I'm making a bubble sorter visualizer. After making random squares and displaying them. Then it goes into my bubble sorter and I rerun my draw and display functions but the new updated array is not ...
Amjed Breesam's user avatar
-1 votes
1 answer
52 views

Valgrind error when loading font in SFML project

This code: // g++ sfml.cpp -o sfml_test -lsfml-graphics -lsfml-window -lsfml-system #include <SFML/Graphics.hpp> #include <iostream> int main() { sf::Font font; if (!font....
Momus's user avatar
  • 5
0 votes
0 answers
39 views

How to install SFML.WINDOW in Microsoft Visual Studio 2022

I have installed Visual Studio 2022, and I need to install a package. Trying to install the SFML.WINDOW, I get this error: Could not install package 'SFML.Window 2.5.0'. You are trying to install ...
Nvidos's user avatar
  • 1
-1 votes
0 answers
49 views

Is there a ´right´ way to get CSFML.jl in Julia to work on MacOS?

I am building a game engine and would like to use CSFML.jl as the foundation. I have the Julia package installed on both my linux (Fedora) box and my Mac. On Linux it worked like a charm and I was ...
DopedCow's user avatar
0 votes
0 answers
26 views

Getting vcpkg Cmake/Clion errors with SFML and TGUI

I am currently using Vcpkg on a windows computer on CLION IDE. I am trying to install SFML and TGui, but getting build errors. Here is the error "C:\Program Files\JetBrains\CLion 2023.3.2\bin\...
Sobstory's user avatar
0 votes
0 answers
18 views

Xcode Mac sfml Library not found

So I tried to run Sfml app on Xcode, I successfully got Build Succeed. But then this showed up:\ dyld[99058]: Library not loaded: @rpath/sfml-system.framework/Versions/2.6.1/sfml-system Referenced ...
Dennisans's user avatar
0 votes
0 answers
39 views

Got Library not loaded error while setting up sfml

I am trying to compile simple code that will show me a window by using Xcode with my Mac. Everything seems to work and I get "Build Succeeded". But then nothing happens and I get the message:...
Harish S's user avatar
0 votes
0 answers
23 views

Modifying sf::ConvexShape hitbox in sfml

I am trying to modify the hitbox of a convex shape in sfml in order to accurately test for intersection between a projectile that I have. I cannot seem to figure out how to modify the bounding box of ...
stubbie's user avatar
0 votes
0 answers
59 views

My console game doesn't accept keypresses until I hit the space bar once (VS 2022, C++)

I am just starting with coding and I am following the book "Beginning C++ Game Programming Second Edition" by John Horton, and so far everything works more or less as I expect, apparently ...
flypirat's user avatar
1 vote
0 answers
65 views

Including SFML library in assignment submission

I finished my assignment for a class I'm taking, and I wrote it in C++ and used SFML to animate some portions of it. To make sure that the program can actually run in the case that whoever is trying ...
federoma10's user avatar
0 votes
1 answer
15 views

SFML trouble if(font.loadFromFile(FONT_PATH)) -> expected declaration

sf::Font font const std::string FONT_PATH = "$(SolutionDir)\resources\Fonts\Oswald-Regular.ttf"; if (!font.loadFromFile(FONT_PATH)) return -1; ... There is an error with the if statement. It ...
Longfield Titans's user avatar
0 votes
0 answers
44 views

ERROR with "SFML/Graphics.hpp' file not found"

I ran into an error in X Code for the library when every I was using the #include SFML/Graphics.hpp however it said the file was not found enter image description here I even imported the libraries ...
AXB2028's user avatar
0 votes
1 answer
46 views

C++ VS Code SFML no cout statements are printed to the terminal

I am using C++ in VS Code, I have a simple SFML project. For some reason, when I compile and run my program, none of my cout statements are printed to the terminal window in VS Code. The SFML window ...
Julian42_74's user avatar
0 votes
0 answers
22 views

SFML not loading font file properly?

I'm trying to load a font file and system says it exists but there's some sort of error with SFML?? here's the snippet of code // Get current working directory std::filesystem::path currentPath = std::...
GreenBeans's user avatar
0 votes
1 answer
55 views

Linking SFML statically using cmake

I have the problem with linking SFML library statically, but dynamically it works. What is wrong here? Here is how I fetch SFML by downloading it online. # Fetch sfml library FetchContent_Declare( ...
pureCod's user avatar
  • 13
-1 votes
1 answer
103 views

60fps snake movement sfml

I am trying to implement a simple snake game in c++ sfml, however I am running into an issue when I try to make the game work in 60 fps. I cannot figure out how to move each element of the body ...
stubbie's user avatar
3 votes
0 answers
33 views

(gtkmm, sfml) My music stream is experiencing stuttering

I want to build a music player using gtkmm and sfml but i am encountering stuttering with my music stream. I tried using a separate thread for the music but i couldn't understand how to use Glib::...
Bogdan Valentin's user avatar
0 votes
1 answer
36 views

How to draw an SFML shape on the intersection with a polygon

Say I have a polygon (i. e. an array of 2d points). What is the easiest way to draw any sf::Shape but only affecting pixels contained within that polygon? I have drawn my polygons with sf::ConvexShape....
A user's user avatar
  • 11
0 votes
1 answer
84 views

Infinite Jump Issue

I am currently making a game in c++ using sfml, I encountered a problem where if I jump in my game, the jump mechanic allows the player to jump repeatedly in mid-air which is something I do not want. [...
Cheez's user avatar
  • 9
0 votes
0 answers
38 views

Sfml Sprite not showing

I'm new to sfml and was trying to create a class characters to create player whose sprite is stuck with its bounding box, but its not working properly i tried to check by switching the sf::Sprite to ...
Prathamesh Bhoite's user avatar
1 vote
0 answers
81 views

Failing to load image from File in SFML with C++ as its primary language

I just started learning how to make games with SFML in c++ but while learning the basic structure of SFML and got to a point where i need to load a texture with sprite i get the error below along with ...
Mono XRaider's user avatar
0 votes
0 answers
22 views

Cmake SFML font not loading [duplicate]

So I've made a simple project with c++ and SFML. I've wanted to compile it and build with cmake so that I can open it like an actual app. I can compile and build it but then when I try to open that ...
Peczyn's user avatar
  • 1
0 votes
0 answers
22 views

there is no suitable user-defined conversion from "sf::Image" to "const std::string"

There is a code but it gives an error in visual studio, everything seems to be correct if you remove 2 lines replacing them with ` Image ava6; ava6.loadFromFile("images/ava6.png"); Texture ...
Vair's user avatar
  • 1
0 votes
1 answer
60 views

How to draw n vertices of a VertexArray in SFML?

I have a line-strip of say N vertices sf::VertexArray vArr(sf::PrimitiveType::Lines, N);. Now when i draw it, it draws the entire line-strip of N vertices... How do I draw n (such that n < N) ...
Allay466's user avatar
0 votes
0 answers
47 views

Updating a Vertex Array Tile Map?

I m trying to learn creating tilemap with vertex array. I found a code from a tutorial and i read its necessary to use vertex array for creating huge tilemaps if we need optimal rendering performance ...
xy1qw1's user avatar
  • 1
0 votes
1 answer
58 views

ImGui-SFML cmake error when using git submodules

i'm doing a cmake for a project using sfml and imgui I'm using submodules to get SFML, imgui and imgui-sfml from github and I have some errors and I can't find the cause. my project structure is like ...
Loïc Pottier's user avatar
0 votes
0 answers
55 views

Cereal Library static_assert failed 'cereal could not find any output serialization functions for the provided type and archive combination.'

I am trying to serialize SFML shapes for a 2D ms paint like program. I am getting an assertion error during build but everything online I can find it is a result of not marking a function with the ...
Lee's user avatar
  • 23
0 votes
0 answers
65 views

VS-2019 C++ and SFML compiles and runs in Debug mode, but fails in Release mode

I am doing an example from "Beginning C++ Game Programming" by John Horton Configured VS-2019 to work with SFML and reach the stage of placing two PNG images on the screen and moving them ...
Andre186's user avatar
0 votes
0 answers
17 views

How to fix the procedure entry point could not be located in the dynamic link library [duplicate]

while running sfml project in codeblocks , it says "the procedure entry point _zst28_throw bad array length could not be located in dynamic link library " . what to do? I had tried to solve ...
vivek kc's user avatar
0 votes
0 answers
56 views

cannot find -llegacy_stdio_definitions: No such file or directory

I've been working on a school project in c++ using SFML on macOS, since it's my main OS. I ran into an issue with threads (a requirement of the project :/) and decided to switch to windows, since the ...
martin Čonto's user avatar
-1 votes
1 answer
34 views

SFML - Trying to overload a window as a function parameter

I'm using SFML with C++ in Visual Studio 2019. I wanted to try to make a function to streamline the process of printing text to the window. #include "SFML/Graphics.hpp" #include "SFML/...
Cipher Visor's user avatar
0 votes
0 answers
55 views

C++ program made with the lib sfml not running

I'm trying to run an executable of a program made in c++ using sfml but nothing is happening, no error messages, just nothing in the vscode powershell I put g++ -c main.cpp -IC:\Users\ferna\OneDrive\...
Luiz Fernando Schmitt Filho's user avatar
0 votes
0 answers
40 views

Simulating multiple instances of application

I am creating an c++ game with use of SFML. The game which i am trying to code should be multiplayer game. Game wont have server but multiplayer would be possible to play only on the same local ...
martin Čonto's user avatar
-2 votes
1 answer
42 views

The window in the SFML application closes itself with code 0

I try to make turn based game. Now i try to make grid. I output text with information about grid on screen. But the window keeps closing after a while. Maybe I am doing something wrong? This is my ...
Noname frai's user avatar
1 vote
0 answers
58 views

SFML Handle collision

I can't seem to actually handle a collision (basically make sure that two objects can't overlap) also I'm using pixel perfect collision so using AABB won't help. I tried so many different ways, some ...
the block's user avatar
1 vote
0 answers
31 views

SFML Inputs Skipped

I built this game and I feel like it works ok now, but sometimes it seems to skip inputs, and sometimes when i didn't let one key go yet, and press another one, it doesn't register that. For some keys ...
aaliyah's user avatar
  • 23

1
2 3 4 5
72