Questions tagged [sdl-2]

For questions and issues regarding Simple DirectMedia Layer 2 (SDL2). If you're using SDL 1.2, use tag [sdl-1.2]. If you're questioning the library in general, use tag [sdl].

Simple DirectMedia Layer 2.0 (SDL2) is the second generation of a popular open source cross-platform library that provides a simple interface to graphics, sound, and input devices. The new version comes with lots of new features such as full 3D hardware acceleration and the less restrictive zlib license.

Resources:

2910 questions
0
votes
0 answers

Kivy returns 'Process finished with exit code -1073741819 (0xC0000005)' when run using usb dock

I'm attempting to run a python script that displays a kivy window. I am using a wavlink usb dock to connect to two monitors, the following error occurs when connected to the wavlink usb dock. [INFO ] [Logger ] Record log in C:\Users\"user…
0
votes
1 answer

SDL_UpdateTexture are raw pixels copied?

I have an array of pixels that I display to the screen. To do that I use an SDL_Texture object that gets updated using SDL_UpdateTexture like this: SDL_UpdateTexture(frame_buffer_texture, nullptr, &frame_buffer_pixels, screen_res_x); In the…
Daniel
  • 85
  • 5
0
votes
0 answers

Qt and SDL2 input handling

I've followed this tutorial to create a widget in which i can render using SDL, at the end of the tutorial the author mentions that it should be possible to use 'SDL_PollEvent' in the update function so I've created this update function with…
Daniel
  • 85
  • 5
0
votes
0 answers

SDL2 on Android Studio

I'm trying to get SDL2(2.0.14) running in Android Studio (2022.1.1.21). When I try to make it run I get this error: [CXX1405] error when building with ndkBuild using /home/javier/Android/SDL-release-2.0.14/android-project/app/jni/Android.mk: C++…
Javier Ramírez
  • 1,001
  • 2
  • 12
  • 23
0
votes
1 answer

SDL2d.dll not found on windows with CMake using fetchcontent

I am working on a cross platform application with CMake. The project builds on Linux, but not on windows. Any help would be appreciated. The error I get is a popup that says: The code execution cannot proceed because SDL2d.dll was not found.…
Joseph Vargas
  • 772
  • 5
  • 17
0
votes
1 answer

How do I track Unresolved allocations?

I've been working on and off on a game of mine for the last 2 years. I am developing it using SDL2.0 in Visual Studio. Since the first months of working on it I had realized that it had some memory leaks and I have finally decided to deal with them.…
0
votes
0 answers

Golang SDL2 static cross compiling to raspberry fails in case of missing libs

When I try to build a Go application on an amd64 host for a Raspberry-Pi 2 I get this error: ... cp $WORK/b058/_pkg_.a /.cache/go-build/23/23b77813791e651c39389b15d7f9981669cdee14675f76b632daaa86ced9fc66-d # internal # github.com/veandco/go-sdl2/img…
bytecounter
  • 133
  • 2
  • 11
0
votes
0 answers

SDL_MixAudioFormat outputs silence but non-mixed audio works fine? (simple example inside)

I'm using SDL2 on macOS but it seems like the SDL_MixAudioFormat isn't working properly. It doesn't crash or provide any errors, but the output is silent. Here is the function: static void audio_sdl_play(const uint8_t *buf, size_t len) { uint8_t…
SofaKng
  • 1,063
  • 1
  • 11
  • 32
0
votes
1 answer

Cannot initialize music using SDL2_Mixer, reports unrecognized audio format

My app utilizes SDL2 to render weather data to a window, and I would like to play some music in the background indefinitely from a generated queue. I have that part done, but loading music is where the issue occurs. Every time I try to LoadMUS a…
0
votes
0 answers

Query color of a window's title bar in Linux?

I am writing a small GUI in SDL2. Is there a simple way to query the system's default color theme used to decorate application windows on Linux (debian 11, KDE plasma)?
Dan
  • 1
  • 4
0
votes
1 answer

Python SDL2 Custom World Applicator doesn't pick up Entity implementation

My goal Render a polygon using the World-Entity-Applicator pattern in the example pong.py. My understanding of rendering a custom polygon Create an instance of a sdl2.ext.World Create an applicator that filters for a specific class…
0
votes
0 answers

Garbled SDL_ShowSimpleMessageBox() output?

Using SDL_ShowSimpleMessageBox() we should show a helping window but on my screen, it do not show the right characters, as if the encoding was wrong: Is there a way to fix this? Below is the concerned code: void show_help_message_box() { const…
0
votes
0 answers

SDL2: Multiple renderers for multithreading is thread safe?

If I create 4 windows with SDL2, each window has a renderer and is refreshed in 4 separate threads, will there be any thread safety issues?
0
votes
0 answers

How do I link libraries in VSCode on OSX for C/C++?

I'm trying to write a C program that uses SDL2, using VSCode on OSX. Is there some standard way to link external libraries to C/C++ projects in VSCode? It took me hours just to figure out how to get the SDL.h header file to include properly --…
Jason Boyd
  • 1,192
  • 1
  • 9
  • 19
0
votes
0 answers

SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &red) returns OpenGL error 502

SDL version 2.26.2 OpenGL core version 4.0 I am using SDL to for window and context creation for an OpenGL project. I set RGB to be 8 bits, doublebuffered, then create my window and context. Once my context is created, I use SDL_GL_GetAttribute() to…
webwraith
  • 23
  • 5