Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.

learn more… | top users | synonyms

0
votes
2answers
317 views

Moving one object from one point to another with acceleration

How would someone implement moving an object from one point in 2D space to another using these formulae to update objects: m_position.setX/Y( m_position.X/Y() + m_velocity.X/Y() * dt + 0.5 * m_acc * ...
-1
votes
2answers
163 views

Segmentation fault adding SDL_Surface

I'm trying to add a new SDL_Surface to my whack-a-mole clone code but even if I set it to null it wont let me. game.h #include<SDL2/SDL.h> #include<SDL2/SDL_image.h> ...
-1
votes
2answers
310 views

My 2D collision code does not work as expected. How do I fix it?

I have a simple 2D game with a tile-based map. I am new to game development, I followed the LazyFoo tutorials on SDL. The tiles are in a bmp file, but each tile inside it corresponds to an internal ...
1
vote
1answer
93 views

Passing an SDL KeyboardState(Uint8*) to Lua

I'm working on my first big project and I've decided to integrate Lua with my C++ framework. Everything's worked out so far, but the only way I've managed to pass the SDL_GetKeyboardState(NULL) array ...
0
votes
1answer
145 views

Redefining the SDL rect struct

Upon checking the docs of SDL (1.2) I saw that the SDL_Rect struct defines the x and y as Sint16. I'm making a bitmap font text scroller and I need those specifically to be unsigned ints because the ...
-1
votes
1answer
459 views

How is destructable terrain made in SDL?

I'm looking for terrain that gets removed in chunks (like in Worms, of instance). How do you do this in SDL?
-2
votes
1answer
755 views

Porting SDL OpenGL Game to Android and IOS

I am currently learning OpenGL (3.0+) with C++. I am using SDL for input handling, window creation, etc., GLEW to use OpenGL and call OpenGL Functions, and GLM for OpenGL Math stuff. If I fully ...
4
votes
0answers
64 views

OpenGL: Frame partially jumps back and forth

I'm working on a project with SDL and OpenGL. The game works great on Windows, Linux, OS X and iOS. However, the Android version is showing a problem on my phone in particular. I have tested another ...
2
votes
0answers
119 views

OpenGL textures make very low fps

I loaded some textures just one time before I go to my mainloop(glutMainLoop). I am using SDL for the texture loading. However, when I compile, my game is running at 6-10 fps. When I don't load the ...
1
vote
0answers
205 views

OpenGL - Texture disappears

I'm making a simple program with C++, SDL and GLEW. So far it is going great but I ran into a weird problem. One of my four textures would not show up on screen even though it used the same code as ...
0
votes
0answers
15 views

How to parse a and displat TMX map object in SDL using tmxparser ?/How to make a platform game using tiled editor and SDL?

I am newbie in this field getting too much trouble in simple platform game for one of my project module if you guys could help or share some code. This is what I have done till now. I could parse a ...
0
votes
0answers
27 views

Strange offset when accessing pixels from an SDL surface

I am using a routine to map a triangle from one surface to another. The problem is that the function below chooses the correct pixel to draw on the destination surface, but the pixel selected from the ...
0
votes
0answers
102 views

Creating A Selectable Object in SDL/C++

I'm trying to create a clickable object. I wrote a pseudo code to try it. When I add a new member to object it works fine, that is when I hold the mouse cursor on the rectangle determined it returns ...
0
votes
0answers
81 views

Pixel buffers in SDL

I'm using SDL and c++ and trying to create a class to work on pixel basics. The buffer is a multidimensional char array. char buff[scW][scH]; The video mode is being set by a ...
0
votes
0answers
161 views

Artifacts rendering high-poly procedural meshes with OpenGL

I am having some issues when rendering some procedural generated meshes. There are some really wierd artifacts when rendering high-poly count meshes (not that much actualy). I have been able to ...
0
votes
0answers
101 views

C++ Visual Studio Sprite Animation Function only setting values for certain Rect structs in SDL

I'm making a game in SDL and I am using an Array of Rects to store values of sprite sheet clip's dimensions. When I call the function and pass in one of my sprite sheet textures with it's ...
0
votes
0answers
88 views

Tile Collision - subtracting a minor value to the box size

I'm having a certain problem when doing collision checks on bounding boxes that have their edges aligned with upper or right tiles. It shouldn't count as an intersection but I don't know a good ...