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

0
votes
2answers
194 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 ...
1
vote
1answer
331 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 ...
4
votes
1answer
1k views

Game class and main function

I have a Game class with my main game functions and instances of game objects like screen, etc. My game is made using C++ and SDL. I was wondering, though, should main be a function of my class? Or ...
1
vote
2answers
931 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
1k 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
786 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
2answers
1k 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 ...
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
356 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 ...
3
votes
2answers
276 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, ...
2
votes
1answer
1k 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 ...
0
votes
1answer
1k 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
998 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
892 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
815 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
98 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
261 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
646 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
806 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
831 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
472 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
6k 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
684 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
896 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
1k 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
2k 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
750 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
3k 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
2k 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 ...
6
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
903 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
22k 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
591 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 ...
4
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
897 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: ...