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
9
votes
1 answer

How to rotate a rect in SDL2?

I plan on making a game, and I want to create some background animations for said game. One of these animations is a rotating rectangle. I've looked all over, and I cannot find any form of math or logic that allows me to rotate a rectangle (SDL_Rect…
CNJMC1
  • 479
  • 1
  • 5
  • 12
9
votes
2 answers

Couple of questions about SDL_Window and unique_ptr

I currently had a problem with storing a SDL_Window pointer as a std::unique_ptr. What I tried was: std::unique_ptr window_; The solution: std::unique_ptr window_; The first attempt kept throwing…
EmeraldOverflow
  • 122
  • 1
  • 9
9
votes
7 answers

pyGame within a pyGTK application

What is the best way to use PyGame (SDL) within a PyGTK application? I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events.
borrego
  • 709
  • 8
  • 7
9
votes
2 answers

SDL2, Mac OS X, and OpenGL: How to avoid including both gl.h and gl3.h?

I'm working on an SDL2 application using the OpenGL 3.2 core profile. When I compile, I get the following warning: /System/Library/Frameworks/OpenGL.framework/Headers/gl.h:5:2: warning: #warning gl.h and gl3.h are both included. Compiler will…
Karl
  • 1,143
  • 6
  • 20
9
votes
1 answer

Undefined reference to WinMain@16 when using SDL

I've been having a lot of trouble getting everything working so that I can start developing on Windows, as apposed to Linux, which is what I normally use when coding. I'm having a rather bizarre issue when trying to compile an SDL program. As soon…
Velovix
  • 527
  • 1
  • 6
  • 19
9
votes
2 answers

How to do line-breaks and line-wrapping with SDL-TTF?

I just started using SDL2_ttf. I've figured out how to get some text on the screen with TTF_RenderText_Blended, but how do can I get it to do line-breaks and automatic wrapping? It doesn't seem to support \n; it just creates a space instead of…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
9
votes
1 answer

Trying to use pkg-config but it not being a registered command

Ok so I've got my whole Go development environment up under Windows 8, also with MinGW. I'm using the LiteIde. C:/Go/bin/go.exe build [C:/Users/Alyx/Go/Hi] pkg-config --cflags sdl exec: "pkg-config": executable file not found in %PATH% Error:…
Alyx
  • 93
  • 1
  • 1
  • 3
9
votes
4 answers

I need to change compiler on VS

I have made a sudoku solver using SDL (for GUI) on VCpp 2010 IDE. The program compiles without errors and runs fine. However, i cannot pass the compiled executable on to some people because they don't have msvc dll on their pc. I thought i could…
Giwrgos Tsopanoglou
  • 1,165
  • 2
  • 8
  • 15
9
votes
2 answers

How can I install SDL_image on Ubuntu 12.04.1 LTS?

I installed the ubuntu 12.04.1 LTS. I just installed a compiler to c++ programming. It's name is Anjuta. It's a free programming software. I would like to make simple games with that one, but it shows to me: IMG_Load in-lSDL_image... no... And…
janos
  • 247
  • 2
  • 4
  • 11
9
votes
1 answer

SDL - drawing 'negative' circles (Fog of War)

I have this 800x600square I want to draw to the screen. I want to 'cut' circles in it (where alpha would be 0). Basically I'm drawing this whole rectangle over a map so in these 'circles' I drew, you can see the map, otherwise you see the grey…
will
  • 1,397
  • 5
  • 23
  • 44
9
votes
1 answer

Setting up SDL on OS X 10.8

I am not sure how am I supposed to setup SDL to work with my mac. I have OS X 10.8. I remember that some time ago on the SDL page there were development libraries for OS X, Win, and Linux. Now the OS X is missing so im guessing I have to get the…
Majster
  • 3,611
  • 5
  • 38
  • 60
9
votes
3 answers

c++ undefined reference to static variable

I have no idea why this code isn't working. All the source files compile but when I try to link them the compiler yells at me with an undefined reference error. Here's the code: main.cpp: #include "SDL/SDL.h" #include "Initilize.cpp" int main(int…
user1602079
  • 91
  • 1
  • 2
  • 5
9
votes
1 answer

Initializing SDL_Mixer gives error "No available audio device"

I am working on a C++ application which uses SDL/SDL_Mixer to play wav files. I've been developing the application on a Mac without much problem. However, I do need this application to work on Linux, so I put VirtualBox on my Windows 7 machine with…
A.P.
  • 123
  • 1
  • 6
8
votes
0 answers

Computer game in Haskell — widget toolkit wanted

I am writing a small RTS game in Haskell, and the time has come to create some GUI for it (buttons, menus and such). However, I don't have any experience in GUI toolkit creation, so I would be thankful for ideas on how to choose right data types,…
8
votes
1 answer

SDL fake fullscreen mode on dual monitor setup under linux

Using SDL 1.3 I want to create fake fullscreen SDL_Window under linux. It is easy if i have only one display. I just got current display mode and created a window. SDL_GetDesktopDisplayMode(0, &mode); SDL_Window *win = SDL_CreateWindow("my…
Frizi
  • 2,900
  • 1
  • 19
  • 25