From Schmid.wiki
Jump to: navigation, search

Using SDL2 with Visual Studio

include:   path\to\SDL2
libs:      SDL2main.lib;SDL2.lib;SDL2_ttf.lib
subsystem: Windows

GLSL Shaders

libs:      OpenGL32.lib
#include "SDL_opengl.h"

Refer to the SDL source release, for version 2.0.1:

SDL2-2.0.1.zip\SDL2-2.0.1\test\testshader.c 

Using SDL with MinGW

References

Prerequisites

MinGW

Installation

Download and unpack in c:\sdl.

Compile Test Example

cd /sdl/test
gcc -I/SDL/include -L/SDL/lib testbitmap.c -o testbitmap -lmingw32 -lSDLmain -lSDL -mwindows

The libraries must be linked in the correct order, otherwise you will get a complaint about an undefined reference to WinMain@16.

Ruby/SDL

Installation

Test Example

start irb, and type:

require 'sdl'
SDL.init(SDL::INIT_VIDEO)
s=SDL::setVideoMode(400,400,16,SDL::SWSURFACE)
s.drawAAFilledCircle(200,200,100,s.format.mapRGB(255,0,0))
s.flip