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

1 vote
1 answer
34 views

Reading steering wheel events has 180 degree dead zone. How to remove/reduce dead zone?

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
0 answers
31 views

Regarding with pixel arrays and textures in SDL2

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
60 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?
M 027's user avatar
  • 21
0 votes
3 answers
92 views

How to stop scenes from running before switching between them?

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
57 views

SDL2 Events how to avoid monolithic control statement?

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
0 answers
121 views

What do you do with SDL2 events?

I have the typical/basic event loop for SDL2 and I'm a little confused on what to do with them or how to handle them or I guess more specifically how should I get the data from these events (e.g ...
Konjointed's user avatar
0 votes
0 answers
28 views

Beginner seeking advice: Questions regarding SDL2 setup on Windows using MSYS2 and MinGW, plus concerns about deployment

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
69 views

Scrolling camera with a tile map stored in JSON and PNG

I'm trying to get a scrolling camera into my SDL2 game and I'd like some advice. The way I'm implementing my map is as follows: I use a tileset to build a map in the Tiled map editor, and I'm ...
Derek Kwon's user avatar
0 votes
0 answers
44 views

non-class type error with SDL_Rect

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
1 answer
103 views

How to setup a loading screen using SDL_Threads?

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
0 answers
65 views

How to draw a tile placement grid in a 2d isometric place/world?

I'm working on an isometric 2d tile based game in ruby using SLD 2. The tiles are 40px wide and 20px tall. I'm trying to figure out how to draw the grid (where each cell of the grid is a potential ...
Scriptonaut's user avatar
0 votes
1 answer
155 views

Simulated light for a 2D tile-map with just SDL2?

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
297 views

What is the best way to implement a scene manager?

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
68 views

How to render a portion of a texture (upscaled) without affecting the border with SDL2?

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
256 views

Selecting tiles with mouse on isometric map with height and slopes

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

15 30 50 per page
1
2 3 4 5
25