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.

learn more… | top users | synonyms

4
votes
3answers
411 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 ...
1
vote
1answer
2k views

SDL & Windows 8 Metro WinRT

I am just beginning to dip my tow into game programming and have been reading up on SDL, SFML, OpenGL, XNA, MonoGame and of course DirectX. (Needless to say there are a lot of choices out there) As ...
2
votes
4answers
899 views

Should the main game object be static in c++

I am creating a 2d platformer using SDL and I was thinking that my game object could be static, but I wasn't sure if this was a good idea. The pros (that I can see): Accessing settings options ...
0
votes
1answer
295 views

C++ and SDL Trouble Creating a STL Vector of a Game Object

I am trying to create a Space Invaders clone using C++ and SDL. The problem I am having is in trying to create Waves of Enemies. I am trying to model this by making my Waves a vector of 8 Enemy ...
4
votes
5answers
697 views

Trying to make a game with C++, using lists to store bullets and enemies, but they are not erased

I've been trying to make a pretty simple space shooter game with C++, and I have been having a lot of trouble trying to use lists to store enemies and bullets. Basically I followed the post here ...
0
votes
2answers
189 views

Can I create a SDL_Surface as I do with Allegro?

Using allegro I can create a Bitmap to draw just doing: BITMAP* bmp = NULL; bmp = create_bitmap(width,height); // I don't remember exactly the parameters I'm using SDL now, and i want create an ...
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 ...
-1
votes
2answers
264 views

FreeType2 Crash on FT_Init_FreeType

I'm currently trying to learn how to use the FreeType2 library for drawing fonts with OpenGL. However, when I start the program it immediately crashes with the following error: "(Can't correctly start ...
5
votes
2answers
764 views

Splitting a tetris game apart - where to put time-management?

I am creating a tetris game in C++ & SDL, and I'm trying to do it "good" by making it object-oriented and keeping scopes small. So far I have the following structure: A main with some lowlevel ...
-3
votes
2answers
573 views

Starting Game Programming in C++, where to begin for optimal cross-platform development? [closed]

I wish to begin learning game development in C++. I have knowledge in syntax and the console using Visual C++ 2010, however I want to begin programming. My only problem is that I want to be able to ...
3
votes
2answers
257 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
2answers
390 views

SDL 1.2 reports wrong screen size

I have a multi-monitor setup with two displays, both 1920x1200. In games, I can only select resolutions > 1920x1200 (like 2560x1200) which makes games unusable. Full screen doesn't work either ...
1
vote
0answers
191 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 ...
3
votes
4answers
2k views

Most effective way to manage a gamestate system that is easy to use?

I just started working on my game, mostly the game management. I plan and using game-states to make the menu's and other stuff easier. My main idea for implementing the game-states is creating a game ...
1
vote
1answer
521 views

Is SDL too low level for a beginner?

I am getting started in game development. I started by learning SDL because it seems before I start developing big games, I have to start with the most basic stuff, like Tetris or Snake. I was ...
1
vote
4answers
457 views

How to run my game outside of visual c++

I am having trouble running my game. It works fine when I run it from Visual C++, but when I try to open the .exe, it complains that it can't find SDL.dll. What should I do in order to play the game? ...
1
vote
1answer
1k views

Displaying a grid based map using C++ and sdl

I am trying to create a roguelike game using c++ and SDL. However, I am having trouble getting it to display the map, which is represented by a 2d array of a tile class. Currently, my code is this: ...
0
votes
4answers
3k views

Problem trying to lock framerate at 60 FPS

I've written a simple class to limit the framerate of my current project. But it does not work as it should. Here is the code: void FpsCounter::Process() { deltaTime = ...
3
votes
3answers
2k views

Gamestate management without evil Singletons

I wanted to use a game state management system similiar to this approach: Managing Game States in C++ But from what I've heard singletons are evil and should not be used in 99.9%. Can you tell me ...
0
votes
1answer
573 views

SDL and software/hardware rendering. How to go about it?

I know that SDL 1.2 does software rendering (CPU) and not hardware rendering (GPU). My question is, how do I use SDL but with hardware rendering? How do I not use its rendering API (software) and ...
0
votes
1answer
745 views

SDL mouse wheel not picking up

