Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
109 views

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 ...
Moss's user avatar
  • 1
1 vote
0 answers
127 views

My game loop looks roughly like this: ...
pan's user avatar
  • 111
0 votes
1 answer
116 views

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 ...
AntumDeluge's user avatar
0 votes
1 answer
75 views

I am trying SDL2 Gamedev for the first time so I don't know the best practices yet. Now, I have a code structure which looks something like this: main.cpp ui button.cpp and button.hpp objects.cpp ...
Divyansh undley's user avatar
1 vote
2 answers
117 views

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 ...
zachaz35's user avatar
1 vote
0 answers
26 views

I'm using SDL to write a program that plays arcade game-style music (i.e. chip tune music generated by an emulator core) and I have a timing loop in my code that restricts the application to 30fps. ...
Noel Whitemore's user avatar
0 votes
1 answer
863 views

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 ...
ガブリエル Gabriel's user avatar
0 votes
0 answers
161 views

I am trying to write a 3d Renderer in C using SDL and cgml but my shading seems to be not working correctly. When rendering the teapot I get seams and when I want to render a cube I get a bright white ...
Finn's user avatar
  • 1
1 vote
1 answer
497 views

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?
M 027's user avatar
  • 125
0 votes
1 answer
112 views

I'm making a SDL and C++ game engine and I don't know where I'm failing. Here iss my code: Game.cpp ...
prestamo ordenador's user avatar
0 votes
1 answer
211 views

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 ...
snow_owl's user avatar
0 votes
0 answers
71 views

I am building a pong game in SDL2 as my first assignment for my game development class. I've encountered an error involving SDL_Rect that I can't figure out. I am ...
Derek Kwon's user avatar
0 votes
0 answers
69 views

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-...
Renadil's user avatar
1 vote
2 answers
395 views

I've been working on a game using Bullet Physics for C++ as well as SDL for the windowing (with OpenGL) I've recently threaded the game, so that a separate while loop runs the Physics Simulation, ...
jasonmzx's user avatar
0 votes
1 answer
442 views

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 ...
lancen's user avatar
  • 33
0 votes
0 answers
221 views

I've decided to take on a challenge of making 16 c++ games based on this challenge from FamTrinli, I'm using SDL + OpenGL. I've created a simple 2D game in the past, but I didn't like the code ...
koogel's user avatar
  • 79
0 votes
1 answer
473 views

I'm new to C++ and SDL2 and for the past few days I've been trying to figure out what to do with/how to handle assets for my game. I'm using an asset pack that includes 4 characters and each character ...
Konjointed's user avatar
0 votes
1 answer
57 views

I making a simple game following JoeyDeVrieses guide on OpenGL, I followed the guide and created an input system, which handles the keyboard inputs and quitting the application, the issue is I cannot ...
koogel's user avatar
  • 79
0 votes
1 answer
95 views

I'm trying to program a simple space shooter and my goal right now is that when the player presses down and holds a key, the ship accelerates to a max velocity. I have that somewhat; the problem is ...
Kevin Shaughnessy's user avatar
0 votes
0 answers
160 views

I am new to SDL but have used C++ a fair bit over the years. I'm struggling with displaying sprites with a scale. EG. Here I am trying to draw a grid of squares (ie. Tetris) but the source BMP is ...
I_Keep_Trying's user avatar
2 votes
1 answer
2k views

I've been creating a 2D game in sdl2 in C and within my main game loop, I have found a section of code that causes a massive memory leak in my program, roughly leaking 100MB of memory per second. The ...
Bilal Ahmed's user avatar
0 votes
1 answer
711 views

I know the renderer frees memory allocated for its textures when destroyed but is this the case with SDL_DestroyWindow() as well?
the_antagonist9509's user avatar
1 vote
1 answer
192 views

I have only Microsoft build tools and Visual Studio Code installed (not Visual Studio). The CSharpBeginner example from the Stride Game Studio seems to generate, build and run fine using the Game ...
user154681's user avatar
0 votes
1 answer
774 views

I tried to move to MinGW to compile my program, since I am trying to use a more recent OpenMP version than the 2.0 one used in Visual Studio. I was planning on using ...
JK Tech's user avatar
0 votes
0 answers
237 views

I'm in the process of learning SDL. On their webpage, they tout that commercial games (like Valve's Humble Bundle) use the SDL libraries. However, it seems like most of these games have more advanced ...
Izzo's user avatar
  • 113
2 votes
1 answer
4k views

I'd like to directly modify pixels in my window in SDL 2. I expect this code to display an entirely red window, but instead I'm getting an all black window. I'm able to get it working if I directly ...
Jack M's user avatar
  • 183
1 vote
1 answer
678 views

I'm trying to convert my emulator to SDL2 (from SDL 1.2). As I'm drawing pixel per pixel, I follow "If your game just wants to get fully rendered frames to the screen" in the migration guide:...
Colin Pitrat's user avatar
0 votes
0 answers
437 views

