Skip to content
Advertisement

Tag: sdl

Writing a wave generator with SDL

I’ve coded a simple sequencer in C with SDL 1.2 and SDL_mixer(to play .wav file). It works well and I want to add some audio synthesis to this program. I’ve look up the and I found this sinewave code using SDL2(https://github.com/lundstroem/synth-samples-sdl2/blob/master/src/synth_samples_sdl2_2.c) Here’s how the sinewave is coded in the program: I don’t understand how I could change the sinewave formula

SDL audio randomly becomes distorted on Linux

I have a strange issue with SDL audio. It will randomly become distorted. It’s completely random, I can’t reliably reproduce it at all. Sometime it starts being distorted seconds after the program starts, other times I’ve played with the software, let it run over night and it’ll still be working in the morning. It could have to do with SDL,

How to cross-compile with SDL 2 from Linux for Windows

I tried to compile a simple C++ program that uses SDL 2 with the mingw-w64-g++ compiler on my Arch Linux (64bits). For this I downloaded SDL2-devel-2.0.4-mingw.tar.gz from here prog.cpp: Makefile: Now making gives the error: Why undefined reference to `SDL_main’ ? Although I specified -lSDL2main ? What did I do wrong? 🙁 Answer Okay, it was because of the main

gcc won’t compile SDL C Program (undefined reference to SDL functions)

I recently moved to linux and i’m having an issue with compiling SDL C programs using gcc. The command i’m using: Even by seperating sdl-config flags: I’m getting the same error: My very simple program: Answer Order of arguments to gcc matters a lot. Read about Invoking GCC (and documentation of binutils, which gcc uses). Then replace with Better yet,

‘”SDL.h” no such file or directory found’ when compiling

Here’s a piece of my current Makefile: I have libsdl installed properly, SDL.h is in /usr/include/sdl where it belongs, but it just won’t compile. I also have the line #include “SDL.h” in my .h files, but still no go. Anyone knows why? Answer If the header file is /usr/include/sdl/SDL.h and your code has: You need to either fix your code:

Advertisement