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.
1
vote
1answer
57 views
Brief pause after keypress
After i press and hold the key it goes forward once then pauses for a second or less then goes forward on forever. My problem is the brief pause I cant locate the issue. Thanks for your help.
...
0
votes
0answers
28 views
Altering pixel value in an SDL2 texture
Alright, I have spent a lot of time on this one, so I need some help. I like the ability to draw pixels directly to the screen, sometimes I do this to trace the path of objects for debugging etc. In ...
-1
votes
1answer
81 views
Using interpolation to traverse waypoints
I'm making an isometric turn based strategy. Characters can move between tiles and tiles only, so I made a function for moving one tile in any direction. Regarding path-finding, I implemented A*, ...
0
votes
0answers
27 views
Breaking an object into parts using SDL_Surfaces
I am trying to create a system that essentially displays several boxes using SDL. The boxes are sprites loaded from jpg files and displayed as SDL Surfaces. However, I have two requirements. One is ...
2
votes
1answer
117 views
How to implement scripted events?
I'm building a game in C++ (using SDL) for a college project, I'm trying to figure out how to script events that happens when a player does something, or some time passes etc.
I have a and idea of ...
-1
votes
0answers
45 views
SDL Callback is repeating non stop?
We have successfully called our callback function in SDL Audio with the following setup.
struct {
SDL_AudioSpec spec; /* SDL Audio Spec Structure */
Uint8 *sound; /* Pointer to wave data */
Uint32 ...
0
votes
0answers
27 views
SDL zooming/upscaling without images becoming blurry?
I'm working on a game with 32px tiles and I have one question regarding this and scaling. When I try to see my game fullscreen my image just becomes blurry. I remember playing NES games and when the ...
-1
votes
0answers
14 views
Match duration using SDL Mixer
We have define our basic codes as below. The snippet of the codes play the music chuck when we press the keys accordingly. The issue now is that file1 is shorter and file2 is slightly longer. We need ...
-1
votes
2answers
129 views
Pixel size for clips in retro NES-like game?
I'm making a retro videogame, currently I'm using 32px x 32px tiles for the map and 64px x 32px for the characters.
However the game looks extremely small, I could increase the tile size to something ...
1
vote
1answer
48 views
Sound upsample using SDL
We have managed to play audio files using SDL's Mix_PlayMusic function. The problem now we need to do some upsampling for one audio to match the other so that both have same duration. Any idea how to ...
0
votes
0answers
31 views
Trapping mouse, but not keyboard input, in SDL
I am writing a game (FPS-style) using SDL that I would like to run in windowed mode. I would like to trap the mouse cursor in the window, but I would like to be able to alt-tab out of the game, so I ...
0
votes
0answers
64 views
Pixel access with SDL 2.0 Textures?
How exactly can one get to the RGBA pixel arrays of SDL 2.0 textures? Does the texture need to be specially initialized and locked down?
0
votes
1answer
115 views
How do I implement collision detection with a sprite walking up a rocky-terrain hill?
I'm working in SDL and have bounding rectangles for collisions set up for each frame of the sprite's animation. However, I recently stumbled upon the issue of putting together collisions for ...
0
votes
1answer
137 views
SDL2 render to texture support
I'd like to use the function
int SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
in my 2D game. At this point I am using only the SDL 2.0 API, and using openGL seems overkill to ...
11
votes
5answers
643 views
What are the benefits of capping frames per second? (If any)
I am working on a simple game in OpenGL, using SDL for display initialization and input, and it appears in terms of timing I have two options available to me. Number one being just sleeping for the ...
0
votes
1answer
66 views
Luminance increase in SDL
We have managed to create grayscale picture using the following snippet of codes in SDL. What we need to do now is how to first convert into YUV or YCrCb for it be able to set the luminance value and ...
0
votes
1answer
128 views
SDL gray scale image from a a color image?
I am new to sdl. I have basically have the following codes which can load the images. I know how to access the pixel as below. What I need it to convert the image to 8 bit grey level and 1 bit ...
0
votes
0answers
99 views
How do I use Opengl in conjunction with SDL?
I've been using SDL for a while in simple 2D games but have been limited as to what I can do graphics wise. I would like to start using Opengl. Does anyone know of any web tutorials for using Opengl ...
0
votes
1answer
81 views
SDL tiles rendering
I'm pretty new to SDL and wonder what is better if I have to draw tiled map on screen: to SDL_RenderCopy each tile from texture(which presents tileset) and then SDL_RenderPresent it every frame or to ...
0
votes
2answers
171 views
How to move player based on existing Game state?
I'm trying to build a basic platforming game in C++ using SDL, and I've encountered this issue enough to know that there's something I'm missing.
What I'm working with, at the most basic level, is ...
7
votes
2answers
508 views
Input management techniques in large games
Is there a standard technique for managing input in large games. Currently, in my project, all input handling is done in the game loop, like so:
while(SDL_PollEvent(&event)){
...
-1
votes
1answer
231 views
Is SDL a game engine? [closed]
I would like to ask if SDL is considered a game engine, or just a library like Open and Direct3D?
0
votes
2answers
153 views
SDL Function for Loading PNGs
I'm learning SDL 2.0 at the moment and I've seen this method for loading BMPs:
SDL_Texture* LoadImage(std::string file)
{
SDL_Surface *loadedImage = nullptr;
SDL_Texture *texture = nullptr;
...
2
votes
2answers
2k views
SDL 2.0 setup on code::blocks using gcc(MinGW) on win7 [closed]
I have recently installed code::blocks on my system running windows 7 home premium 64-bit, and wanted to start learning SDL. The code::blocks executable is the one installed by the ...
-1
votes
1answer
150 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
108 views
2D Circular View/Background Wrapping SDL for Game
In the games such as Defender (1980 arcade) and Defcon, the player can move/scroll in one direction infinitely because the level/terrain simply wraps over and over again(like if it was wrapped around ...
0
votes
1answer
193 views
OpenGL + SDL Linking Problem [closed]
So I'm trying to write a simple application with SDL 1.2 and OpenGL. This a stripped down version of the code containing the one problem I'm having.
//The headers
#include "SDL.h"
#include ...
0
votes
1answer
101 views
SDL 1.3 on Windows 7. Better hardware,lower FPS [closed]
I've just moved from one PC to another.I've been developing a game in SDL with SDL_image and SDL_ttf for about one year. On my old pc, I had about 90 FPS on my game, but now I have about 30, witch I ...
1
vote
0answers
55 views
Glowing Effect and Blending [duplicate]
I am using C++ and SDL and I am trying to get lines with a glowing effect as provided by the image of the game Defcon on the continental outlines.
How could I achieve this glow and blend of the ...
2
votes
3answers
202 views
Efficient Collision Detection With Numerous Objects at Once
I am developing a 2D game with very large levels in which two teams(around 200 objects per team) fight against each other in planes, tanks, turrets,...etc. With every entity shooting bullets at their ...
0
votes
1answer
50 views
SDL - BlitSurfaced Background Slowing Time Based Movement
Whenever I use BlitSurface to apply a background image, the movement of my characters is slowed drastically even though I have movement based on time:
SDL_BlitSurface( background, camera, screen, ...
-1
votes
1answer
50 views
Reverting the view SDL
So in my SDL application, which I setup for OpenGL, if I were to do the following code:
glBegin(GL_QUADS);
glVertex2i(0, 0);
glVertex2i(50, 0);
glVertex2i(50, 50);
glVertex2i(0, 50);
glEnd();
The ...
1
vote
2answers
797 views
How to implement SDL Button/Menu GUI with callbacks?
I have been reading Bjarne Stroustrup's Programming Principles and Practice Using C++ for a while now and am nearing the end of the book. I have to tried to make a very simple game using the SDL ...
0
votes
1answer
45 views
SDL text or additional images not loading
I've got a basic side scroller that allows the user to run and jump around. I've used various tutorials to get this far, but I can't seem to get any text to render, no matter what method. I also can't ...
2
votes
1answer
237 views
Trap mouse in SDL2
When using SDL 1.2 it the way to implement full screen or windowed applications with "no cursor" you did the following:
SDL_ShowCursor(SDL_DISABLE);
SDL_WM_GrabInput(SDL_GRAB_ON);
See Trap mouse in ...
3
votes
1answer
163 views
Does SDL running on Mac OS not recognize Xbox controllers?
I'm trying to learn a bit of SDL, and have been bouncing between Windows and Mac platforms, but am noticing that an SDL program running on my Macbook doesn't recognize the presence of the Xbox ...
-1
votes
1answer
297 views
OpenGL/SDL2 window stopped rendering [closed]
I have been working on a game engine for a couple of days now and I've had it rendering a colourful cube and playing sounds in OGG format, but, after refactoring my code-base to make things easier; it ...
-1
votes
1answer
132 views
SDL Access Violation
I've created a SDL game project and this window popped up while trying to compile:
First-chance exception at 0x00000000 in SDL_Game.exe: 0xC0000005:
Access violation executing location 0x00000000.
...
-4
votes
1answer
150 views
C++ SDL/SFML advancing help [closed]
I've been playing around programming using SDL and SFML for a while now and done all the basic tutorials I can find(love lazyfoo).
but I'm stuck and not sure how to move on from simple games like ...
0
votes
0answers
146 views
SDL - Sprite “Ghosting”
I'm using SDL to create a 2D side-scrolling platformer, but I'm getting ghosting from the sprite. I'm not used to programming with graphics or SDL so excuse any stupid remarks I make.
Here's the ...
3
votes
1answer
245 views
Why (SDL) animated filled-circle leaves trail of movement?
I'm trying to achieve proper animation using SDL. Used flags are SDL_HWSURFACE and SDL_DOUBLEBUF.
That what I'm getting is technically smooth (I think), but I can figure out what should I do to ...
0
votes
2answers
169 views
joystick movement for Geometry Wars clone
I am kinda new in game programming, but I've got a semestral work to make a game, so I decided to do a clone of Geometry Wars. Despite that the game is really simple (in principle), I have ran into a ...
1
vote
1answer
162 views
SDL_Image and typical SDL BMP loading fails completely
been messing with OpenGL and SDL for a pair of weeks.
The thing is quite weird. I have been loading a texture from a BMP and using a really easy shader to make it work, and so far it has worked very ...
2
votes
0answers
89 views
sdl: unlock mouse in fullscreen mode and make it useable on another monitor
Is it possible to unlock the mouse in fullscreen mode so that you can use it on a another monitor?
I read trough the SDL documentation, but I couldn't find anything related to my problem.
3
votes
3answers
377 views
Unable to detect continuous keypress event in SDL
I am developing a game using SDL, and am unable to do continuous motion for my object when a key is held down.
I'm calling SDL_PollEvent() to retrieve all events during a frame, and passing each ...
0
votes
1answer
170 views
SDL_types.h file not found using xcode
Getting this error when trying to use SDL_mixer...
SDL_types.h file not found..
I am including all the correct files as far as I can tell and have included the frameworks (both SDL and SDL_mixer) ...
1
vote
2answers
319 views
My SDL Game executable cannot run outside codeblocks
After compiling and running SDL programs successfully inside CodeBlocks, when I run them outside CodeBlocks (by clicking .exe file) my program does not run. Instead, it says that libstdc++6.dll is ...
4
votes
3answers
752 views
Smooth Sprite Movement - Don't Add Velocity to Position?
I am trying to figure out if there is a way to move a sprite smoothly on the screen at different speeds without stuttering, but keeping the effect that it's moving smoothly; especially at faster ...
-2
votes
1answer
242 views
SDL_BlitSurface does not works
I have an issue with the SDL_BlitSurface...
When I blit (SDL_BlitSurface) in a transparent (background) surface, it does not blits, actually I tried all the existants functions ...
3
votes
1answer
635 views
Is basic SDL hardware accelerated?
I'm going over some SDL tutorials aimed at creating 2D games.
However, when I create a basic SDL program - is it hardware accelerated?
Or is hardware acceleration only relevant when it comes to 3D ...