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
0 votes
0 answers
43 views

I'm writing a C++ game engine using SDL2 and I have an SDL event loop, but I'm not really sure what I want to do with these events. I know that I'll have systems that will be interested in these ...
steamdog's user avatar
1 vote
1 answer
143 views

while I was trying to optimize SDL2 rendering phase as much as possible, I reached a wall. I tried to search on the internet but I could not find any solution. So, I need help. Let me explain the ...
Binary Series's user avatar
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
187 views

I’m a beginner developing a 2D game in SDL2 using C with a visual style that uses crisp high resolution graphics (like geometry dash and Hollow Knight -- not pixel art). I want the game to scale ...
NewCoder's user avatar
0 votes
2 answers
160 views

I only know C, no other language. How do I use a linked list to store projectiles in sdl2? My bullet currently has an sdl_image, has been queried and has the following properties: ...
L1ghtkage CaptainL1ghtning's user avatar
0 votes
0 answers
45 views

I am a freshman cs major with an interest in game dev. I know next to nothing and am very new to this so please bare with me. TLDR; Should I use BSP for detection between moving and static objects as ...
L1ghtkage CaptainL1ghtning's user avatar
0 votes
1 answer
154 views

Whenever I create a project with SDL2, I always encounter the same issue: when I hold down a key (for example, W for upward movement), it moves on the first frame, doesn’t move on the second frame, ...
Alex Martínez's user avatar
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
0 answers
70 views

I am currently using a SDL_Texture *texture as a chunk in my world that is being Perlin noised onto to make terrain. Using a 2d array of these I tile the plane. But ...
Syntax Error12's user avatar
0 votes
0 answers
80 views

I want to render terrain efficently using perlin nosie and a lots of rects. Should I use rects or is there another way. Following is my implementation. I use rect size = 1 which is not really ...
Syntax Error12's user avatar
3 votes
2 answers
198 views

I recently bought a R36S retro handheld linux based game console. The system runs ArkOS which is a Ubuntu based OS. On boot, the system launches the program EmulatorStation, but it is possible to exit ...
Dov Grobgeld's user avatar
0 votes
1 answer
99 views

I am trying to create a Voxel Space Engine In SDL2 C++. However the tutorial I am following reads the X and Y pixels of the heightmap image. I can't find a way to do this. I am following this tutorial:...
Nabir14's user avatar
  • 59
0 votes
1 answer
145 views

I pulled my SDL2 game out of cold storage and am working to get it running again. I found a curious thing: graphics primitives based on SDL2_gfx and text based on SDL_ttf are displaying way too big, ...
Joymaker's user avatar
  • 121
0 votes
1 answer
220 views

(I apologize in advance for my awful English) I'm writing a personal UI library in C++ using SDL2, and when came the moment to implement icons, I struggled to find how to render them in a unique color....
Gkcrafting's user avatar
1 vote
1 answer
124 views

I'm making a GUI that can be controlled by a steering wheel. It need only run on Windows. It works as expected with exception of the fact that the first 90 degrees in either direction seems to be ...
Brian K's user avatar
  • 113
0 votes
1 answer
174 views

Currently, the way I render my frames is as follows. I have two arrays of pixels (in SDL_PIXELFORMAT_ABGR8888) called ...
Scene's user avatar
  • 123
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
3 answers
156 views

So, I've been working on a game dev library using C++ and SDL2 (to test the library out I'm making a Pong clone). And now I'm writing a Scene Manager which is going good, I can switch between scenes ...
smooll's user avatar
  • 1
0 votes
0 answers
111 views

I'm using SDL2 in my game engine and I'm trying to figure out how I can prevent having a monolithic control statement like this: ...
Konjointed's user avatar
0 votes
1 answer
334 views

I'm currently developing a game on Windows using the MSYS2 environment and mingw64. I've successfully installed SDL2 using the msys package manager (pacman) and using CMake, was able to get it up and ...
nz881's user avatar
  • 21
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
2 answers
255 views

I am trying to set up a basic toy example of how a loading screen would work in SDL. Here is my code below. ...
lancen's user avatar
  • 33
0 votes
1 answer
423 views

I'm working on a 2D tile-map RPG with C++17 and SDL2 + SDL_Image. There are daily cycles, weekly cycles and seasons. Even a kind of weather engine provides atmosphere. The moods and times of day are ...
El_Codepone's user avatar
0 votes
3 answers
964 views

I'm trying to create a scene manager system for a small framework I'm writing on top of SDL2. I have implemented a scene management system that works, but I am not sure if it is structured how it ...
Sphereishere's user avatar
0 votes
1 answer
138 views

