Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
11
votes
3answers
6k views
What animation technique is used in 'Dont Starve'? [closed]
While playing a few games in my personal time off development I've stumbled across a survival 2D/3D survival game. The game was apparently made in SDL and GLUT (Dont starve) but what really amazed me ...
7
votes
1answer
8k views
Time based movement Vs Frame rate based movement?
I'm new to Game programmming and SDL, and I have been following Lazyfoo's SDL tutorials. My question is related to time based motion and frame rate based motion, basically which is better or ...
2
votes
2answers
2k views
SDL Bullet Movement
I'm currently working on my first space shooter, and I'm in the process of making my ship shoot some bullets/lasers. Unfortunately, I'm having a hard time getting the bullets to fly vertically. I'm a ...
6
votes
4answers
3k views
2D Platformer Collision Handling
I am trying to create a 2D platformer (Mario-type) game and I am some having some issues with handling collisions properly. I am writing this game in C++, using SDL for input, image loading, font ...
4
votes
2answers
2k views
SDL2 sprite batching and texture atlases
I have been programming a 2D game in C++, using the SDL2 graphics API for rendering. My game concept currently features effects that could result in even tens of thousands of sprites being drawn ...
4
votes
2answers
2k views
How to hide assets from user? ( e.g.: a png file )
I think the title is quite self-explaining, still this is a big area I think, so let me drop a few words:
I've got a simple experiment game project going, and I want to make sure, that the user isn't ...
2
votes
1answer
529 views
2D Circular View/Background Wrapping SDL for Game
In the games such as Defender (1980 arcade) and Defcon, the player can move/scroll in one direction infinitely because the level/terrain simply wraps over and over again(like if it was wrapped around ...
1
vote
3answers
3k views
How can I implement a main menu?
I have been following the tutorials at http://lazyfoo.net/tutorials/SDL/index.php and although they are all very well written and I have learned more than I would have on my own, I am not sure how to ...
2
votes
1answer
406 views
When should I use color keying vs PNG transparency?
SDL (and other toolkits) can use color keying to make a certain color in an image transparent. Alternatively, you could load a PNG image that supports transparency.
When should I use which?
11
votes
2answers
6k views
Input management techniques in large games
Is there a standard technique for managing input in large games. Currently, in my project, all input handling is done in the game loop, like so:
while(SDL_PollEvent(&event)){
...
5
votes
2answers
3k views
How should I manage level progression?
In my code, I just have a Level class right now in the main game loop that just blits a background and spawns some enemies for testing purposes...But I can't figure out how to go about implementing ...
3
votes
3answers
2k views
Question About An Implementation Of Parallax Scrolling In C++/SDL/OpenGL
I been working in a project with a team for a Software Engineering class and we think that using the parallax scrolling will help our game to look really nice but we are not really sure if our idea ...
4
votes
3answers
559 views
SDL Multiple keyboard support
I am making a game with multiplayer split screen mode using SDL. Basically, I like the idea of having each player plug in his own keyboard to the PC, set custom controls via options and being able to ...
2
votes
0answers
234 views
Ruby/SDL vs. RUDL [closed]
I'm interested in using Ruby for 2D games. I have to pick between Ruby/SDL and RUDL, both of which are Ruby SDL wrappers.
Which is better? Better means "less bugs" and "more usable," although the ...
1
vote
2answers
6k views
How to implement SDL Button/Menu GUI with callbacks?
I have been reading Bjarne Stroustrup's Programming Principles and Practice Using C++ for a while now and am nearing the end of the book. I have to tried to make a very simple game using the SDL ...
1
vote
5answers
1k views
OpenGL Performance Questions
This subject, as with any optimisation problem, gets hit on a lot, but I just couldn't find what I (think) I want.
A lot of tutorials, and even SO questions have similar tips; generally covering:
...
7
votes
1answer
3k views
SDL2 with OpenGL — weird results, what's wrong?
I'm porting an app to iOS, and therefore need to upgrade it to SDL2 from SDL1.2 (so far I'm testing it as an on OS X desktop app only). However, when running the code with SDL2, I'm getting weird ...
3
votes
1answer
276 views
How can I optimize per-pixel drawing in SDL?
I've been messing around with C++ the last few days and I'm trying to figure out how to draw the screen pixel by pixel each frame.
It sounded simple enough at first, but then I realized for loops ...
3
votes
2answers
317 views
Defining and selecting an area from an image
I want to create a game, where the world is loaded from an image file, much like Paradox Interactive does it for their games. If I have this image:
Then the red, green, blue, cyan, magenta, white, ...
1
vote
1answer
93 views
Where can I get correct pitch parameter for SDL_RenderReadPixels function in SDL2?
I have a texture created with SDL_TEXTUREACCESS_TARGET access and I want to get all it's pixels with SDL_RenderReadPixels() function. One of the function parameters is pitch and I don't really know ...
1
vote
1answer
748 views
SDL render to a texture
I am trying to create a button for my game there are lots of similar buttons so using an image for each one is a bit inefficient. So I want to load an image then copy some text over it and render that ...
1
vote
4answers
2k views
SDL zooming/upscaling without images becoming blurry?
I'm working on a game with 32px tiles and I have one question regarding this and scaling. When I try to see my game fullscreen my image just becomes blurry. I remember playing NES games and when the ...
1
vote
1answer
200 views
Sound upsample using SDL
We have managed to play audio files using SDL's Mix_PlayMusic function. The problem now we need to do some upsampling for one audio to match the other so that both have same duration. Any idea how to ...
1
vote
1answer
518 views
SDL_Image and typical SDL BMP loading fails completely
been messing with OpenGL and SDL for a pair of weeks.
The thing is quite weird. I have been loading a texture from a BMP and using a really easy shader to make it work, and so far it has worked very ...
0
votes
1answer
87 views
Which buffering process would be more efficient?
I'm working on the base engine of my game right now, specifically converting a text file into a level on-screen. As a 2D platformer, each level has an array of rectangles that can be drawn to the ...
0
votes
1answer
2k views
OpenGL + SDL Linking Problem [closed]
So I'm trying to write a simple application with SDL 1.2 and OpenGL. This a stripped down version of the code containing the one problem I'm having.
//The headers
#include "SDL.h"
#include ...