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

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
834 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 ...
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 ...
9
votes
1answer
752 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
96 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 ...
2
votes
2answers
233 views

Problem with SDL_Mixer/MikMod playing XM files properly

Some of the music I've made for my game have note bends in them (1xx Portamento up)...The problem is that when they play in my game, the note bends and then goes right back to original note instead of ...
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 ...
2
votes
1answer
588 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 ...
3
votes
1answer
752 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
758 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
2answers
431 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
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 ...
3
votes
4answers
5k views

How can I process continuously-held keys with SDL?

I have created a cube in opengl using SDL. Now I am trying to move the camera in X direction if user presses left or right arrow keys and Y direction if user presses up or down arrow keys. Right now ...
0
votes
2answers
631 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
740 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..) ...
1
vote
3answers
958 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 ...
5
votes
2answers
1k views

Integrate LibRocket With SDL And OpenGL

I been currently involved in a game project and we reach the point we're want to added the GUI for menus and other stuff but the time that we maybe spent developing our own system could cost us a bit ...
2
votes
1answer
716 views

Question About Scrolling A Tilemap In C++/SDL/OpenGL

I been working with scrolling this week but I recently encounter a problem that I don't understand why it's happening. In a 2D scroller I want to scroll a tilemap pixel per pixel which gives a smooth ...
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 ...
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
votes
1answer
2k views

What is the best engine for my first serious 2d game? [closed]

What game engine/graphics engine should I use for my first indie game? I'd like to add that this is not my first game, I've previously used Allegro for 2d development (pong, chess and stuff). I am ...
20
votes
3answers
1k views

Multi-platform multi-threading: What are the real challenges?

While a library like SDL provides a cross-platform wrapper API for threading, I think it would be naive to assume that this leads directly to easy development of games across vastly different ...
4
votes
1answer
2k views

Setting up OpenGL 3.3 in SDL 1.2

I've been using SDL 1.2.14 for awhile without using many of the features from newer OpenGL versions. I'm now interested working only with the 3.3 API (not using the deprecated functions, etc... that's ...
2
votes
1answer
1k views

SDL (or OpenGL), HTML5, Gecko and vector movies

I'm writing a platform game which uses SDL for the main graphics code. There is a chance that I may be using OpenGL for the rendering at a later stage, so answers could relate to either. I'm needing ...
-8
votes
1answer
1k views

Alternative to C# and XNA? [closed]

I'm interested in Game Development, I know OOP programming and so, but I never used a Stable Language. My favourite language is Java, but people say that is not a good Game Language, since it can be ...
8
votes
1answer
1k views

Separating logic/update from render/drawing code in a single thread using sleep

I've read that the speed of game objects should not be hindered by FPS but instead should be based on time. How can I seperate the update/draw code to maximize performance without limiting the drawing ...
5
votes
4answers
10k views

Wavefront *.obj loader in C++

I'm creating a game using OpenGL (via SDL) and C++ (via Visual Studios 2010 Professional). During the game, I will be using 3D character animation. I'd like to use wavefront *.obj files for all the 3D ...
2
votes
2answers
201 views

Working towards going 3D

I am a beginner-intermediate C++/Java programmer and my long term goal is to be a game programmer. I have decided to start off with 2D and work my way towards 3D. I would like to use SDL to start ...
5
votes
2answers
821 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 ...
1
vote
5answers
4k views

OpenGL Insanely Slow [closed]

I'm learning C++, and I'm writing my first OpenGL program. Unfortunately, it seems to be defaulting to Software Rendering (CPU uses bounces, GPU uses stays at 1%). I'm using SDL as the Windowing ...
8
votes
1answer
1k views

Getting OpenGL hardware acceleration with SDL on Linux

I'm trying to use SDL + OpenGL but I don't believe hardware acceleration is working because the framerate for around 18000 polys is about 24fps on a quad core machine but is a hopeless 1-2fps on an ...
6
votes
2answers
21k views

Making a 2D Platformer in C++/SDL. Looking for tutorials/examples/resources

I have a lot of experience with C++, but I have no experience with game programming. This summer I plan to create a 2D platformer from scratch using C++/SDL for the learning experience. I am looking ...
7
votes
5answers
581 views

Graphics module: Am I going the right way?

I'm trying to write the graphics module of my engine. That is, this part of the code only provides an interface through which to load images, fonts, etc and draw them on the screen. It is also a ...
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 ...
2
votes
2answers
875 views

Collision Resolution

Hey all, I'm making a simple side-scrolling game, and I would appreciate some input! My collision detection system is a simple bounding box detection, so it's really easy to implement. However my ...
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: ...
8
votes
2answers
962 views

How to deal with OpenGL and Fullscreen on OS X

I do most of my development on OS X and for my current game project this is my target environment. However when I play games I play on Windows. As a windows gamer I am used to Alt+Tab switching from ...
6
votes
4answers
2k 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 ...
1
vote
1answer
1k views

My first animation - Using SDL.NET C#

I'm trying to animate a player object in my 2D grid when the user clicks somewhere in the screen. I got the following 4 variables: oX (Current player position X) oY (Current player position Y) dX ...
7
votes
3answers
905 views

What is the contents of the buffer *after* a call to glSwapBuffers()?

(SDL_GL_SwapBuffers() in particular) When you have drawn a scene, and you call swap-buffers, it is routine to then glClear() the scene before drawing anything; if you don't clear, what is the ...
7
votes
1answer
6k 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
1answer
481 views

Colour Problems When Using SDL_Resize()

In a 3D SDL application I inherited (I have little 3D or SDL experience), I have a 'screenshot' routine that either saves a full-size image or a scaled image, depending on the context (differing ...
3
votes
1answer
568 views

How to create a simple “spot light” effect with Sdl or Sdl.Net?

i'm wondering: how to create a simple "car headlight" (for i.e) or a torch spotlight in Sdl or Sdl.NET ? Does anyone know how ? Thanks