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

learn more… | top users | synonyms

2
votes
1answer
142 views

Development with multiple libraries

I'm almost fresh to the game development and I have one question about libraries. If I choose one library, such as SFML, to develop the menu of my game, is it possible to merge with, for example, ...
-1
votes
2answers
399 views

Shooting many bullets toward the mouse position

I try to shoot a bullet toward the mouse position by this code. float deltaX = mousePosition.x - (aircraft.getPosition().x + aircraft.getLocalBounds().width / 2); float deltaY = mousePosition.y - ...
0
votes
1answer
1k views

How to use C++11 chrono header for a clock

In first, sorry for my bad english. :) I'm making a game using SFML and C++11 new features, but I've got a problem with my custom Clock class (made to replace the SFML one). When I get the elapsed ...
1
vote
1answer
264 views

Drawing a textured 3D object breaks SFML text render

I writing a OpenGL game using SFML. I'm using the push/pop function to combine OpenGL with SFML like the tutorial SFML+OpenGL but, when I added textures to my model, the SFML text rendering appears ...
0
votes
2answers
528 views

SFML networking rts

You will be controlling only one person directly in the game. But, you can issue vague command like to build something here or attack at this square. So I'm trying to make a multi-player roguelike ...
2
votes
2answers
397 views

Framerate-independent acceleration

Is this the right way, or at least a way that works, for dealing with accelerations in variable time steps evironments? // Pseudo-code void onUpdate() { mySpeed += acceleration * ...
3
votes
1answer
335 views

Jittery Movement, Uncontrollably Rotating + Front of Sprite?

So I've been looking around to try and figure out how I make my sprite face my mouse. So far the sprite moves to where my mouse is by some vector math. Now I'd like it to rotate and face the mouse as ...
3
votes
1answer
406 views

SFML RenderWindow Unhandled Exception

So I've been following an SFML tutorial but unfortunately, it doesn't seem to be working. The tutorial shows a RenderWindow as a global variable and then accesses it like this: LevelState.h: struct ...
11
votes
4answers
624 views

How to determine range of possible movement in turn-based, distance-based strategy game?

I'm creating a 2-dimensional, turn-based strategy game using c++ and SFML-2.0. Movement is distance-based rather than grid-based, with several different triangle-shaped pieces that, on a given turn, ...
4
votes
1answer
535 views

C++ SFML Box2D - Somewhat confused when it comes to syncing phyisical body with a render body

While testing Box2D with SFML I encountered something which confuses me: The relation between physical body centroids and SFML's sprite origin. As an example I have a test class GameObject which is ...
0
votes
2answers
2k views

SFML fail to load image as texture

I have come to a problem with the code below ... Using SFML 2.0 #include <SFML/Graphics.hpp> #include <iostream> #include <list> int main() { float speed = 5.0f; // create the ...
3
votes
1answer
213 views

Sfml: Sprite scale transformation animation

Is there any way to animate a transformation on sf::Sprite like setScale or setPosition? ie: sprite.setScale(0.5f,0.5f);. I want the transition between normal and half scale be smooth. Thanks!
1
vote
1answer
671 views

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 ...
3
votes
1answer
269 views

small independent game development on a virtual machine

I've been learning about OpenGL and SFML with c++ now for about 6-8 months, and would like to work on a small little personal game to put some of my skills to the test. Now I want to kill two birds ...
3
votes
2answers
467 views

Screen effects and antialiasing

I have been working on a game for a while using glut for basic window creation. I was rendering to an offscreen buffer so that I could implement various effects like screen bulging, motion blur, ...
-4
votes
1answer
262 views

C++ SDL/SFML advancing help [closed]

I've been playing around programming using SDL and SFML for a while now and done all the basic tutorials I can find(love lazyfoo). but I'm stuck and not sure how to move on from simple games like ...
-1
votes
1answer
218 views

Drawing multiple sprites with clear screen for every frame

