diff --git a/Makefile b/Makefile index c344e2d..0684f09 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ TARGET := sdl_opengl_bare +DFLAGS := -I/usr/local/include/d +LDFLAGS := -lDerelictSDL -lDerelictUtil -ldl all: $(TARGET) $(TARGET): $(TARGET).d - gdc -o $@ $^ + gdc -o $@ $(DFLAGS) $^ $(LDFLAGS) diff --git a/sdl_opengl_bare.d b/sdl_opengl_bare.d index 862b7cf..4c3241d 100644 --- a/sdl_opengl_bare.d +++ b/sdl_opengl_bare.d @@ -1,7 +1,15 @@ import std.stdio; +import derelict.sdl.sdl; int main(char[][] args) { - writefln("Hi!"); + DerelictSDL.load(); + + if (SDL_Init(SDL_INIT_EVERYTHING)) + { + writefln("Failed to initialize SDL!"); + return 1; + } + return 0; }