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.
3
votes
1answer
73 views
How do I multiply pixels on an SDL Surface?
Okay so I'm able to put blank pixels into a surface and also draw gradient pixels rectangles,etc
But I don't know how to multiply the pixels on a surface so I was hoping someone could provide me ...
-1
votes
3answers
89 views
Trying to figure out SDL pixel manipulation?
Hello so I've found code that plots a pixel in an SDL Screen Surface :
void putpixels(int x, int y, int color)
{
unsigned int *ptr = (unsigned int*)Screen->pixels;
int lineoffset = y * ...
0
votes
1answer
113 views
Data-driven animations
Say you are using C/SDL for a 2D game project. It's often the case that people use a structure to represent a frame in an animation. The struct consists of an image and how much time the frame is ...
1
vote
1answer
125 views
c++ and SDL: How would I add tile layers with my area class as a singleton?
I´m trying to wrap my head around how to get this done, if at all possible. So basically I have a Area class, Map class and Tile class. My Area class is a singleton, and this is causing some ...
9
votes
2answers
238 views
What should I worry about when changing OpenGL origin to upper left of screen?
For self education, I'm writing a 2D platformer engine in C++ using SDL / OpenGL. I initially began with pure SDL using the tutorials on sdltutorials.com and lazyfoo.net, but I'm now using SDL to ...
0
votes
3answers
228 views
graphical interface when using assembly language
I want to learn a framework to use in assembly. I know that's not possible without learning the framework in C first. So I'm thinking of learning SDL in C and then teach myself how to interpret the ...
0
votes
4answers
215 views
How to implement the light trails for a tron game?
Well I was creating a TRON style game, but had an issue with creating the actual light trails for the game. What I'm doing currently is I have an array the same size as my window in pixel size, ...
5
votes
2answers
220 views
Custom extensible file format for 2d tiled maps
I have implemented much of my game logic right now, but still create my maps with nasty for-loops on-the-fly to be able to work with something. Now I wanted to move on and to do some research on how ...
1
vote
1answer
44 views
Lost transparency in SDL surfaces drawn manually
I want to create SDL_Surface objects for each layer of my 2d tile-based map so that I have to render only one surface per layer rather than too many tiles. With normal tiles which do not have ...
1
vote
4answers
207 views
SDL - Getting a single keypress event instead of a keystate?
Right now I'm working on a simple SDL project, but I've hit an issue when trying to get a single keypress event to skip past a splash screen. Right now, there are 4 start-up splash screens that I ...
3
votes
1answer
165 views
How to use caching to increase render performance?
First of all I am going to cover the basic design of my 2d tile-based engine written with SDL in C++, then I will point out what I am up to and where I need some hints.
Concept of my engine
My ...
2
votes
1answer
141 views
How do I play music at half speed?
I'd like to slowdown music playback, say at half speed. I'm currently using SDLmixer. I assume I'd need to tell SDL that I have a 44KHz music and want to stream it at 22KHz, but when I pass in 22Khz ...
2
votes
2answers
78 views
Can't get simple OpenGL texture working using SDL2 and FreeImage3
I created a simple OpenGL program that display a quad with texture, but it doesn't seem to be working as it only displays a white quad. What could possibly be wrong? I checked everything I could think ...
3
votes
2answers
99 views
Best way to distribute graphics, audio and levels with an SDL game?
I'm working on finishing up a game written in C++ with SDL I've been working on for awhile, and I'm starting to ponder how I'm going to distribute it. It has hundreds of images that are loaded and ...
1
vote
1answer
57 views
Do SDL surfaces get reused?
In SDL, lets say I'm rendering text to a surface. Then I blit it with the scene's main surface to form a composite image to flip.
I get the text surface into a class-level member called ...