I googled with best of my skills, but I cannot find any relevant answer to my problem. I'm making a game with an isometric view. I need to draw multiple sprites on the screen and before switching to ...
-1
votes
1answer
364 views

I want to start making 2D Games with C++ or #C [closed]

I know C++ pretty well, I think - polymorphism, vectors, templates, and more. I also know C#. I want to program a 2D game, but not like those programs where you click a button or two, and you ...
2
votes
1answer
197 views

pytmx: issue trying to get the correct texture rectangle for sprite for objetcs on map

:D Hello :D I am currently developing a game engine. I'm using maps designed with Tiled and I placed several objects on a test map to develop the feature of loading objects as sprites/entities and ...
0
votes
2answers
687 views

How does one load TMX files into a SFML game?

How does one load .tmx files from Tiled into a SFML game?
2
votes
0answers
1k views

2D water shader in SFML

I want to implement the algorithm for a 2D water surface described here and here. Before somebody finds out, beats me up and deletes this, I'm gonna say it myself. I posted this question over at ...
4
votes
2answers
432 views

Game state management: the buck doesn't stop “here” soon enough

I realize there are already many Q&As on this site about GameState/GameScreen management, state machines, state stacks, etc. This question is meant as a follow-up: Suppose hypothetically I ...
2
votes
4answers
908 views

How can I have parent-child transform in a component system?

