3,067 questions
-1
votes
1
answer
91
views
How can I manage Memory?(SDL2)
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? (using Visual Studio ...
0
votes
1
answer
59
views
How to choose the correct tile from a tileset based on neighbors to avoid discontinuities in a maze (SDL2, tile-based rendering)
Body:
I'm generating a maze using a simple 2D array where each cell contains information about walls on 4 sides (encoded in 4 bits: top, right, bottom, left).
Currently, I display the maze using ...
-2
votes
0
answers
63
views
How to draw a triangle with OpenGL [duplicate]
I'm trying to draw a triangle:
// gcc -o test -Iglad/include test.c glad/src/glad.c -lGL -lSDL2
#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL_events.h>
#include <SDL2/...
0
votes
1
answer
14
views
MSYS2 pacman -S can't retrieve what pacman -Ss finds
Trying to install SDL2 to my MSYS2 world using pacman. pacman confirms, among other things:
$ pacman -Ss sdl2
. . .
mingw64/mingw-w64-x86_64-SDL2 2.26.4-1
A library for portable low-level access ...
1
vote
0
answers
63
views
cmake looking for files in /opt/homebrew when told to search frameworks only
I have been successfully building and testing my SDL2 program for months, on my native architecture Apple Silicon (arm64). Now, in order to provide my program to a friend who is beta testing, I need ...
2
votes
2
answers
304
views
Use tkinter in an existing window
I have an existing open window, created by SDL 2 in C/C++. I would like the process to call a python script (using Boost/Python) to add some GUI elements to it.
Here's a non-working example:
import ...
3
votes
0
answers
68
views
Half second delay playing sound with SDL_mixer
I am using SDL_mixer to play simple sounds:
(press any key to play the sound; use any simple short sound in place of "Poonk.wav")
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>...
1
vote
1
answer
139
views
I keep getting LNK2019 error even though I have a main() function. What is the issue?
I am writing my own DX11 engine from scratch using SDL2 and CMake. I have been trying to write a main function, but I keep getting this error:
LNK2019: unresolved external symbol main referenced in ...
0
votes
1
answer
315
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
1
answer
70
views
How to place SDL_Rect at the center of the screen
I'm using SDL2 and I have the following code:
#include <iostream>
#include <SDL2/SDL.h>
const int WIDTH = 800, HEIGHT = 600;
int main (int argc, char *argv[]){
SDL_Init(...
-3
votes
1
answer
105
views
Need help to run a project of SDL and c from a GitHub repository [closed]
i have got a project to make a Pac-man game using c language .and for reference i got this Github repo which has every thing related to my project but i dont know how to run this on my own computer, ...
0
votes
1
answer
141
views
How to build SDL2 for QNX (aarch64le)?
I'm trying to port some old stuff to the recently released QNX SDP8 on Raspberry Pi 4. For that I need to build the SDL2 for aarch64le as a library. I don't need Audio and only need EGL / OpenGLES2+ ...
0
votes
1
answer
71
views
silent crash initializing SDL2 in Win32 application
I have a working win32 application, and I want to integrate SDL2's controller input support.
For some reason, when I Initialize SDL2 like so:
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) != ...
1
vote
0
answers
81
views
issue with including cimgui backends
I'm making a program that uses OpenGL and SDL2 in C and wanted to use Cimgui as my gui library however, when trying to include the correct backends I'm getting these linker errors:
main.c:104:5: ...
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 ...