I want to create a state machine for menu in my SDL game. So this is my code without the SDL I just want to ask if this is a good way to create it. here is a code: ...
matthews's user avatar
0 votes
4 answers
3k views

When I wrote my first application in SDL, it looked like this: while (!quit) { SDL_PollEvent(&event); switch (event) { // ... } } But ...
Jack M's user avatar
  • 183
2 votes
2 answers
935 views

I have drawn all of the images of my sprite in paint. Is there a way to remove all white pixels? ...
Duncan Blais's user avatar
0 votes
0 answers
298 views

I am trying to make a platform game in C++ and SDL2. I tried to add a jump in the update() function of the main code below , but it does not work as expected, as you can see in the video: Note: I did ...
The Thinker's user avatar
0 votes
0 answers
345 views

I'm writing an SDL2 program, in which I create a SDL_CreateWindow and get its SDL_GetWindowSurface, then I prepare some pixel ...
Kagaratsch's user avatar
0 votes
0 answers
2k views

I am attempting to make a 3d game using SDL2 just to learn and have a bit of fun. I was wondering if there is any way to get SDL2 do calculations on GPU. I have read that SDL2 Textures uses GPU for ...
Apple_Banana's user avatar
1 vote
1 answer
995 views

I'm new to SDL programming and I'm not quite sure I got how it handles events. Given an instance like this defined in "game.c": ...
Gian's user avatar
  • 113
0 votes
0 answers
510 views

I've been watching Javidx9's 3D engine series and I decided to start making it with SDL because it was something I had heard of and seemed simple enough. I'm not going to implement too complex ...
Architect's user avatar
  • 111
1 vote
1 answer
3k views

TL, DR: Will I be able to get a single .exe file which will work smooth in a PC which does not have SDL or so installed ever. If not, how close will be the closest ...
muyustan's user avatar
  • 111
11 votes
1 answer
12k views

I am new to SDL and I've been following some tutorials; in one tutorial he used Surfaces (a window surface and image surface) and a BlitSurface function to draw images without using any renderer (used ...
alexmoran's user avatar
  • 111
1 vote
2 answers
1k views

I have trouble to make my sprite(Arrow) to point at the position of my mouse cursor but i don't get the Right results. I've tried this: ...
PhilCo's user avatar
  • 33
4 votes
1 answer
1k views

First time in game dev, so go easy on me. I understand it's senseless to copy textures, but I'm trying to see this from a copy/move perspective since there is a lot of that going on in my code and in ...
monolith937's user avatar
1 vote
1 answer
261 views

I am using the A * algorithm for my game, it is a kind of Isometric map with lots of tiles. If all the game objects are trees, rocks, houses and only one game object is a moving hero, the A * ...
Traistorm's user avatar
2 votes
0 answers
366 views

I am making a strategy game like Age of Empires. It's a pretty big project and I need a clear game structure. I have defined a Game_Object class with variables ...
Traistorm's user avatar
0 votes
1 answer
364 views

I am making a 2D isometric game that uses the mouse. When I left click on an object, this object should be selected, but how do I determine what object that's currently selected and show a halo around ...
Traistorm's user avatar
2 votes
1 answer
728 views

So let me just get this right out of the way, I'm using SDL1.2 (Lispbuilder-sdl specifically, as I'm using Common Lisp), so on to the problem. I'm trying to make a scrollbar that can scroll text in an ...
Lalzy's user avatar
  • 31
0 votes
1 answer
1k views

I'm trying to scale my window, for example from 440*420 to 320*240. How can I easily do this?
Aresiel's user avatar
0 votes
0 answers
149 views

I'm trying to create a single SDL_Surface that has multiple lines of texts stacked on top of each other using SDL2. When I create a single ...
seamaster's user avatar
  • 101
1 vote
2 answers
1k views

I'm currently doing simple 3D drawing in OpenGL but I have hit a roadblock I just can't seem to get around. The problem is happening with trying to load .obj files. I've written my own .obj reader. I ...
RayShawnOfNapalm's user avatar
1 vote
1 answer
774 views

In my game, there are many units and for each units there's an information widget attached next to them. I use SDL as the game rendering engine. I currently want to display their ID for debugging ...
truvaking's user avatar
  • 131
0 votes
2 answers
294 views

I am trying to make a 3D game with C++, SDL, and OpenGL. My program roughly looks like this: control function has only CPU operations. draw function has CPU and OpenGL functions operations. I just ...
Emre Kaya's user avatar
  • 555
0 votes
1 answer
1k views

This question is probably well documented but I can't find any resources. Basically I'm not sure how to structure rendering with SDL in my code. I made a render class which calls the api and the ...
dukevin's user avatar
  • 109
0 votes
1 answer
2k views

I wrote a simple app that generates a window, a raster, and redraws the raster once every 16ms. Right now the calculations are empty, it just draws a solid color. I don't know how, but I have created ...
Bluebomber357's user avatar

1
2 3 4 5
9