I noticed that render a portion of the texture, upscaling it, it affects is border values with the proximity of the outside remaining parts of the texture (when not using Neareast neighbour ...
Raffaello's user avatar
  • 125
1 vote
0 answers
383 views

I want to implement an isometric map with rectangular tiles similar to how it was in simcity 2000, where tiles could have different heights and tiles with different heights were connected by slopes. ...
SavedowW's user avatar
0 votes
1 answer
86 views

I noticed that composing frames in a big texture will consume more RAM rather than having 1 frame per texture (or sprite if you would like). The renderer is SDL2 backed by Direct3D. Is there any ...
Raffaello's user avatar
  • 125
1 vote
2 answers
263 views

I've been learning C++ and SDL2 and I'm trying to improve at using composition and for the longest time I thought it was only useful for making things like players, enemies, coins, etc, and I think ...
Konjointed's user avatar
1 vote
0 answers
489 views

I want to handle different resolutions without altering any game objects. I tried using SDL_RenderSetLogicalSize() but I don't know how to implement it properly. ...
RGthehuman's user avatar
0 votes
1 answer
563 views

Is it possible to copy into a SDL_Surface what is displayed in the screen from a SDL_RendererPresent? using ...
Raffaello's user avatar
  • 125
6 votes
3 answers
2k views

I am creating a game using C and some libraries. I wish to not require my users to download anything but the game as most games are self contained. What is the usual process for compiling and ...
Lead Vaxeral's user avatar
0 votes
1 answer
442 views

I'm working on a top-down 2D RTS with C++ and SDL2, and have implemented the biome/terrain generation, tile rendering and a rudimentary camera system. I already have the skeleton code in place that ...
ireece1's user avatar
0 votes
1 answer
239 views

I'm trying to add text rendering to my rendering project and am following the OpenGL tutorial at https://learnopengl.com/In-Practice/Text-Rendering I'm using SDL2 as my backend so had to make some ...
YamMan's user avatar
  • 49
0 votes
1 answer
352 views

i am learning how to make a 2d game using sdl and c++ and am currently trying to rotate the sprite so that is always facing the cursor, my game is set up with an entity component system, i have a ...
user21746705's user avatar
0 votes
1 answer
394 views

When I run the program at 60 fps, I get 0.016 seconds per frame most of the time, then 0.017 s once every few frames. A similar thing happens for 30 fps, varying between 0.033 and 0.034 seconds per ...
Domonicx's user avatar
0 votes
1 answer
234 views

I'm making a simple SDL2-based Rust game, on an OSX laptop. Graphics mostly involves drawing lots of colored squares to the screen. Performance is really slow for what I'm doing, so I decided to ...
sclamons's user avatar
0 votes
0 answers
109 views

Im implementing a series of textboxes in sdl2 ,however my program is not working correctly -sdl is not destroying textures when the destroytexture function is callled resulting in a weird overlap of ...
Exiatron00's user avatar
0 votes
1 answer
239 views

I am programming a game in SDL2 and I am looking for advice on how to handle interactivity of UI components when the screen resolution and logical resolutions are different. Up to now I have been ...
lancen's user avatar
  • 33
0 votes
1 answer
144 views

I'm making an Ultima spinoff which requires a lot of key strokes for actions. For example the arrow keys are for movement BUT once the player presses down the 'T' (talk) key the arrow keys are used ...
Nicholas Humphrey's user avatar
1 vote
0 answers
82 views

My team and I released our game on Steam last year for Windows, Mac, and Linux. The game is written in C++ and uses SDL2, including SDL2_image, SDL2_ttf, and OpenGL for graphics. Around the middle of ...
Nicolas Ford's user avatar
0 votes
1 answer
230 views

U'm currently trying to develop a 2D RPG similar to early Final Fantasy titles for the NES. Up until now I've been reading C++ tutorials on SDL2 and doing my best to convert the concepts into OCaml. ...
Nameless King's user avatar
1 vote
0 answers
128 views

I am observing strange behaviour with VSync in SDL. I have this code: ...
arminb's user avatar
  • 201
0 votes
1 answer
119 views

I'm following along with the LazyFoo tutorial to create the basis for a simple arcade space shooter. I'm trying to get the sprite moving through the map while being tracked by the camera. The code I ...
Kevin Shaughnessy's user avatar
0 votes
0 answers
1k views

After a long time away, I'm coming back to SDL, using version SDL2. I have some example code that does pretty much exactly what I want it to do, but I want to change the pixel color. Ive tried ...
j0h's user avatar
  • 101
0 votes
1 answer
456 views

I am making my own game and this is the first time i'm doing so. so I hope you can forgive stupid mistakes. Im making this in C++ and using the SDL2 framework. Currently, I have a character on my ...
Saksham Goyal's user avatar
0 votes
1 answer
785 views

I am trying to make use of the Tiled Map Editor for my SDL2 projects. (By using the TMXLITE parser from Fallahn on Github) https://github.com/fallahn/tmxlite ...
I_Keep_Trying's user avatar
2 votes
1 answer
497 views

I am a newbie in SDL2 and I was testing an example code of Lazy Foo SDL tutorial just out of curiosity. The program renders an image named x.bmp living in the same folder as the program. Here’s the ...
SuperNoob'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
0 votes
1 answer
130 views

I'm using C++ and SDL2 to learn about coding by creating a clone of a 2d tile-based game I enjoy. To setup my problem; There can be multiple items dropped on a tile by the player or other entities ...
user161794's user avatar
0 votes
0 answers
1k views

I am trying to get the Antialiasing (multisampling) in OpenGL with SDL to work(as shown here), but the result doesn't change and I still get jaggy edges. Before rendering I call the following ...
TheBaum's user avatar
  • 43

1
2 3 4 5
8