Questions tagged [sdl]

Simple DirectMedia Layer (SDL) is a cross-platform, free and open source multimedia library. Should not be confused with Security Development Lifecycle.

Simple DirectMedia Layer (SDL) is a cross-platform, free and open source multimedia library written in C that presents a simple interface to various platforms' graphics, sound, and input devices.

From SDL's home page:

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.

SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. Support for other platforms may be found in the source code.

SDL is written in C, works natively with C++, and there are bindings available for several other languages, including C# and Python.

SDL 2.0 is distributed under the zlib license. This license allows you to use SDL freely in any software.

4893 questions
1
vote
1 answer

trying to track down a Memory Leak using open CV and SDL

The program main loop below is where I am having troubles finding a memory leak. I run Top and every time I loop through taking a picture and printing it, I lose memory that is never recovered even upon exit. I have run valgrind and some results…
goodgulf
  • 403
  • 1
  • 4
  • 5
1
vote
0 answers

How to rename include file from SDL.h to SDL2/SDL.h in CMake?

On Windows the name for the SDL header file is SDL.h, i.e., I have to use #include , while on all other platforms it's SDL2/SDL.h, i.e., #include . How can I rename this include directory in CMake, so that I don't have to…
Sheldon
  • 376
  • 3
  • 14
1
vote
0 answers

Where to store libraries in cross-platform C++ app?

My friend and I decided to start learning C++ game programming using SDL + OpenGL (GLEW), but we don't understand how to configure cmake files yet. I'm working on Windows and my friend on macOS. So we tried to install SDL separatly for our systems.…
Helkor
  • 31
  • 5
1
vote
1 answer

Segmentation fault in glLinkProgram

I'm using SDL2 and GLES3 to write a simple GUI toolkit. My drivers are nouveau. Code ran fine until I tried compiling a shader program, which resulted in segmentation fault during execution of glLinkProgram. GDB shows that error occurs in mesa's…
Oleg Sleva
  • 11
  • 2
1
vote
1 answer

How to copy a texture to another texture without pointing to the same texture

SDL_Texture *screen = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, 800, 800); I want to copy this screen texture to another texture called temp . I tried the following code…
1
vote
2 answers

Problem handling keyboard with openGL and SDL in OCaml

I've a problem handling keyboards events using SDL (only for keyboard events) and openGL (to display graphics, I'm planning to display 3d graphics). When I use Sdlevent.poll nothing happen and I can't use wait_event because I've to display in real…
1
vote
1 answer

GLSL Fragment Shader not modifying output colour

The shaders compile (I have confirmed this by purposefully making the GLSL code error). In addition, the program is created and linked correctly, as I have checked by printing the value of program and it was non-zero. However, I am still faced with…
Basil
  • 488
  • 1
  • 15
1
vote
1 answer

How can I get eclipse to find my SDL libraries, and why can't it find them in the first place?

I am having an issue with getting my SDL libraries loaded into Eclipse properly. I included the libraries SDL2main and SDL2, and linked to them under properties>C/C++ General/>Paths and Symbols>libraries. I get this error when I try to run my…
1
vote
2 answers

SDL Moving my character

I've a problem with my source code. basically, I tried to move a sprite character in 2D map here's my warrior class: class Warrior { private : int HP, SP; int xPos, yPos; int status; …
Jason
  • 452
  • 2
  • 10
  • 27
1
vote
2 answers

cmake using SDL2 and SDL2_Image via FetchContent

I've a small cmake project that uses SDL via FetchContent, this work well with just SDL. cmake_minimum_required(VERSION 3.24) project(sdl_test) set(CMAKE_CXX_STANDARD 20) include(FetchContent) Set(FETCHCONTENT_QUIET FALSE) FetchContent_Declare( …
Juan Medina
  • 533
  • 1
  • 5
  • 12
1
vote
1 answer

OpenGL Framebuffer, drawing to texture

We have a hard time figuring out rendering to texture using framebuffer objects. We have managed to draw our texture unto another texture, but the texture isn't centered. If we set the the texture size to correspond to the window size, it's…
user634545
  • 9,099
  • 5
  • 29
  • 40
1
vote
0 answers

Error setting the video mode when trying to run the compiled Game_Support example; GNAT Studio;

Trying to compile example /opt/gnatstudio/share/examples/training/games/bouncing/bouncing.gpr There are no problems when compiling, but when running - Error setting the video mode UNCAUGHT EXCEPTION === raised STORAGE_ERROR : s-intman.adb:136…
1
vote
4 answers

Vertex Buffer Objects with SDL

When using SDL 1.2, what do I need to include to be able to use OpenGL Vertex Buffer Objects (VBOs)? Currently, I only include SDL.h, SDL_opengl.h, SDL_image.h And get the errors: glGenBuffersARB, glBindBufferARB, glBufferDataARB not declared in…
Ben
  • 15,938
  • 19
  • 92
  • 138
1
vote
1 answer

Error : "SDL could not initialize! SDL_Error: dsp: No such audio device"

I'm currently working on a personnal project and I have an issue with SDL_mixer or Audio I can compile without any problems but when I try to execute the program I got this error: "SDL could not initialize! SDL_Error: dsp: No such audio device" I'm…
Jarche
  • 31
  • 4
1
vote
1 answer

SDL2 Texture wont move when main loop event calls w, a, s, or d in c++

so i've been working on a game system/engine, for my 2D Platformer, and when i press the w, a, s, or d keys it won't move when called in the main loop event. Here is all of my project files and everything that i've written: main.cpp: #include…
1 2 3
99
100