SDL - Simple DirectMedia Layer 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. It is used by MPEG playback software, emulators, and many popular games, including the award winning Linux ...

learn more… | top users | synonyms

4
votes
1answer
52 views

Sprite cache and Directory reader

I have been fiddling around with creating my own Sprite Cache. Currently, I am using the C header file, dirent.h, to open up a directory and load all .bmp files. I ...
1
vote
0answers
19 views

SDL - Swept AABB Collision in Pong [closed]

I've been trying to create a formula for swept AABB with Pong, but I'm not sure what I'm doing wrong. Right now, I'll bounce only when it looks like it's going to collide, but before it's supposed to. ...
2
votes
1answer
55 views

Keyboard input class

I am looking for advice on my input component. There is no real problem with it yet, but I am just getting started on everything and want to know if there is any obvious problems with it, plus I was ...
4
votes
2answers
81 views

SDL Input Managment

I've created an SDL input manager for my 3D OpenGL applications. It's not finished yet, but I would like to know if I'm doing it the right way. I really tried to optimise and compact my code, as it ...
3
votes
3answers
106 views

C++ Keyboard Controller

I've written a Controller for the keyboard so that I can map certain keys to callbacks within a game. A key can only call one callback, but a callback can be called by many keys. Currently, a ...
2
votes
1answer
113 views

Texture managing with smart pointers

I have an SDL_Wrapper which is working perfectly (it is not broken)! Please suggest how I could improve performance, and how I could make my ...
2
votes
2answers
168 views

Creating an optimized, fully functional TextureManager in SDL

After I've discussed pointer semantics with Loki Astari previously, I finally managed to code the TextureManager class using auto_pointers. But the problem is that ...
2
votes
2answers
159 views

Using std::vectors to store textures

I need to write a TextureManager class which stores Texture objects; the problem is I'm using an ...
1
vote
2answers
96 views

C++ Disposing Textures

Recently, I've asked in a code review if my code was causing any pointer related issues. They mentioned that I had problems with my dispose method. Basically, I'm disposing textures from a texture ...
5
votes
4answers
487 views

Texture managing

I'm new to C++ and SDL, and I've written a Texture manager class whose purpose is to help me manage sprites and other textures. I have a ...
4
votes
1answer
114 views

Flexible generic event system that binds to objects

I have been trying to create an event queue system using SDL. I've been trying to use this for Pong. The game is not even finished yet, but I stopped work to examine how my event system is organized. ...
5
votes
2answers
92 views

Tile rendering/position updating performance

The code below grabs the contents of a .txt file, and scans each character of it, using that data to create a tile set. My main concern, is that for each loop, I am opening and closing a file each ...
2
votes
3answers
156 views

Pong game with AI

I have written a pong game in C++ using SDL2.0 for the graphics. I have a couple of questions regarding this code: How can I make the AI better, in such a way that it is actually dumber? Right now, ...
11
votes
2answers
513 views

Simon Says / Four tiles game, with C++ and SDL

My take on the Prebash Challenge, "Simon Says" game, in less than 300 lines of C++ (plus the header file), using SDL for window management and drawing. simon_says.hpp: ...
5
votes
1answer
372 views

Collision-detection for an SDL game

I am working on a simple SDL game in C++. I want to make my collision detection implementation better. Here's the complete project: ...
6
votes
2answers
120 views

Diagonal gradient optimization

With the SDL library, I'm creating an SDL_Surface* at w and h dimensions. ...
6
votes
3answers
524 views

SDL/C++ Pong clone

This is my first time writing a game in C++/SDL and I decided to post the code here so you can tell me what I am doing wrong. main.cpp ...
6
votes
2answers
2k views

Pong game written in C++ and using SDL 2.0 (part 2)

I have previously asked here for a review of my Pong game. Since then I have implemented most of the recommendations but I'm not sure I did so correctly, the result can be found on my github. Would ...
18
votes
4answers
11k views

Pong game using SDL 2.0

I've just finished writing my first game: a clone of the classic Pong game for Linux and Mac only. You will need SDL 2.0, SDL_ttf 2.0 and SDL_Mixer 2.0 to compile it. The complete project can be found ...
6
votes
1answer
144 views

Using ID's with a “scope” -like hierarchy

I currently have a ResourceManager class which is responsible for searching for resources with a given identifier, returning a reference counted pointer to the ...
2
votes
0answers
343 views

SDL boilerplate

The SDL code example on the SDL_Init page seems to be overly verbose, creating an exception class entirely for SDL_Init. I ...
3
votes
1answer
785 views

Colors changing in SDL program

I have black and white SDL_Surface and I'm trying to change colors, such as from black to white and from white to red. I did it, but it is taking too long to work. ...