From 32bd540241116d7105da86399d57a3c998657d5c Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Sun, 1 Apr 2012 05:32:23 +0200 Subject: [PATCH] Link all the things --- Makefile | 14 ++++++++++---- derp/app.d | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 355f82d..9556bc7 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ BIN=bin/ COMPILER=dmd -od$(BIN) -INCLUDES=-I. -Iexternals/LuaD/ -LFLAGS=-L-Lexternals/LuaD/lib/ -L-lluad -L-lluajit-5.1 -DFLAGS=-w +INCLUDES=-I. -Iexternals/LuaD/ -Iexternals/orange/ -Iexternals/Derelict3/import/ +LFLAGS=-L-Lexternals/LuaD/lib/ -L-lluad -L-lluajit-5.1 -L-Lexternals/orange/lib/64/ -L-Lexternals/orange/lib/32/ -L-lorange -L-Lexternals/Derelict3/lib/ -L-lDerelictAL -L-lDerelictFT -L-lDerelictGL3 -L-lDerelictGLFW3 -L-lDerelictIL -L-lDerelictUtil -L-ldl +#DFLAGS=-w # Aliases default: bake @@ -15,7 +15,13 @@ editor: HerpDerp luad: cd externals/LuaD; make -Derp: luad +orange: + cd externals/orange; make + +derelict: + cd externals/Derelict3/build; rdmd derelict.d + +Derp: luad orange derelict $(COMPILER) derp/*.d $(DFLAGS) $(INCLUDES) $(LFLAGS) -oflibderp.a -lib Derper: diff --git a/derp/app.d b/derp/app.d index 5275527..48997fe 100644 --- a/derp/app.d +++ b/derp/app.d @@ -4,6 +4,17 @@ import std.stdio; import luad.all; +import orange.core._; +import orange.serialization._; +import orange.serialization.archives._; + +import derelict.opengl3.gl3; +import derelict.glfw3.glfw3; + +class Foo { + int wut; +} + class Derp { /// Is being set to false when the main loop should end. bool running = false; @@ -26,6 +37,8 @@ class Derp { /// Constructor this() { writeln("Derpy is coming!"); + + DerelictGL3.load(); } /// Starts the game. @@ -74,6 +87,16 @@ private: lua.openLibs(); lua.doString(`print("derplua")`); + + auto foo = new Foo; + foo.wut = 3; + + auto archive = new XmlArchive!(char); + auto serializer = new Serializer(archive); + + serializer.serialize(foo); + auto foo2 = serializer.deserialize!(Foo)(archive.untypedData); + assert(foo.wut == foo2.wut); } } }