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
24
votes
5 answers

How to draw circles, arcs and vector graphics in SDL?

I'm using SDL2. The only way I can find to draw a shape is with the line, rect and pixel functions, as explained here. Apart from using trig or the "equation of a circle", how could I draw a curve? How about general vector graphics? Is SDL an…
effbiae
  • 1,087
  • 1
  • 7
  • 22
23
votes
2 answers

How to run ffplay as a window-less process?

I am running ffplay as a background process which supplies image data to my main UI process. I have set "SDL_VIDEODRIVER = dummy" to suppress the ffplay video being shown in a SDL window. The issue is that the ffplay process still appears as an…
S B
  • 8,134
  • 10
  • 54
  • 108
22
votes
2 answers

How mature is SDL for iPhone?

For a while I've been thinking of trying to do a port of one of my favorite classic PC games, The Ur-Quan Masters (aka Star Control 2) to the iPhone. UQM uses SDL for all its graphics, sound, input and other gamey stuff and there does seem to be a…
Mike Akers
  • 12,039
  • 14
  • 58
  • 71
22
votes
4 answers

What is a Blit in SDL?

In the SDL wiki it says Use this function to perform a fast blit from the source surface to the destination surface. However that doesn't help me much. What does the term surface blitting mean in this context?
Marks
  • 221
  • 1
  • 2
  • 3
21
votes
2 answers

How do I suppress '-arch', 'x86_64' flags when compiling an OpenGL/SDL application with Waf on OSX?

I need to suppress "-arch x86_64 -arch i386" flags Waf is passing to GCC. I am building an SDL/Opengl application. If I link against 32 bit SDL runtime I get error Undefined symbols for architecture i386: "_SDL_Quit", referenced from: …
HaltingState
  • 1,810
  • 1
  • 20
  • 22
21
votes
4 answers

OpenGL Low-Level 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: Use GL face culling (the OpenGL function, not the…
hiddensunset4
  • 5,825
  • 3
  • 39
  • 61
21
votes
11 answers

Is there an acceptable limit for memory leaks?

I've just started experimenting with SDL in C++, and I thought checking for memory leaks regularly may be a good habit to form early on. With this in mind, I've been running my 'Hello world' programs through Valgrind to catch any leaks, and…
Jim
  • 1,091
  • 1
  • 9
  • 11
21
votes
3 answers

How to disable key repeat in SDL2?

There used to be a function named SDL_EnableKeyRepeat() in SDL, but not anymore in SDL2. I searched around in SDL2-wiki but failed to locate anything relevant. Any ideas?
Diaz
  • 957
  • 2
  • 13
  • 22
21
votes
2 answers

SDL 2.0: Create window in main thread, but do all rendering in separate one

This is my current setup: I'm doing OpenGL rendering using SDL (currently on Linux). I initialize SDL (SDL_Init) and create the application window (SDL_CreateWindow) in the main thread and pass it to a second thread. This second thread creates an…
Ancurio
  • 1,698
  • 1
  • 17
  • 32
21
votes
1 answer

Static-linking of SDL2 libraries

I am using Windows 7, Code::Blocks and MinGW. I have little to no experience when it comes to compiling/building anything, especially when Code::Blocks doesn't use makefiles. I downloaded SDL2-devel-2.0.0-mingw.tar.gz (SDL Development Libraries)…
DispEd
  • 219
  • 1
  • 2
  • 5
21
votes
2 answers

Forcing Machine to Use Dedicated Graphics Card?

I am part of a team developing an application using C++ with SDL and OpenGL. On laptops when the application is ran the dedicated graphics card is not used and the GL context fails to create because the integrated graphics card does not support the…
Connor Hollis
  • 1,115
  • 1
  • 7
  • 13
20
votes
13 answers

How to output to the console in C++/Windows

When using iostream in C++ on Linux, it displays the program output in the terminal, but in Windows, it just saves the output to a stdout.txt file. How can I, in Windows, make the output appear in the console?
Xunil
  • 295
  • 2
  • 4
  • 11
20
votes
1 answer

SDL2: Fast Pixel Manipulation

I want to draw pixels on the monitor which change frequently after certain parameters. E.G. if a Red and Green Pixel collide, they would both vanish, etc. In every frame I have to manipulate about 100 - 1000 pixels. I have a multi-threaded approach…
Nidhoegger
  • 4,973
  • 4
  • 36
  • 81
20
votes
3 answers

Best way to rotate an image using SDL?

I am building a game and the main character's arm will be following the mouse cursor, so it will be rotating quite frequently. What would be the best way to rotate it?
Justen
  • 4,859
  • 9
  • 44
  • 68
19
votes
2 answers

_Block_Type_Is_Valid (pHead->nBlockUse) Error

I been working in a new project but I encounter with a problem which I can't see why fail. When I perfom this line delete textY give me the error _Block_Type_Is_Valid (pHead->nBlockUse). So what am I doing wrong? This is the source code: Text.h …
oscar.rpr
  • 678
  • 1
  • 6
  • 23