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.

Official resources

Main features

  • Portable: SFML compiles on standard platforms like Windows (98, 2000, XP, Vista, 7, 8 and 10) and Unix systems (Linux, and Mac OS X). As the library grows up, support for more operating systems will be added.
  • Object-oriented: SFML is written in C++ and provides an efficient, object-oriented design. It relies on standard patterns and idioms to provide a simple and robust framework.
  • Easy to use: SFML aims at being easy to manipulate. The effort is put on the internal code to provide the simplest public interface.
  • Flexible: Instead of being one big API, SFML rather contains a lot of small packages, that can be chosen and combined according to the intended usage. You can use only the base package to get input and windowing, as well as the full graphics package with sprites and post-effects.
  • Easily integrable: SFML can be used in one or more windows, and/or can be integrated with existing interface components. Integration with existing graphical user interface (GUI) libraries is easy so that you can add SFML views into complex interfaces built with Qt, wxWidgets, MFC or whatever.

Languages

SFML is implemented in C++. That said, several bindings have been created for other languages that allow SFML to be used from C, C#, C++/CLI, D, Ruby, OCaml, Java, Python and VB.NET.

System

  • Portable and accurate time measurement
  • Simple and object-oriented threads and mutexes
  • Unicode module for proper conversions between UTF and locale-dependent encodings

Window

  • Can be used as a minimal, portable package to replace GLUT or SDL for windowing and input with OpenGL
  • Can create several rendering windows
  • Can be integrated into components of existing Qt, MFC, wxWidgets, Win32, X11, etc. interfaces
  • Provides both a message-based and a real-time interface for handling input
  • Can handle mouses with up to five buttons
  • Can handle four joysticks with up to seven axes and 32 buttons

Graphics

  • Interfaces very easily with OpenGL
  • Modern effects available and hardware-accelerated: alpha-blending, rotations, shaders, ...
  • Manages memory efficiently, so that you don't have to worry about resources lifetime or storage; you can even load your graphical resources before any window is created
  • Can load and save standard image formats: BMP, DDS, JPEG, PNG, TGA, and PSD
  • Can load all graphics resources directly from files in memory
  • Can use views like in a 3D scene, to zoom / translate / rotate the whole world
  • Uses a simplified shader language for adding real-time post-effects
  • Easy manipulation of graphical text through bitmap fonts
  • Supports unicode characters
  • Can load standard font file formats: TTF, CFF, PCF, FNT, BDF, PFR, SFNT, PostScript Type 1, Type 42

Audio

  • Uses hardware acceleration whenever possible
  • Can load and save standard sound formats: Ogg, WAV, FLAC, AIFF, Au, RAW, paf, 8SVX, NIST, VOC, IRCAM, W64, MAT4, MAT5 PVF, HTK, SDS, AVR, SD2, Core Audio Format, WVE, MPC2K, RF64
  • Can load all audio resources directly from files in memory
  • 3D sound spacialization
  • Easy interface for capturing audio
  • Manages memory efficiently, so that you don't have to worry about resources lifetime or storage
  • Supports streaming for big files ; you can even write your custom streaming class for any source (network, ...)
  • Supports multi-channels formats (mono, stereo, 4.0, 5.1, 6.1, 7.1)

Network

  • Implements a portable layer over TCP and UDP sockets
  • Easy data transfers through stream-based extensible packets
  • Classes to use the HTTP and FTP internet protocols

License

3542 questions
0
votes
0 answers

SFML. The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll

I'm studying SFML. I work with msys2 mingw64. When working with windows, shapes, textures, there were no problems, everything was compiled and worked until i`ve decided to implement my own textbox. When using sf::Font, sf::Text program compiles…
0
votes
1 answer

Centripetal Catmull-Rom spline rendered like a dashed line in SFML

