sfml

What are the Gotchas and Issues I should be aware of with SFML?

I've been using SDL for a while to prototype small things and to learn more about graphics programming. Then I saw SFML and wanted to give it a try, saw that it was more object oriented and fixed some issues I felt SDL had. But since I know little about the library itself, what are it's main flaws and other issues that I should be awar...

Race car game, car moving faster on faster computer

I understand why it does that but I don't really have any idea of how to prevent that. So the scenario is, every frame I move the car by a certain of predefined pixels. What happens is when I go on slow or faster computer... well I get less or more frames per seconds so the car moves either slower or faster. I was wondering how I coul...

SFML Releasing Resources

I've recently started using SFML and noticed that there aren't any kinds of "FreeResource" methods provided. For example, sf::Font has a function called LoadFromFile, but no functions to release the resource. I thought this was very odd. Am I missing something? Is my only option to create an sf::Font pointer and dynamically allocate and...

SFML SetFramerateLimit Not Limiting Frame Rate

Compiler: Visual C++ OS: Windows 7 Enterprise For some reason, Window::SetFramerateLimit isn't limiting the frame rate in the app I'm working on, but it works fine for others. The framerate is capped to 60, but mine jumps around at 100-99 and then goes down to 50 sometimes. It actually causes serious issues. For example, if I create man...

Algorithm for count-down timer that can add on time

I'm making a general timer that has functionality to count up from 0 or count down from a certain number. I also want it to allow the user to add and subtract time. Everything is simple to implement except for the case in which the timer is counting down from some number, and the user adds or subtracts time from it. For example: (m_cloc...

How can you animate a sprite in SFML (C++)

Lets say I have 4 images and I want to use these 4 images to animate a character. The 4 images represent the character walking. I want the animation to repeat itself as long as I press the key to move but to stop right when I unpress it. It doesn't need to be SFML specific if you don't know it, just basic theory would really help me....

Which is better: SDL or SFML?

I'm thinking about switching from SDL to SFML, but before I do I want to know which is better. I'm mainly looking for easy sound/music, sprite rotations that are easy on the framerate/cpu, portability, and ease of installation. ...

SFML Plasma Sprite Effect?

Is there a way to create a plasma effect in SFML that doesn't slow my framerate to a crawl? ...

Qt Creator / QMake Linker Arguments

Hi guys. I'm using SFML, and I want to use Qt Creator in conjunction with it. When I'm compiling manually, I supply the following arguments to the linker -lsfmlsystem -lsfmlwindow. How do I do this if I'm using Qt Creator and (I think) QMake? ...

Input system reference trouble

Hello, I'm using SFML for input system in my application. size_t WindowHandle; WindowHandle = ...; // Here I get the handler sf::Window InputWindow(WindowHandle); const sf::Input *InputHandle = &InputWindow.GetInput(); // [x] Error At the last lines I have to get reference for the input system. Here is declaration of GetInput from...

C++ SFML "unable to initialize application 0xc000005"

I wrote a wrapper for SFML that would allow me to replace the renderer for my game if I needed to. It worked. Then I refactored and while it still compiles, I now get "unable to initialize application 0xc000005" when running the compiled executable. What would cause such an error? Google was unhelpful. I'm using Windows XP. ...

SFML Input GetMouseX and GetMouseY not catching on to mouse movement

I'm programming a GUI in my app and I noticed that button presses weren't being registered very quickly. I did some lazy debugging (send coordinates of mouse to output) and I noticed that Input's GetMouseX and GetMouseY weren't responding nearly fast enough to when the mouse moved somewhere. This small tidbit should be able to reproduce...

Getting an Xcode project's resources in c++

I'm coding a simple game using SFML in Xcode. I have a .png of a block I want to use in a sprite. At the moment, I have to type the full path to the image in the code snippet below: sf::Image blockImage; if (!blockImage.LoadFromFile("/Users/me/Development/Tetris/images/block.png")) { cerr << "Could not load block image." << endl; ...

How do I use text in SFML.NET?

I just downloaded SFML.NET and added a reference to the library DLLs included with it, but it seems the Text class is not there. In the example on the site, it is clear that a Text object being used... so the example won't compile. See for yourself... There's only Font, no Text! Anyone knows what I could be doing wrong? ...

The application failed to initialize properly (0xc0150002)

I'm trying to compile an SFML program I've writting in Visual C++ 2010. It compiles fine, but when I run the executable I get this error: The application failed to initialize properly (0xc0150002). Click on OK to terminate the application. This happens every time I try to run an application that uses SFML, I have included the librari...

Problems linking to a library with gcc

I installed SFML from scratch today so I could work on a game. I downloaded the source, ran sudo make install, tried compiling one of my old projects, and I couldn't get it to link properly. So I tried running a simpler project: one of the samples in the tutorials. I tried to compile this one specifically, but I get these errors: g++ -o...

library location for project

I have started an C++ SFML project for linux. I was wondering where the .so's should go. Should they go inside the project folder so a user can simply run the program after they get it? Or should the user have the SFML library installed on there linux machine before they run my program? ...

SFML.NET particle system

I've written particle systems before and, put simply, it's more effort than it's worth given the size of the projects I want it for. What I'm ideally looking for is a particle system which can be easily dropped into an SFML.NET project without needing a great deal of manual integration. Does anything already exist to fill this need (ide...

SFML Input system problem

So I was porting my game engine from SDL to SFML, and now I have a problem with my input system. Input.h #ifndef BULLWHIP_INPUT_H #define BULLWHIP_INPUT_H #include class bc_Input { public: bool bm_KeyHit(sf::Key::Code key); bool bm_KeyDown(sf::Key::Code key); int bm_MouseX(); int bm_MouseY(); ...

SFML window resizing events blocking the main thread

I just started using the SFML library and its fantastic. However when resizing a window by dragging the corner with my mouse i don't get the resize events until i release the mouse. This means i can't update my graphics until the mouse is released (game loop is on the gui thread) and is also causing a massive flood of events to come thro...