Skip to main content

Questions tagged [sdl2]

SDL2 (Simple DirectMedia Layer 2) is designed to provide platform independent access to various common multimedia devices. It is the new, current and updated version of SDL and recommended for new projects over legacy SDL1.2

Filter by
Sorted by
Tagged with
1 vote
2 answers
2k views

I'm using SDL2 with .NET bindings. Keyboard handling is encapsulated in static class, and keyboard handling code part looks like this: ...
pabdulin's user avatar
  • 2,710
3 votes
2 answers
4k views

I'm a beginner in sdl2 and I'm trying to make a window, with a gui (where you can move a sprite around) and a CLI (a textbox where the game can return some text and the user can insert commands). Let'...
Exercise To The Reader's user avatar
0 votes
2 answers
1k views

I've been trying to figure this out all day. I'm trying to make a simple check box. But my MOUSEBUTTONUP event keeps firing until I trigger another event like moving the mouse or clicking again. <...
Arkyris's user avatar
  • 11
5 votes
3 answers
7k views

The library I am using (SDL2) only supports drawing to int positions. I am currently storing my objects positions as double, and ...
Erik W's user avatar
  • 151
4 votes
1 answer
711 views

I've completed the per-pixel collision detection for a small side-scroller game, for learning purposes using a Lazyfoo.net tutorial, and I am wondering if it is a good method for detecting collision ...
Pins's user avatar
  • 589
1 vote
1 answer
1k views

I've just started getting into game development, SDL in particular, so please go easy on me. I'm struggling to understand why my player's position isn't chaning when I press the left arrow button. ...
user avatar
0 votes
2 answers
423 views

Lets say I have a simple game loop (variable timestep - but it applies also for other timesteps): ...
Pins's user avatar
  • 589
3 votes
1 answer
4k views

Simply put: What is the simplest way to render an image to two different sdl2 windows? I'm pretty new to SLD2, but I have a nice little level editor working. I then decided to move the area with edit ...
johnnie15's user avatar
1 vote
1 answer
2k views

In SDL2, I would like to render a texture on the screen, but with destination rectangle greater than texture size. Instead of stretching the texture, I would like ...
tigrou's user avatar
  • 3,279
2 votes
1 answer
783 views

In steam when you get a message, or in CS:GO when you find a match the taskbar icon flashes orange and your taskbar becomes unhidden if that's how you have it setup. In SDL2 you can set a window icon ...
Ray C's user avatar
  • 273
2 votes
1 answer
11k views

I have done the following using C++: 1) I used SDL_CreateWindow() to create an SDL window ...
The Ace's user avatar
  • 55
2 votes
1 answer
3k views

I've been a software developer for a while, but I haven't done C++ in a long time and I thought I'd try it out with some game developement. I'm following the tutorial on youtube for Remaking ...
vecima's user avatar
  • 33
2 votes
1 answer
358 views

Preface: In Linux, using C++11, SDL2, GLEW, and OpenGL. Hello Ladies/Gents, I am reaching out as I'm stuck on a fairly simple problem that a decade out of school has further hindered. Specifically, ...
Beau B.'s user avatar
  • 139
0 votes
1 answer
191 views

I can't seem to be able to render my font, it crashes and I can't figure out why. It seems to load the font correctly, but the parts relating to surface crashes. Why does my texture crash? Here is ...
Pinzu's user avatar
  • 3
2 votes
1 answer
879 views

I'll make my player respawn after 1 of his lives is taken, but I want him to be invincible for 2 or 3 seconds and not instadie again because he will be in the way of enemy bullets. ...
FIREHIVE's user avatar
0 votes
1 answer
2k views

This is the way I render the score in my main game , and I made this new project to understand how to use it... It works , the score is updated and it display on the screen but the problem is memory......
FIREHIVE's user avatar
3 votes
2 answers
12k views

I want to add pixel splatters and particle effects to a game. For this my options were to have a bunch of pre-made animations in the form of textures, OR create a particle engine. For the particle ...
Ray C's user avatar
  • 273
0 votes
1 answer
440 views

Could someone please explain me the differences between the SDL_Mixer functions Mix_Quit and ...
NoName's user avatar
  • 1
0 votes
1 answer
3k views

I'm currently fiddling with SDL2 and OpenGL to get an understanding on how they work and, moreover, how shaders are done and work. Right now, I'm following this tutorial, using SDL instead of glfw; ...
fedexist's user avatar
0 votes
1 answer
600 views

I'm coding a game's GUI in SDL2 and c++, I'm using SDL_RenderCopy to load the buttons on to the screen, but don't know how to get buttons in specific spots eg. bottom left corner, slightly below ...
ciaran wickham's user avatar
0 votes
1 answer
411 views

I have a sprite sheet that's 155 x 66 pixels that I use for my game's UI. I've seen many topics regarding rendering sprite sheets by using the number of pixels and dividing that by the number of ...
ciaran wickham's user avatar
1 vote
2 answers
3k views

My game (coded in c++) uses SDL Mixer for its sound. But how do I make certain sounds louder than others. In the game's Main menu, one button is not immediately unlocked, creating a sound if you try ...
ciaran wickham's user avatar
1 vote
3 answers
800 views

I've coded a Visual Studio 2015 game in SDL2 and ran some distribution tests, I gave a user the game's .exe (the raw game with no files) and they got the error SDL2.dll is missing. How would I export ...
ContrastDev's user avatar
0 votes
1 answer
3k views

I need to clear a streaming texture before I draw into it on the next frame, because only a part is updated, and it's random enough that I can't predict which part will be clear. I don't want to ...
Lemon drop's user avatar
4 votes
2 answers
6k views

Well passing just external PNG to SDL is very easy with the SDL_image library. I have a class that does just that. The code looks like the following: ...
ZeroVash's user avatar
  • 143

1
4
5
6 7 8