From 7c6fc41c2e45ec0cc7320a6d970f8a78cc8177d7 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 2 Feb 2013 20:44:57 -0500 Subject: [PATCH] use Derelict2 --- Makefile | 4 +++- sdl_opengl_bare.d | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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; }