Questions tagged [sdl]

Simple DirectMedia Layer (SDL) is a cross-platform, free and open source multimedia library. Should not be confused with Security Development Lifecycle.

Simple DirectMedia Layer (SDL) is a cross-platform, free and open source multimedia library written in C that presents a simple interface to various platforms' graphics, sound, and input devices.

From SDL's home page:

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.

SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. Support for other platforms may be found in the source code.

SDL is written in C, works natively with C++, and there are bindings available for several other languages, including C# and Python.

SDL 2.0 is distributed under the zlib license. This license allows you to use SDL freely in any software.

4893 questions
1
vote
1 answer

Freeze while downloading with libcurl C/C++

I'm working on software which downloads a file and shows transfer speed via an SDL window. My problem is that when I launch a download, the window is immediately identified by windows as a crashed program. As soon as the download is completed,…
Taiki
  • 629
  • 5
  • 13
1
vote
1 answer

hardware buffering using SDL, question about how it works

I'm deciding to do my first game, its going to be simple but I want to use c++ and I chose SDL for my learning. So my question is about how the "buffers" are handled when writing code. I'll post my related code at the bottom. Ok, so basically the…
Ben Adamson
  • 129
  • 1
  • 2
  • 10
1
vote
1 answer

GCC SDL + GLEW linking errors

I have a static library in which I'm calling OpenGL extension functions via GLEW. As the project is being built in GCC (NetBeans 7.0), and GLEW's binaries are only shipped in Visual-C flavor, I have built GLEW (1.7.0) as a static library, with GCC.…
zyndor
  • 1,418
  • 3
  • 20
  • 36
1
vote
1 answer

Read pixels from SDL_Surface and Convert to color values

I don't really know what's wrong (mainly because I don't know what the line that gives me an error does). I don't think I have to show you that much code. What I'm doing is that I'm trying to get the RGBA values of a pixel to see how great the Alpha…
Orujimaru
  • 835
  • 2
  • 13
  • 18
1
vote
1 answer

Qt and SDL together under Windows

I read this advice: How do I use Qt and SDL together? and now I have question connected to it. This example was created for Linux, but how use it under Windows? winId() under Windows return WinAPI Handler for widgets, other then Linux. Is there any…
zwierzak
  • 269
  • 1
  • 4
  • 12
1
vote
0 answers

GL3W causes errors in texture loading

When I use GL3W, I cannot load textures. They appear blank or messed up. I wanted an OpenGL 4.2 context in SDL 1.3 and so I decided to use GL3W, as GLEW used deprecated functions. Everything seems to work fine, however, when I try to load a texture,…
Merigrim
  • 846
  • 10
  • 18
1
vote
2 answers

Rendering alpha transparency in geometry and figuring out alpha color in bitmap - OpenGL

This is a two part question. I am rendering some BSP geometry and some of the textures have an alpha color which should be invisible. So the first step would be figuring out the alpha color so I can correctly render it. I uploaded a sample…
Satchmo Brown
  • 1,409
  • 2
  • 20
  • 47
1
vote
2 answers

ffmpeg playback on android

I managed to compile ffmpeg libs for Android and i am able to load them in my jni Android app. Now started calling the ffmpeg functions and following the online tutorials. I read there that I need also SDL port for Android in order to render…
Sasha Nikolic
  • 760
  • 1
  • 8
  • 22
1
vote
1 answer

Checkers game in SDL

i'm trying to make a checkers game and atm i'm doing the interface with SDL, but i'm just learning C and SDL, how can I move a surface I added to the screen ? I want it the simplest as possible, just remove from X and show on Y, how do I remove a…
1
vote
1 answer

BPP color changes SDL

Every time I run my application the colors change, the display is as below Display = SDL_SetVideoMode(WIDTH, HEIGHT, 16, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_ASYNCBLIT) and then I do SDL_FillRect(Display, &Woutput, colors[1]); colors var…
Elgoog
  • 2,205
  • 7
  • 36
  • 48
1
vote
1 answer

Check if surface has been freed before SDL_FreeSurface

When using SDL_Surfaces to handle images, I run into the problem that running SDL_FreeSurface(SDL_Surface *) (doc) twice on the same pointer yields a segmentation fault. I understand why that happens, but I need to know how I can avoid that. I'd…
Malabarba
  • 4,473
  • 2
  • 30
  • 49
1
vote
1 answer

How can I make my mouse control the camera like a FPS using OpenGL/SDL?

I've created this basic 3D Demo using OpenGL/SDL. I handled the keyboard callback so I can "strafe" left and right using 'a' and 's' and move forward and backward using 's' and 'w'. However, I would like to now make it so I can control the…
KingNestor
  • 65,976
  • 51
  • 121
  • 152
1
vote
4 answers

rendering SDL_TTF text onto openGL Red Square instead of text

I've been attempting to render text onto an openGL window using SDL and the SDL_TTF library on windows XP, VS2010. Versions: SDL version 1.2.14 SDL TTF devel 1.2.10 openGL (version is at least 2-3 years old). I have successfully created an openGL…
Serdalis
  • 10,296
  • 2
  • 38
  • 58
1
vote
2 answers

SDL C++ ttf linker errors

I'm using CodeBlocks and trying to link SDL_ttf when compiling my program. I have followed thus instructions: Add "-lSDL_ttf" in the linker command line Put SDL_ttf.dll in library directory Put SDL_ttf.h in include file directory And I have this…
user969416
1
vote
2 answers

SDL_GetTicks()-based movement?

I'm writing a game of pong in OpenGL and SDL. I have a small knowledge of how SDL_GetTicks() works but I am struggling to think of a way to implement how to make my ball move for example every 1000 milliseconds being the novice I am. Short…
user969416