Before when using inheritance, I could draw all my objects using this recursive function: void Object::innerDraw(sf::RenderTarget& target, sf::RenderStates states) { states.transform *= ...
1
vote
1answer
408 views

Indoor 3D game worlds

I'm looking for a little direction. I'm building a game engine as a part of my university project, and I'm having a little trouble about what to look for when it comes to indoor 3D game worlds. Now ...
0
votes
1answer
690 views

Does SFML render it's graphics using OpenGL internally?

By that, I mean that SFML has an abstraction for OpenGL? Sort of like SDL's blit functions, but using OpenGL internally? "Yes SFML uses OpenGL for all the graphical stuff. " Received this comment ...
1
vote
1answer
445 views

OpenGL Depth Buffer/Coordinate issue with SFML

For some reason, my coordinate system in OpenGL is getting all messed up with depth. When I put something more than 1 unit away from zero (in terms of the Z coordinate), I can't see the object. ...
2
votes
1answer
448 views

SFML - Completely Unlimit Framerate

I am trying to completely unlimit the SFML framerate, so that as many frames will be displayed as possible. The reason for this is I want to loop through one section of code which calculates positions ...
0
votes
1answer
444 views

Picking a suitable resolution for a modern low-res game?

I'm working on a 2D game project right now (using SFML+OpenGL and C++) and I'm trying to figure out how to go about choosing a resolution. I want my game to have a pixel resolution that is around that ...
0
votes
1answer
203 views

How to achieve selection of a tile from a tile sheet based on an ID?

Let's say I have a tile sheet that contains 8 sprites per sheet. Each sprite is a tile of 30x30. I wrote my own custom map parser/map loader however I'm having trouble extracting a certain tile ...
3
votes
1answer
1k views

Does SFML render graphics outside the window?

While working on a tile-based map I figured it would be a good idea if I would only render what the player sees on the game window, but then it occurred to me that SFML could already be optimized ...
4
votes
1answer
5k views

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 ...
9
votes
1answer
4k views

Fast, accurate 2d collision

I'm working on a 2d topdown shooter, and now need to go beyond my basic rectangle bounding box collision system. I have large levels with many different sprites, all of which are different shapes and ...
2
votes
1answer
1k views

Can't use SFML sprite drawing and OpenGL rendering at the same time

I'm using some SFML built in functions to draw sprites and text as an overlay on top of some OpenGL rending in an SFML RenderWindow. The opengl rendering appears fine until I add the code to draw the ...
6
votes
1answer
196 views

Get SFML to report the version of OpenGL that is being used

How can I get SFML to report the version of OpenGL that is being used by the render window?
0
votes
1answer
994 views

How can you run events after a set amount of time in SFML 2.0?

I've been using SFML 1.6 for a while and recently upgraded to 2.0, apparently there's a new sf::Time type however I'm clueless as to how I can achieve running of a certain function after a set amount ...
10
votes
5answers
658 views

Do you need expensive servers and fancy hosting in order to make a multiplayer game?

I've finished working on an RPG and it would seem so much more fun to make it multiplayer. SFML has a networking feature, I figured it's possible but then again, never in my life have I even tried ...
54
votes
9answers
7k views

How can you put all images from a game to 1 file?

I've just finished a basic RPG game written in C++ SFML, I've put a lot of effort into the game and I'd want to distribute it, however I've ran into a small issue. Problem is, I have well over 200 ...
4
votes
3answers
485 views

Current library situation [closed]

Allright so I've been doing some searches, here what I got: SDL: It is a standard, very mature but very old. (I got posts of late 2009 where they were still waiting for the 1.3 to come up...we are ...
0
votes
1answer
157 views

Strange behavior for “make x face y” algorithm (with video)

I know, I know, on the internet there are a lot of tutorial on how to get the angle between the center of two objects or "make x face y". I have this code: // (180 / PI = 57.3065) float ...
2
votes
3answers
252 views

Collision organization problems

I just started playing around with c++ and some SFML. I'm going to create a 2D game with top view to test my ability and I came across a very big problem: collision detection and physics. So I see at ...
0
votes
1answer
448 views

Collision Detection Failing at faster Speed?

I am new to programming so thought I would make a Pac-Man clone to teach myself. I am doing it in C++ using SFML. Anyway, I use a bunch of collision tests. Everything works great.. but if I am going ...
6
votes
2answers
3k views

How do I load textures with SFML for OpenGL?

I'm looking at NeHe's texture mapping tutorial. It looks overly complicated for just loading a texture. Is there a way to load a texture in SFML and then use it in Open GL? I use SFML for my ...
0
votes
1answer
150 views

Open GL polygons not displaying

I have tried to follow nehe's opengl tutorial lesson 2. I use sfml for my window creation. The problem I have is that both the triangle and the quad don't show up on the screen: #include ...
0
votes
2answers
1k views

Action button: only true once per press

I'm using SFML2.0 and am trying to make a wrapper class for my controller/joystick. I read all the input data from my controller and send it off to my controllable object. I want to have two types of ...
-1
votes
1answer
562 views

How to fix OpenGL Co-ordinate System in SFML?

My OpenGL setup is somehow configured to work like so: (-1, 1) (0, 1) (1, 1) (-1, 0) (0, 0) (1, 0) (-1, -1) (0, -1) (1, -1) How do I configure it so that it works like so: (0, 0) (SW/2, 0) (SW, 0) ...
0
votes
1answer
266 views

Animating isometric sprites

I'm having trouble coming up with a way to animate these 2D isometric sprites. The sprites are stored like this: (Game Folder Root)/Assets/Sprites/(Sprite Name)/(Sprite Animation)/(Sprite ...
0
votes
1answer
373 views

Creating movement path displays in a top-down 2d RTS

My game is a top-down 2d RTS coded in C# using SFML's libraries. I want that during unit selection, a unit will display it's movement path on the map. Currently, after the path is computed as a list ...
1
vote
1answer
520 views

How do I get the coordinates of a rotated shape in SFML? [closed]

I am trying to get collisions of bullets working, and am using SFML. I am using code to get the position of the points of the rectangle for collisions, however I think there's a way to do this without ...
1
vote
1answer
276 views

Unit selection - logic & screen communication

I'm building a game using SFML, with disconnected logic & screen systems that run on different threads and communicate through synchronised buffers. Now, this system worked perfectly well when I ...
1
vote
0answers
275 views

Keeping crosshairs & GUI onscreen - SFML

I read this question, but didn't understand the implementation suggestions with SFML on C#. For example, right now I'm just trying to make sure that the mouse crosshairs stay onscreen constantly. I ...