I was making a basic paint app in SFML and I wanted to let the user draw smooth curves with the cursor. To achieve this effect, I used the C++ code for the centripetal Catmull-Rom spline from wikipedia I'm not sure what I'm doing wrong but the curve…
Shriram
  • 167
  • 1
  • 13
0
votes
1 answer

Bottom Face of Cube not rendered - Face Cullling OpenGL

I am drawing a cube in OpenGL C++ with SFML in place of GLFW. The Cube is being rendered correctly without face culling but after face culling the bottom face of the cube is not visible. I wanted the camera - facing sides of the cube to be rendered…
Shloak
  • 15
  • 4
0
votes
1 answer

How to limit game loop fps?

I'm trying to limit my gameloop fps using SFML but it's not working correctly. if I divide 60/1000 shouldn't the result be the time of each frame to get 60 FPS? I put in 60 but I only get 33 does anyone know where I made a mistake? Here is my…
0
votes
0 answers

RayCasting in C++ (and SFML) using DDA alogorithm does not appear to detect collision

I tried to improve a previously working project that Raycast by inching each ray forward a pixel at a time until it collided with an object, by using a new and better algorithm called DDA. I used this page and the ideas from this video. Despite…
0
votes
0 answers

SFML Library undefined reference

I have been trying to run SFML on VSCode using CMake. After getting CMake to build a working executable. I wrote a simple program that makes a window and draws a circle. However when I build the program I am getting an undefined reference…
0
votes
1 answer

How to override sf::Drawable::draw()

Try to make a caro game with SFML so first I try to display a rectangle on window using sf::Drawable but I can not see the my rectangle on Window. I just declare a Game object and call run() in my main() function. Game.cpp #include…
0
votes
1 answer

Object speed is changing randomly in SFML C++

I have a created a little program in SFML C++ where I want an object to move. But my problem is the movement speed is not constant, sometime speed is dropping randomly and the movement is not smooth at all. Video Link If you take a closer look the…
Shazin
  • 51
  • 1
  • 9
0
votes
0 answers

Text not being drawn to screen due to Imgui-sfml

#include #include #include #define SCREEN_WIDTH 1000 int main(int argc, char *argv[]) { sf::RenderWindow window(sf::VideoMode(1000, 550), "Trajectory Simulator"); ImGui::SFML::Init(window); …
0
votes
1 answer

How can I manage many instances of a class in C++, giving them all information and then deleting them?

I apologize for the imprecision on my language, I'm fairly new to programming. Let's say I'm trying to create a particle effect in SFML. The solution I have at the moment is to create multiple instances of my particle class and then update them…
0
votes
1 answer

Doubly circular linked list memory access error

i've been trying to figure it out by my self but I cant figure it out, I've try to implement a doubly circular linked list template class, in purpose to create a menu for an app with SFML. I dont know why but when i implement an instance of…
RayanYI
  • 1
  • 1
0
votes
0 answers

Error, cannot convert 0 from int to int& C++

I'm using the SFML library and wanted to create a function for events, which worked perfectly fine. until I tried to add a scroll feature using an optional parameter. my problem simplified #include int check(sf::RenderWindow&,…
Myth
  • 49
  • 5
0
votes
1 answer

Collision between two circles not behaving correctly

#include #include #include #include #include #include #include #include #include double DISTANCE( sf::Vector2f l, sf::Vector2f k); bool…
0
votes
1 answer

SFML Non-Blocking UDP Sockets, Cant Send Then Recieve

I'm trying to make a simple multiplayer example in C++ & SFML (Graphics & Sockets). MY goal at the moment is to make a demo where you can connect to a server, when you do, you receive the position of all the other "players" on the server. I want to…
0
votes
0 answers

SFML when destructor is defined, i get access violation exception

So my program works just fine but when i define the MapTile's destructor ( which just calls delete operator for sprite and a texture) it throws access violation at the start of the program. Can someone please help me? Here's the code: Map.h #pragma…
Justro
  • 11
  • 1
1 2 3
99
100