709 questions with no answers
0
votes
0
answers
88
views
i686 compiler with GNU and SDL3 failing to claim window
I am using an i686 system, with the compiler mingw G++. I can run code that creates a GPU device and attaches it to a window fine on that machine. However, when I attempt to run it on my i686 windows ...
1
vote
0
answers
100
views
SDL2's SDL_RenderDrawLine() antialiases lines in Windows but not in Linux?
I wrote a basic program to draw a line across two corners of the screen with SDL2:
// Linux build:
// gcc test.c -lSDL2 -lSDL2main -o test
//
// Windows build (Linux VM using MinGW):
// x86_64-w64-...
0
votes
0
answers
143
views
SDL_GL_CreateContext() fails without an error message
I'm building an OpenGL 4.6 application using SDL3 and GLAD, compiled with g++:
// g++ -Wall -Ofast main.cpp include/glad/glad.c -Iinclude/SDL3 -Linclude/SDL3 -lSDL3 -lopengl32 -o build/program
#define ...
0
votes
0
answers
301
views
Why are my SDL textures not being rendered onscreen?
I am working with SDL3 and I am encountering an issue with rendering textures. I am able to create the textures, but they don't show up on the screen when I try to render them.
Here's what I'm trying ...
1
vote
0
answers
52
views
Render DMABUF fd in a SDL2 window in Rust
I know that this will be a little bit long, but please stay with me until the end.
I'm trying to build a simple Display for QEMU in Rust using SDL. I am using the D-Bus interface provided. It works ...
0
votes
0
answers
107
views
SDL CPU rendering project, rendering error when resizing window: Window surface is invalid
I was working on a cpu only rendering project with SDL in C.
I implemented very good error handling and I got this error when I try to resize the window, "ERROR: SDL Error in render thread: ...
0
votes
0
answers
53
views
Issue with rendering window in SDL2
i am working with a chip8 emulator and I'm trying to implement the display. i got finalized to show a window with white rectangle the issue is when i use the function outside of the while loop the ...
0
votes
0
answers
412
views
Can I put a generator expression inside a set command in CMake?
When I build SDL (Simple Direct Media Layer) it has an option to build with address sanitizer using the variable you can set SDL_ASAN. I'm pretty sure within its CMake files it sets things depending ...
1
vote
0
answers
43
views
SDL window displaying only when running the binary directly and not with cargo run
I was trying to make a simple program that opens a SDL window that I can use for a game, and used the demo code from the rust-SDL github shown below.
main.rs
extern crate sdl2;
use sdl2::event::Event;...
2
votes
0
answers
253
views
Automatically downloading dependencies (SDL2) during builds with CMake
I was developing a very small game with C and SDL library. I was developing it on the Windows based machine so I prepared my CMakeLists.txt to automatically download SDL library from GitHub releases ...
0
votes
0
answers
82
views
Undefined reference to `id_to_sdl_format' when building pipewire exapmle
I'm trying to compile the example https://docs.pipewire.org/video-play_8c-example.html
After replacing #include "sdl.h" from line 30 with #include <SDL2/SDL.h>, I compile with gcc main....
0
votes
0
answers
86
views
Why does this code work on Desktop but not Android in debug build?
I have been trying to modify this SDL2 game source code to make it playable on android devices.
I had a problem and it was that when I run the game as a host all players are frozen in place and doesn'...
0
votes
0
answers
59
views
SDL compiling error using g++ undefined reference to "class::funciton"
I am getting
C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexewin.c:67:(.text.startup+0xbd): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
make: *** [<builtin>: ...
1
vote
0
answers
98
views
VS Code window gets automatically resized when closing a fullscreen pygame window
I am using the current latest version of VS Code
Version: 1.85.1 (user setup)
OS: Windows_NT x64 10.0.22621
Python: 3.11.5
Pygame: 2.5.2
i am on windows 11
I am making a fullscreen app in pygame and ...
0
votes
0
answers
911
views
Creating an SDL2 Window in assembly
As a challenge I am trying to make a game in assembly. After some research, I tried making a SDL2 window by importing functions from the SDL dynamic library.
extern SDL_Init
extern SDL_CreateWindow
...
1
vote
0
answers
1k
views
SDL3 CMake linkage problem undefined reference for SDL
When trying to link SDL3 as git submodule I get many errors:
...
undefined reference to `SDL_DestroyWindow'
undefined reference to `SDL_Quit'
undefined reference to `SDL_Init'
undefined reference to `...
0
votes
0
answers
165
views
C2081 'PLAYER': name in formal parameter list illegal - compiling using VS
While trying to compile my C translation units player.c and game.c I am encountering two errors that I do not understand.
C2081 'PLAYER': name in formal parameter list illegal game.h
C2371 '...
1
vote
0
answers
51
views
SDL2 Not rendering devanagari font correctly
So I am using UTF8 for showing Devanagari font in SDL2 like below.
#include <SDL2/SDL_ttf.h>
#include <SDL2/SDL.h>
#include <iostream>
int main() {
if (SDL_Init(SDL_INIT_VIDEO | ...
1
vote
0
answers
56
views
SDL not displaying anything to the window on Kubuntu?
I'm making a program in C++ on Kubuntu and using SDL2 for graphics and displaying a window:
#include <iostream>
#include <SDL2/SDL.h>
SDL_Window* window;
SDL_Renderer* renderer;
void ...
0
votes
0
answers
58
views
"dyld: Library not loaded... Incompatible library version" when compiling with -frameowork
I'm have this source file
#include <SDL.h>
#include <stdio.h>
int main() {
if (SDL_Init(SDL_INIT_VIDEO)) {
printf("Hello SDL\n");
}
return 0;
}
I have the ...
1
vote
0
answers
80
views
SDL2 Window is not being created
What happens when THIS fails to open a window. The program run, I can see it in my dock, but no window appears. This is pretty much the bare minimum needed to open a window using the SDL li
#include &...
0
votes
0
answers
174
views
Linker commands for SDL using MingW64
I am trying to run a simple Window program using SDL, unfortunately during linking, I get the error messages. I am using C++
skipping incompatible C:\Users\tinay\Desktop\dzivaguru\lib/libSDL2main.a ...
0
votes
0
answers
36
views
Balls gradually coming down in sdl
I wrote the program below in cpp, I want the balls that I have drawn above the screen to comedown gradually so the user can be able to see it, but I can't figure out what to do
#include <SDL2/SDL.h&...
0
votes
0
answers
57
views
SDL2 Compare textures
I'm building a 2d graphical engine using SDL2 as the backend,
to reduce memory costs I wanted to create some sort global texture pool where every object could take a texture from.
To avoid duplicates ...
1
vote
0
answers
273
views
Why use SDL_Surface over SDL_Texture
I understand that SDL_Textures are rendered by the GPU, whilst SDL_Surfaces are rendered by the CPU. However, I don't understand why SDL_Surfaces would be used at all, given that SDL_Textures are ...