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
0 answers

Android SDL13: Center screen (Using Android 2.3.3)

I want to use the compatibility mode. Thus every device displays at 480x320. SDL does left align the screen always. But for larger screens like tablets it really makes sense to center the screen. Currently I patched SDL_compat.c like this: #ifdef…
1
vote
0 answers

SDL_SetVideoMode in Android NDK

I'm about to port a existing game that allready uses the SDL libary to android with the NDK, but the application crashs when calling this(SDL_Init runs fine, SetVideoMode crashes): if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK |…
Revan
  • 43
  • 5
1
vote
1 answer

Cant find why SDL_ttf its not rendering

Im using codeblocks and i have install the librares already and there are no error there... When i build the project, the compiler says it has no errors and when i run it it just pops up a windows and inside its just black, and its suppose to appear…
user1129209
  • 19
  • 1
  • 6
1
vote
2 answers

How would I write a for loop to check each pixel for collision?

I'm trying to write a for loop in my enemy class to check collision with the player...What I'm trying to do specifically is have it check each pixel in every row, so it should check all in a row then go to the next row. I'm having trouble figuring…
user1122136
  • 98
  • 2
  • 8
1
vote
2 answers

SDL hangs when using SDL_SetVideoMode with SDL_OPENGL as parameter

As the title says, my application hangs while running SDL_SetVideoMode, but only when i specify that I want to use OpenGL. Otherwise it initiates without any problem. Edit: When waiting ~50 seconds, it manages to initiate. Edit 2: Driver update…
Softnux
  • 2,440
  • 4
  • 20
  • 21
1
vote
2 answers

OpenGL Rotation issue

Solution: strtod instead of atof solved it. Thanks! TODO: make this an answer for acceptance I'm loading a value from an XML file that tells how much the texture should be rotated. It looks like this: string rotv =…
Orujimaru
  • 835
  • 2
  • 13
  • 18
1
vote
1 answer

SDL Image scale

I'm using the sdl library, but it dosent support scale / resize surface, so i downloaded the SDL_image 1.2 & SDL_gfx Library. My function/code works, but the image appear in bad / low quality. Let say i got a image which is 100X100, if i scale…
John
  • 107
  • 1
  • 4
  • 11
1
vote
2 answers

Invalid dynamic table of SDL_Surface

I'm having difficulties with creating dynamic table of SDL_Surface. Take a look at that code: SDL_Surface **testA = new SDL_Surface *[2]; for(int i=0;i<2;i++) testA[i] = new SDL_Surface; SDL_Surface* testB[2]; As far as i'm concerned, TestA and…
Greg Witczak
  • 1,634
  • 4
  • 27
  • 56
1
vote
4 answers

First mouse movement unexpected using SDL (C++)

I'm working on a c++ project for school, and my implementation at this moment requires mouse input for controlling a ship (It's supposed to be a remake of Tyrian). Everything is working fine, except for the first time I move the mouse, it has an…
Mats
  • 308
  • 1
  • 3
  • 10
1
vote
3 answers

Board Game using SDL

I am building a board game in SDL and here is the problem I am currently facing. I have a pawn on square 1 and I roll the dice. Based on the value I get on the dice the pawn moves to another square. I am bale to move the pawn after i read the SDL…
Deepak B
  • 2,245
  • 5
  • 26
  • 28
1
vote
1 answer

I want to wrap SDL functions in C++ Classes

I wrapped the SDL functions in C++ classes in order to make it simple for me to use them without complicating the code, but I wonder if it is good practice to do so, as, as far as I know, SDL is written for C, no? Also: The Core class I made is the…
Qchmqs
  • 1,803
  • 2
  • 20
  • 29
1
vote
3 answers

Correct way to generate an SDLK_LEFT SDL_Event?

I would like to generate an SDL_Event but it doesn't seem work. Here's my code to generate: Uint8* keys; SDL_Event ev; ev.type = SDL_KEYDOWN; ev.key.state = SDL_PRESSED; ev.key.keysym.sym = SDLK_LEFT; SDL_PushEvent(&ev); keys =…
Johan_
  • 440
  • 5
  • 14
1
vote
2 answers

How to reference 3rd party dlls/libraries in Qt projects

Been trying to figure this out for an hour now. What I have is a simple Qt Project open in Qt Creator. What I would like to do is use the SDL library (dll) with my Qt project. In visual Studio, what I would normall do is add a reference to this dll…
Kobojunkie
  • 6,375
  • 31
  • 109
  • 164
1
vote
1 answer

OSX: GLUT window never appears

I'm trying to run ORTS on my Mac for a school project. It was ostensibly written to be cross-platform, but I don't know if it was ever properly tested on OSX. After a great deal of difficulty, I managed to get it to compile, but it still doesn't…
Mitch Lindgren
  • 2,120
  • 1
  • 18
  • 36
1
vote
2 answers

D programming with Derelict and SDL

Hello I recently download Derelict2 by checking out the Derelict2 branch here and I try a little program with SDL : import derelict.sdl.sdl; int main() { bool run = true; SDL_Init(SDL_INIT_VIDEO); SDL_SetVideoMode(400, 300, 32, SDL_HWSURFACE…