Running Ubuntu 11.04, SDL 1.2 trying to pickup mouse wheel up/down movement with this (stripped down) code: int main( int argc, char **argv ) { SDL_MouseButtonEvent *mousebutton = NULL; ...
0
votes
2answers
828 views

C++ and SDL resource management for 2D game

My first question is about stateManagers. I do not use the singleton pattern (read many random posts with various reasons not to use it), I have gameStateManager which runs the pointer ...
2
votes
1answer
304 views

Draw Bug 2D player Camera

EDIT *Along with the Palindromes helpful response, I found that my bug was because I was calculating the camera coordinates in terms of tiles instead of pixels which caused the irregular motion.* I ...
2
votes
0answers
175 views

What is causing this behavior with the movement of Pong Ball in 2D? [closed]

//edit after running it through the debugger it turned out i had the display function set to x,x...TIL how to use a debugger I've been trying to teach myself C++ SDL with the lazyfoo tutorial and ...
2
votes
2answers
2k views

How can I create a rectangular SDL surface filled with a particular color?

I'm learning SDL. I'd like to create rectangular surface filled with a flat color (not an image). Below is my code -- it compiles fine, but doesn't work. I'm passing the function these parameters: ...
1
vote
1answer
304 views

Is SDL conducive to detailed 2D in-Game Animation and intricate particle effects?

Is SDL (when used CORRECTLY) conducive to detailed in-Game animation and displaying interesting high quality particle effects? If my question seems too vague, at the other end of this link I have an ...
1
vote
2answers
693 views

Why do I get a segmentation fault on launch with this code?

I am currently writing a pong clone in C++ with SDL on top. Currently, I have hit a roadblock. If I add a new variable, my game won't launch, and will give "segmentation fault" in the debug terminal. ...
3
votes
3answers
994 views

OpenGL & SDL textures… game shuts down

I'm going to create a game in C++ with SDL & openGL but adding textures won't work. the code is in some different classes. here's the main file ...
0
votes
5answers
635 views

Is the way I remove objects causing a memory leak?

The game I'm working on consumes memory, and the memory used in megabytes increases around 2MB every 4 seconds. It starts at 5MB and grows to hundreds of megabytes in minutes. I was careful, and ...
0
votes
1answer
2k views

SDL, SFML, OpenGL, or just move to Java [closed]

I recently started a new project, and I'm wondering if I should change the technology now before it's too late. I'm using SDL with C++, I have around 6 classes, and the game is going alright, but I ...
1
vote
1answer
349 views

Why does my 2d collision and movement not work properly?

I'm trying to write(in c++ using sdl) a mario like game as in a tile based world with by pixel movement for the character and I've run into some problems I cannot seem to find the source of: 1.The ...
2
votes
1answer
765 views

SDL and OpenGL resize window event question

So basically my question is im making a 2D game with openGL and SDL. So what im trying to do is resize the game and have the openGL quad scale to the size my window becomes. void CApp::OnResize(int ...
2
votes
1answer
552 views

Positioning a 2D image after rotation

Using SDL_gfx's rotozoomSurface function to rotate a 38x58 sprite....naturally when it rotates it creates a new surface with a new size, and the rotation isn't going around the center point. I am ...
0
votes
1answer
797 views

What's wrong my code to create a GL texture from an SDL_Surface?

I have an issue here with converting an existing SDL_Surface into an OpenGL texture. The texture gets created, but it's a plain white texture, below is a screenshot of the result: It seems to me ...
3
votes
1answer
784 views

What are the performance implications of multiple windows with indivdual OpenGL contexts?

For an engine I'm developing I've decided to allow users to set up multiple windows showing differing views of the same "world." This is being developed using OpenGL (hopefully aiming for 3.2 core ...
2
votes
1answer
1k views

C++/SDL Getting Multiple Bullets On-Screen

I've finally gotten this laser thing to work for my Space Shooter, and so far I've come across a slight problem. I've gotten the laser to position itself at the starting position correctly and move ...
0
votes
1answer
759 views

Will using OpenGL for rendering with SDL make my 2D game run smoother?

I've been working on a 2D game using SDL. I've noticed the objects look blurry and glitchy when they're moving, so I was thinking about using OpenGL to render the graphics. Would this help? What ...
9
votes
1answer
702 views

Why does V8 not run with SDL threads?

i was able to compile and link V8 against my game and code interpretation works fine. However I want to divide my code and the game loop should exist in one thread and the scripting engine should run ...
3
votes
1answer
93 views

What does `FPSManager.lastticks` stand for in SDL_gfx?

I'm having trouble finding documentation on SDL_gfx, and I can't figure this out. I've managed to use SDL_gfx to automatically cap the framerate, and I it's working a lot better than my manual attempt ...
5
votes
2answers
2k 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 ...
3
votes
1answer
721 views

Platformer collision detection problems

I'm having a few problems with collision detection in my game (written in C# with SDL.Net). Detecting the floor and roof is fine, as does detecting sides of tiles when not jumping/falling. My problem ...
0
votes
1answer
669 views

How do I install SDL.NET in Visual Studio 2010? (Or any other .NET library)

I'm trying to get SDL.NET to work in Visual Studio 2010, but am really not sure how to go about installing the library (or creating a custom project or something), and any basic instructions would be ...
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: ...
1
vote
0answers
82 views

reflection not being drawn [closed]

I am using stencil buffer to render reflections in my scene.I am using SDL and opengl and am using the Ubuntu environment.I get a value of 8 when I try to get the buffer size for stencil buffer so it ...
0
votes
2answers
604 views

What graphics library should I use for line rendering for a raycasting renderer?

I want to develop simple RPG with ray casting rendering. I chose SDL for graphics and input. The problem is there is no native line drawing in it, which I need to start prototyping a ray casting ...
5
votes
1answer
616 views

OpenGL textures loaded with SDL_Image display with no alpha

I am making a game using OpenGL, with SDL_Image employed to load the textures. When drawn on screen, there's no alpha -- in an exact square around the opaque contents of the texture, black is drawn; ...
2
votes
2answers
1k views

Problem With Smooth Animation In C++/SDL/OpenGL

I been working in the animation of a 2D platformer game in C++/SDL/OpenGL, and my team and I reach the point where we need to establish that every animation of the player (Walking, Running, etc..) ...
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 ...
1
vote
3answers
903 views

How does one make a 3D background in a 2D game?

I am trying to figure out how to make a background that looks 3D in a game that is 2D. Below there is a video of the game "Under The Lotus." I am trying to get a background with similar effect (it ...