From b3e122eeef43771a0cc6b23eb4527ae2824ce2d8 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Wed, 16 Sep 2015 18:05:26 +0200 Subject: [PATCH] Add readme file. --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1292ed1 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +## Jumping in D ## +### Purpose ### +#### Target audience #### +If you are getting close to D there are a number of resources you can count on: the official documentation on [dlang.org](http://dlang.org/), [books](https://duckduckgo.com/?q=!ebay+d+programming+language+alexandrescu), the friendly folks on the [IRC Freenode channel](http://webchat.freenode.net?randomnick=1&channels=%23d). However, as you open your text editor and start typing code, you will face common issues that will raise questions and doubts, in spite of what you have already learned. This small projects aims to show you how a simple SDL project can tackle some of those issues, hopefully getting you started into designing you code in D. + +#### What's in this code? #### +This sample program is not an all-you-need-to-learn-D kind of reference. I'm assuming you already know a bit about D, but you're still fresh enough to be confused at some basic topics. Among the other things, this program demonstrates: +* creating a mixed C and D project with CMake +* writing an SDL program in D +* calling C functions and managing the acquired resources +* managing your custom resources +* inheriting from a base class providing both an abstract interface and a default implementation for some methods +* loading textures in SDL using the new [BPG](http://libbpg.org/) image format +* struct vs class + +More examples could be added in the future, although I don't want to clutter this project with too much code. + +#### Dude, is this an hello world app or what? #### +If you found this example trivial, then maybe you're coding skills in D are above that of my target audience :) But if you have suggestions or you spot any mistake, please do get in touch! + +### Compiling ### +#### Required tools #### +I've only tested this code with gdc 5.2.0 on Linux. It might work with other compilers but please consider it untested. +On my system I'm using: +* gdc 5.2.0 +* cmake 3.0 (patched to support D - see https://github.com/trentforkert/cmake) + +#### Compiling instructions #### +1. In a new directory, type cmake -DCMAKE_BUILD_TYPE=Debug <path_to_jumping-in-d_code> +2. Run make +3. To run the program, type ./hello_d