4,998 questions
0
votes
1
answer
75
views
How can I manage Memory?(SDL2)
So, whenever I go to debug and run my game, the memory just climbs, As you can see, I wipe the memory after I'm done with it(so I thought) Any tips on managing memory in this state? I have looked at ...
-2
votes
0
answers
80
views
GLSL Text not displayed correctly [closed]
I'm trying to display text using SDL_ttf, OpenGL and Shaders. This is my code.
Vertex shader
#version 330
layout (location = 0) in vec2 AttribVertex;
layout (location = 1) in vec2 AttribCoordUV;
out ...
1
vote
0
answers
87
views
SDL program can't find available video device on NixOS
I'm using NixOS and trying to learn SDL, yesterday I got a code example to build and work but today it stopped working, I tried rebuilding everything in a different directory with no success. I'm ...
1
vote
0
answers
77
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
66
views
SDL3 Android Manual Build - App won't start
I'm automating the Android build process for an SDL3-based project without using Gradle. While SDL provides an Android project template, it doesn't fully cover my case, so I'm customizing it to ...
1
vote
1
answer
72
views
SDL_PollEvent() function strangely impacts rendering
I came across a behavior in SDL3 that concerns me.
In SDL3, the standard position of the origin of the screen's coordinate system is in the upper left corner.
I tried rendering a simple 100x100 ...
0
votes
0
answers
97
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 ...
13
votes
1
answer
811
views
SDL_Init() fails without returning an error?
When I try to execute this SDL3 program:
// g++ -Wall -Ofast main.cpp -Iinclude -Iinclude/SDL3 -Linclude/SDL3 -lSDL3 -o build/program
#define SDL_MAIN_HANDLED
#include <iostream>
#include <...
2
votes
1
answer
136
views
SDL3 window wont show the presented D3D11 swapchain
I've been writing my own game engine using SDL3 and DX11. I've been able to get the HWND and set it to swapChainDesc.OutputWindow and set the color to pink:
#define SDL_MAIN_USE_CALLBACKS 1
#include &...
13
votes
1
answer
402
views
Forcing non-exclusive borderless fullscreen with SDL3 + OpenGL on Windows 11
Creating a borderless OpenGL window with SDL3 on Windows at the native display resolution results in the window unexpectedly switching to an exclusive fullscreen mode.
This happens specifically after ...
0
votes
1
answer
313
views
SDL2 on WSL not working, trying to create a renderer causes libEGL warnings?
I'm trying to simply create a window, running in wsl2, but I'm unable to. Every function call is fine until renderer = SDL_CreateRenderer(). This causes it to spit out:
libEGL warning: failed to open /...
0
votes
0
answers
126
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 ...
2
votes
1
answer
115
views
Why is my Stippled Line Code (C99/SDL2) not working properly?
A few weeks back i was prototyping something in SDL2 (using SDL Surfaces) to make stippled lines for my app PGM. I did conplete the code; At first I assumed it was working as intended but when i ...
2
votes
1
answer
76
views
Is it possible to use a macro variable next to already existing text
I want to use unique pointers with sdl2, but the declaration to make them work can get lengthy, so I was trying to use a #define that would allow me to simply insert the type I want to extract and use ...
1
vote
1
answer
64
views
Getting the wl_display without an SDL_Window?
SDL2 constructs and initializes a video device within the SDL_Init() call. If SDL2 decides to use Wayland, this calls Wayland_CreateDevice, which connects to the Wayland server and stores a ...