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

linker error after compiling

Im having a problem with the linker i guess This is what i get on the output tab: 1>main-light.obj : error LNK2019: unresolved external symbol _SDL_FreeSurface referenced in function "private: unsigned int __thiscall objloader::loadTexture(char…
1
vote
2 answers

Linker Error (SDL, OpenGL)

I'm getting this error when trying to compile: *1>main-light.obj : error LNK2019: unresolved external symbol _SDL_FreeSurface referenced in function "private: unsigned int __thiscall objloader::loadTexture(char const *)"…
1
vote
1 answer

What must be done after the OpenGL context is lost?

What is a good way to think about this? Are handles lost? glCreateProgram()? glCreateShader()? glGenTextures()? glGenBuffers()? Im wondering if I am doing what's necessary (or doing too much and leaking memory)
aCuria
  • 6,935
  • 14
  • 53
  • 89
1
vote
1 answer

CMake, SDL on Mac OS X, "can't find -lSDLmain"

Following the instructions here, I've set up a CMakeLists.txt: Find_Package (SDL REQUIRED) Find_Package (SDL_image REQUIRED) link_libraries ( ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} SDLmain ) When running cmake, I get the following…
simont
  • 68,704
  • 18
  • 117
  • 136
1
vote
0 answers

How to rewrite NEW and DELETE for memory management using SDL, OpenGL together?

I´m using SDL and OpenGL together. I would like to create my own memory manager, just to rewrite the NEW and DELETE commands to add my memory reservation counter and memory reserved counter to keep more information about what´s going on with my…
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
1
vote
2 answers

Converting transparent pngs Crashes SDL/OpenGL

If I try to convert a transparent .png SDL_Surface to a OpenGL texture, then the moment the program tries to access any data from the SDL_Surface, it crashes. I observed other people's code involving transparent pngs, but they are the same and don't…
Ripspace
  • 551
  • 6
  • 21
1
vote
1 answer

SDL2 Event Loop on Android - cannot push any new events into the queue

I am trying to use SDL2 in my new Android application, it should work well: http://wilbefast.com/2011/11/11/recent-sdl-android-goodies/ It compiles without a single problem and there is a sample project so it is quite easy to start using it. I…
vitakot
  • 3,786
  • 4
  • 27
  • 59
1
vote
1 answer

Why can't my application receive UDP packets when the Windows Base Filtering Engine service is enabled?

Before starting, I just want to say that this situation works perfectly using TCP, without any problems - the issue is that I want to auto-detect devices on my network however, so I still need UDP to broadcast and detect devices over my network. I…
Breakthrough
  • 2,444
  • 2
  • 23
  • 37
1
vote
2 answers

Collision Detection and maintaining momentum on an object

I have been implementing various forms of simple collision detection with varying results. I have a fairly good working version of collision detection, but there are some odd behaviors that I can't work out. Just for a reference, i'm making a simple…
RedShft
  • 374
  • 2
  • 12
1
vote
1 answer

Cross-platform real-time MP3 recorder

I have an SDL app, that works under Linux, Mac and Windows. It's something like a media player, and can play audio just fine. I'd like to add audio recording feature to it, but I'd like to encode it in real time to MP3. Can anyone point me to an…
mav
  • 1,230
  • 1
  • 15
  • 23
1
vote
1 answer

Color key transparency does not work with SDL_image and PNG files

I am trying to achieve transparency in SDL using color keying. While it does work with BMP files, it doesn't with PNG files. Here is my code: #include #include int main(int argc, char *argv[]) { …
tajmahal
  • 1,665
  • 3
  • 16
  • 29
1
vote
1 answer

Freopen() not working in SDL

I tried using freopen() to redirect the "cout" function to the console, but it doesn't produce the desired effect. Instead of just double clicking on the executable and having the console show it's message, I need to use a command prompt or a batch…
Ripspace
  • 551
  • 6
  • 21
1
vote
3 answers

defining sdl_rect and sdl_mousebuttondown

I need to define rectangular areas on the sdl window so that when the mouse button is clicked on a particular area some action has to be performed. I used GetMouseState(x,y) to get the mouse click event. It works wherever the mouse button is…
1
vote
0 answers

Installing the SDL (Simple DirectMedia Layer) C library on the mac

How do you install the C library SDL on a mac. I would like to be able to use it with the IDE Code::Blocks. The compiler I am using is g++.
lilroo
  • 2,928
  • 7
  • 25
  • 34
1
vote
1 answer

SDL doesn't stop moving mouse when it does not have focus - SDL C++

I want my game engine to stop moving the mouse to the center (for yaw and pitch camera calculations). I wrote up some code which should have taken care of it but the mouse still moves when minimized. void mainLoop() { // This is the main logic…
Pladnius Brooks
  • 1,248
  • 3
  • 19
  • 36