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

Keep window active while being dragged (SDL on Win32)

At first my code set up the SDL environment, and proceeded to update the OpenGL context, without performing any SDL_Event processing whatsoever. This causes the window, as long as it was open, to appear to Windows to be unresponsive. The window…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
13
votes
5 answers

framework not found issue

Upon building my project (a simple cocoa application) in XCode 3 I get this error message: ld: framework not found SDL collect2: ld returned 1 exit status But framework exists here /Library/Frameworks/SDL.framework. How do I get the linker to find…
Oleg
  • 243
  • 1
  • 4
  • 10
13
votes
3 answers

What specifically causes EPrivilege to be raised?

I'm getting a bug report that some functionality in some music-playing code in an external DLL (SDL_Mixer, in case it helps) that my program uses is raising EPrivilege. The DLL is written in C, so I can't get useful stack trace information out of…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
13
votes
1 answer

Pygame: ImportError: libSDL_ttf-2.0.so.0: cannot open shared object file: No such file or directory

The game is running fine from source code. When I used cx_Freeze to compile the binary file on the Linux I got into error on the second machine: ~/tmp/exe.linux-x86_64-2.7 $…
navro
  • 131
  • 1
  • 1
  • 5
13
votes
4 answers

Resize SDL2 window?

Just made the jump from SDL1.2 to SDL2, been converting my code but couldn't figure out how to resize the window. Here's the code I have now: SDL_DestroyWindow(Window); Window = SDL_CreateWindow("Test", SDL_WINDOWPOS_UNDEFINED,…
TakingItCasual
  • 771
  • 1
  • 7
  • 22
13
votes
1 answer

SDL 1.3/2.0 setting up

I have been using sdl 1.2 for the past several months(On windows).I am thinking about migrating to 1.3. So I used cmake and codeblocks to create the static and dynamic libray.now I am confused how to compile the a program.I included the sdl.h…
prithul
  • 347
  • 3
  • 10
12
votes
1 answer

C++: weird error "expected initializer before extern" in library SDL_image.h

I'm currently trying to make a simple game with SDL and Box2D. Unfortunately, the code I added to make the character shoot proyectiles is so buggy I can't even begin to count the errors. To deal with this I added some code to show some debug info in…
Magnus
  • 514
  • 2
  • 7
  • 19
12
votes
1 answer

SDL_WINDOWEVENT_RESIZED vs SDL_WINDOWEVENT_SIZE_CHANGED

In SDL, what is the difference between these two window events? SDL_WINDOWEVENT_RESIZED SDL_WINDOWEVENT_SIZE_CHANGED In the wiki doc page there is this code sample: case SDL_WINDOWEVENT_RESIZED: SDL_Log("Window %d resized to %dx%d", …
tuket
  • 3,232
  • 1
  • 26
  • 41
12
votes
5 answers

Maximize SDL window

How should I tell SDL to maximize the application window? I'm creating the window with these flags: SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE.
Matěj Zábský
  • 16,909
  • 15
  • 69
  • 114
12
votes
1 answer

A Haskell Game of life crashes when launched

I'm currently trying to develop a tiny Conway's Game of Life in Haskell. I wrote a library, lifegame, that enables to manage a grid of cells and to compute its generations (see github.com/qleguennec/lifegame.git). Generations is an infinite list. So…
qleguennec
  • 544
  • 4
  • 12
12
votes
1 answer

Can cairo use SDL_Texture as a render target?

Rendering to an SDL_Surface is possible with Cairo, but my application uses SDL_Renderer and SDL_Texture to take advantage of 2D accelerated rendering. I am currently creating an SDL_Surface and copying it to a texture with…
Vortico
  • 2,610
  • 2
  • 32
  • 49
12
votes
2 answers

Unable to link to SDL2 functions using MinGW

I'm relatively new to programming and I've decided to give SDL a try, but I'm a bit stuck. I haven't been able to build the project in codeblocks and I get 'undefined reference' to all SDL functions. I've seen a lot of similar questions here, but…
user3052572
  • 121
  • 1
  • 2
  • 3
12
votes
2 answers

SDL Error Undefined symbols for architecture x86_64 "_SDL_main"

I am using C++ with the SDL Cocoa and Foundation framework on my mac os x. I get the following error Undefined symbols for architecture x86_64: "_SDL_main", referenced from: -[SDLMain applicationDidFinishLaunching:] in SDLMain.o ld:…
William Oliver
  • 1,412
  • 4
  • 24
  • 35
12
votes
7 answers

Undefined reference to 'SDL_main'

I've recently decided to try working with SDL with CodeBlocks 10.05. I started with the tutorial on http://www.sdltutorials.com/sdl-tutorial-basics and did my best to follow it. Unfortunately, I'm…
Prismriver
  • 123
  • 1
  • 1
  • 4
12
votes
4 answers

Simple sound wave generator with SDL in c++

i am having problems understanding how the audio part of the sdl library works now, i know that when you initialize it, you have to specify the frequency and a >>callback<< function, which i think is then called automatically at the given…
Vlad Popescu
  • 141
  • 1
  • 1
  • 5