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

learn more… | top users | synonyms

53
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 ...
12
votes
2answers
990 views

Should I be using spritesheets, because of or despite of my vast number of images?

I am developing a 2D game, and I have a lot of sprites. I used 3D animations and models to render into 2D, to give them that "Fallout" or "Diablo" look to them. It is also easier than drawing by hand, ...
11
votes
5answers
2k views

Python Performance vs Game Maker [closed]

I was originally thinking of creating a game with Python and SFML. I understand Python is slow compared to C++, but how is it compared to Game Maker? The main reason I ask is I recently played a Game ...
11
votes
4answers
574 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, ...
10
votes
5answers
640 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 ...
10
votes
4answers
2k views

Collision rectangle response

I'm having difficulties getting a moveable rectangle to collide with more than one rectangle. I'm using SFML and it has a handy function called intersects which takes 2 rectangles and returns the ...
8
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 ...
7
votes
2answers
2k views

Better animation of elements in SFML/C++

This is not about animating individual characters or elements, I'm happy with spritesheets for that. What I'm looking for is the animation of elements on screen. For example my game starts and the ...
7
votes
1answer
2k views

Is it possible to use SFML with the Android NDK?

I've started using SFML recently and I absolutely love it. I'd like to make games that could be ported to android, linux, mac and windows, but it seems that SFML lacks portability. I've searched for ...
6
votes
1answer
185 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?
5
votes
3answers
750 views

How do I create a color picker with variable hue and saturation?

I am trying to create a Color Picker similar to that of MS Paint. Unfortunately, I can't figure out the algorithm for saturation. This is what my current algorithm creates. Anytime I try to ...
5
votes
1answer
162 views

Can SFML load anything other than RGBA8888? (RGBA4444, RGB565, etc.)

I have tried searching google, and there's next to nothing on there. I tried searching the SFML forums, but still have no luck. Am I missing it in the documentation somewhere obvious? Or does SFML ...
4
votes
2answers
365 views

How would I display a unit that is hidden behind another object

Right, I've tried searching for this but as you might be able to tell from the title, I didn't really know how to word it anyway... In some games such as rts games, when a unit is hidden or half ...
4
votes
2answers
421 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 ...
4
votes
1answer
4k views

glCreateShader causes segmentation fault

I can't create a shader when trying to use shaders with sfml. The function glCreateShader(GL_VERTEX_SHADER); causes a segmentation fault. At first I googled it and found that it does that when the ...
4
votes
3answers
444 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 ...
4
votes
1answer
3k views

Loading textures with sfml for Open GL

I'm looking at nehe's texturemapping tutorial and it looks a bit 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 ...
4
votes
1answer
408 views

How could I implement my library/game to run in a browser plugin?

I usually code cross-platform, to build as native code for Mac Linux and Windows, but I clearly see the value in being able to display my game in a browser. Could you guide me in doing such a task? ...
4
votes
1answer
470 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 ...
3
votes
2answers
258 views

How can I improve my collision detection's performance?

I'm new to programming and want to speed up the collision detection in my C++ 2D platformer game engine. Currently, only the player's collision detection works: Every frame, the player's update ...
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 ...
3
votes
5answers
2k views

Does SFML support these specific features that I require?

I've been working on a game in c++ for about a week and a half, and I've been using SDL. However, my current engine only needs the following from whatever library I use: enable double buffering load ...
3
votes
1answer
236 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
1answer
4k 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 ...
3
votes
1answer
356 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 ...
3
votes
1answer
195 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!
3
votes
1answer
301 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
2answers
413 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, ...
2
votes
2answers
533 views

how to keep a GUI on-screen without moving or resizing it according to camera movement

Hey i'm trying to make a GUI lib with SFML, and everything's done except one problem: Making the Interface stay still even when the camera moves or zooms in/out. This would be easy to fix if zooming ...
2
votes
3answers
1k views

Question about “Entity System” design

I am developing a top down 'thing' in SFML and C++ and was wondering about how best to handle so called Entities in my game. An entity, for example is defined by me as an object in-game, such as a ...
2
votes
1answer
600 views

Why do I have to run my 2D game at 300+ FPS for movement to be passably smooth?

I'm working on a simple game with SFML, and the only way to make the game reasonably smooth is to allow it the highest framerate my machine can handle (that is, giving it no limit). 60 FPS in my game ...
2
votes
1answer
505 views

Improving Click and Drag with C++

I'm currently using SFML 2.0 to develop a game in C++. I have a game sprite class that has a click and drag method. The method works, but there is a slight problem. If the mouse moves too fast, the ...
2
votes
2answers
343 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 * ...
2
votes
1answer
140 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, ...
2
votes
1answer
3k views

Converting 3D coordinates to 2D and back?

I'm wondering if there is a simple way to convert 3D coordinates to 2D coordinates. Also, if it's possible, to convert in the reverse direction. I'm using OpenGL(GLUT) in my C++ project. I am also ...
2
votes
1answer
147 views

How can I make an animation using arrays?

I want to take an array of sprites, for example sf::Sprite animation[3] = { stepLeft, inMiddle, stepRight }; and construct an animation by looping them. Is this possible? How do I go about it?
2
votes
4answers
824 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 *= ...
2
votes
3answers
243 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 ...
2
votes
1answer
2k views

SFML - Moving a sprite on mouseclick

I want to be able to move a sprite from a current location to another based upon where the user clicks in the window. This is the code that I have: #include <SFML/Graphics.hpp> int main() { ...
2
votes
1answer
926 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 ...
2
votes
1answer
173 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 ...
2
votes
1answer
426 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 ...
2
votes
0answers
887 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 ...
2
votes
2answers
482 views

3D Translation using only distance and angles

So I'm starting to foray into 3D game programming, but I've hit something of a snag. I have an object I want to move around. It should always move either forward or backward relative to its local Z ...
1
vote
1answer
532 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 ...
1
vote
2answers
677 views

C++&SFML Moving Sprites Smoothly in Tiles [duplicate]

As a student, I've always wanted to become a game developer. So far I've managed to learn the basics of C++ and SFML 2.1 For my first project, upon deciding to make a 2D RPG-ish game, I encountered a ...
1
vote
1answer
130 views

SFML image extension for best performance

I am using SFML library in my 2D game. The Texture Class has a method to load an image from file: Texture.loadFromFile("image.*") Which file extension should I use to achieve best performance? ...
1
vote
1answer
121 views

Implementing collision response, current implementation does too many checks

I don't know how I should handle my collision response when collision between two entities leads to second collision with third entity. Blue arrow is velocity of the rightmost entity and numbers ...
1
vote
1answer
246 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 ...
1
vote
1answer
392 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 ...