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

SDL/C++ OpenGL Program, how do I stop SDL from catching SIGINT

I am using SDL for an OpenGL application, running on Linux. My problem is that SDL is catching SIGINT and ignoring it. This is a pain because I am developing through a screen session, and I can't kill the running program with CTRL-C (the program the…
MichaelM
  • 5,518
  • 2
  • 30
  • 23
10
votes
1 answer

How do I reference a system library used by an external dependency if copts doesn't allow system paths?

For Bazel, I'm pulling in an external library from within my WORKSPACE: new_http_archive( name = "imgui", build_file = "deps/BUILD.imgui", sha256 = "c457fdc19b4e3aa74deccf6a2d9bc51f0d470b3acd9cc095bf04df16459d6474", …
Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271
10
votes
2 answers

lisp as a shebang script vs lisp running in SLIME

I just started with common-lisp, having come from C++ and Python. I'm trying to run a simple SDL program that does nothing other than show an image on-screen. I can get it working from within SLIME. The problem is, it won't work when run from the…
SuperElectric
  • 17,548
  • 10
  • 52
  • 69
10
votes
1 answer

SDL vs GLUT in opengl 3D programming

I'm beginning a series of tutorials on SDL. Before I dig too far, I'd like to know what type of control SDL gives me over GLUT? Also, do either support webcam access (for face tracking or motion detection), or is that best managed through OpenCV?
BinRoot
  • 694
  • 2
  • 8
  • 21
10
votes
1 answer

iOS multiple video display

I'm currently doing an iOS project that uses IJKPlayer which is based on FFmpeg and SDL to display RTSP feed from a certain source. I have no problem in displaying a single video feed but my project requires me to display multiple stream on the…
Lysdexia
  • 453
  • 8
  • 22
10
votes
3 answers

SDL2 How to position a window on a second monitor?

I am using SDL_SetWindowPosition to position my window. Can I use this function to position my window on another monitor? UPDATE Using SDL_GetDisplayBounds will not return the correct monitor positions when the text size is changed in Windows 10.…
Z0q
  • 1,689
  • 3
  • 28
  • 57
10
votes
2 answers

Drawing an antialiased circle as described by Xaolin Wu

I'm tyring to implement the “Fast Anti-Aliased Circle Generator” routine that was described by Xiaolin Wu in his paper “An Efficient Antialiasing Technique” from Siggraph '91. This is the code that I wrote using Python 3 and PySDL2: def…
ChristopherC
  • 1,635
  • 16
  • 31
10
votes
4 answers

Inputs in SDL (on key pressed)

I would like to know how can I detect the press of a key or release of a key in a while loop in SDL. Now, I know you can get the events with SDL like OnKeyPressed, OnKeyReleased, OnKeyHit, etc, but I want to know how to build functions like…
deluvas
  • 343
  • 1
  • 5
  • 15
10
votes
5 answers

Haskell or Ocaml with OpenGL and SDL precompiled distribution for Windows

I want to learn Ocaml or Haskell and I want to do it by writing a simple game. Apparently, there's one small problem: nobody cares about Windows and I want to do it on Windows, natively. Haskell has Cabal, which has SDL, but it doesn't build due to…
Baczek
  • 1,179
  • 1
  • 13
  • 23
10
votes
1 answer

error LNK2001 __imp_fprintf Visual Studio 2015 RC

I recently was forced to upgrade from Visual Studio 2015 Pre-Release to Visual Studio 2015 Release Candidate as a result of an expired license. My project was previously building fine, however, now it is not. I am getting only two link errors and…
M2tM
  • 4,415
  • 1
  • 34
  • 43
10
votes
1 answer

Using SDL2 with wxWidgets 3.0

My goal is to build a Game Boy emulator. In order to do this, I would like to embed an SDL2 surface into a wxWidgets window. I found this tutorial: http://code.technoplaza.net/wx-sdl/part1/, but my program crashes as soon as I run it. However I…
DanB91
  • 1,399
  • 1
  • 13
  • 23
10
votes
3 answers

Using SDL for a web application

I'm currently working on an SDL 2 application (C++) and I have a question. As the title suggests i'm attempting to use SDL as a web app. I wanted to know what the best way to go about this would be. I've put some research into this and the avenues…
creativeflow
  • 157
  • 3
  • 10
10
votes
2 answers

use of undeclared identifier 'glGenVertexArrays' error even after including OpenGL/gl3.h in OSX 10.8.5

I'm opening an OpenGL context using SDL in OSX 10.8.5. I've already run some tutorials that draw lines/triangles etc. I then started trying the more modern tutorials at www.open.gl I'm running into trouble with the OpenGL 3+ API. I already include…
daj
  • 6,962
  • 9
  • 45
  • 79
10
votes
2 answers

How to set a pixel in a SDL_surface?

I need to use the following function from this page. The SDL_Surface structure is defined as typedef struct SDL_Surface { Uint32 flags; /* Read-only */ SDL_PixelFormat *format; /* Read-only */ int…
noufal
  • 940
  • 3
  • 15
  • 32
10
votes
3 answers

How to compile an example SDL program written in C?

I'm getting started with SDL and C programming. I have experience with other programming languages, but linking/compiling libraries in C is new to me. I am using Mac 10.8 and have installed latest stable 2.0 using the instructions in the read me…
Andrew
  • 227,796
  • 193
  • 515
  • 708