Questions tagged [sdl]
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.
438 questions
0 votes
0 answers
105 views
How can I accurately calculate deltatime in SDL2/3?
I have looked up ways to calculate DeltaTime in the past, but the 'solutions' seem to have my program be slightly jittery or not move things correctly. As far as I know, you would calculate it by ...
0 votes
1 answer
115 views
Trouble with Transparent Pixel Blending in PNG
When drawing transparent PNG data on to the renderer, pixel data of any previous drawing (layer beneath) is replaced with the renderer's drawing color (green). I have tried setting blend mode in the ...
1 vote
2 answers
117 views
Initial FBO creation and render in SDL app failing ERROR: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
My voxel renderer app fails to create a framebuffer object only during launch / initial window resize event. It is an ERROR: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT ...
0 votes
1 answer
849 views
How to create a SIMPLE Skybox using OpenGL and SDL
As the title is saying I'm trying to make a simple skybox to learn how it works. Using, of course OpenGL and SDL. I have tried read some sites, here are them: link 1 link 2 link 3. None of them were ...
1 vote
1 answer
486 views
Use DirectX 11 & HLSL in SDL
I saw Lazy Foo using OpenGL & GLSL in SDL, but I want to use DirectX 11 & HLSL in SDL. Is there a way to do this, and how?
0 votes
1 answer
210 views
encapsulation, structs and global variables?
I have worked on creating a gameloop and so far all of the code was inside a main.cpp file and I want to separate it into different files. Which caused several problems: My code is separated into 3 ...
0 votes
0 answers
68 views
How to re-design the graphics logic behind my game to preform better?
Recently, I have been working on a small "pet-project" of mine in C using the SDL library. I have noticed that without my render-calls, my project takes up 2% of the CPU and with the render-...
0 votes
1 answer
435 views
How to achieve smooth camera dragging with the mouse in SDL2?
I am working on a 2D isometric perspective game using SDL2 and I would like to implement the ability to pan the map when the right mouse button is held down. I was wondering what is best way to set ...