Difference between revisions of "4/Development setup"

From Worms Knowledge Base

Jump to: navigation, search
m
(done for now?)
Line 1: Line 1:
 
{{ParentArticle|[[4]]}}
 
{{ParentArticle|[[4]]}}
This page describes how to set up a working development environment with D and [https://github.com/CyberShadow/ae ae] on Windows, and build the sample ae demos.
+
This page describes how to set up a working development environment with D and [https://github.com/CyberShadow/ae Armageddon Engine] on Windows, and build the sample ae demos.
  
 
== D ==
 
== D ==
Line 8: Line 8:
  
 
* Download and run the [http://ftp.digitalmars.com/dinstaller.exe D Windows installer].
 
* Download and run the [http://ftp.digitalmars.com/dinstaller.exe D Windows installer].
* On the component selection screen, feel free to uncheck "D 1".
+
** On the component selection screen, feel free to uncheck "D 1".
 +
 
 +
== ae and requisites ==
 +
There are two ways to set up development libraries: the proper way (using source control), and the easy way (zip snapshots). The proper way allows to easily update and contribute back to the libraries, but requires a lot more work when setting up from scratch. This page covers the easy way.
 +
 
 +
* Download the following libraries:
 +
** [http://www.dsource.org/projects/bindings/changeset/head/trunk/win32?old_path=/&format=zip Win32 bindings]
 +
** [http://www.dsource.org/projects/derelict/changeset/head/branches/Derelict2/DerelictUtil/derelict?old_path=%2F&format=zip Derelict2 Util]
 +
** [http://www.dsource.org/projects/derelict/changeset/head/branches/Derelict2/DerelictSDL/derelict?old_path=%2F&format=zip Derelict2 SDL]
 +
** [https://github.com/CyberShadow/ae/zipball/master Armageddon Engine]
 +
{{gap}}
 +
[[File:ae-setup-folderstructure.png|thumb|right|Folder structure]]
 +
* Unpack all ZIP files.
 +
* Create a new folder, and place the unpacked folders in the new folder as shown in the picture to the right. You will need to:
 +
** rename the root folder from the last zip file from <code>CyberShadow-ae-<i>something</i></code> to simply <code>ae</code>.
 +
** merge the <code>derelict</code> directories from the derelict zip files.
 +
* Copy the path to the new folder from the address bar.
 +
{{gap}}
 +
* Navigate to <code>C:\D\dmd2\windows\bin</code>, and open <code>sc.ini</code> in Notepad.
 +
* Find the line starting with <code>DFLAGS=</code>
 +
* At the end of the line, type a space, then <code>"-I</code>, then paste the path copied above, then type <code>"</code> to close the quotes.
 +
* [[File:ae-setup-dmd-scini.png|thumb|600px|none|Example correct sc.ini]]
 +
* Save and close the file.
 +
<!--
 +
>>>>>>>>>>>>>> Visual D is blocked by http://www.dsource.org/forums/viewtopic.php?p=27618 <<<<<<<<<<<<<<<
  
 
== Visual D ==
 
== Visual D ==
Line 17: Line 41:
 
* Download and install [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=115 Visual Studio 2010 Shell], if needed.
 
* Download and install [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=115 Visual Studio 2010 Shell], if needed.
 
* Download and run the Visual D installer from [http://dsource.org/projects/visuald Visual D's project page].
 
* Download and run the Visual D installer from [http://dsource.org/projects/visuald Visual D's project page].
 +
** On the '''DMD Installation Folder''' page, enter: <code>C:\D\dmd2</code>
 +
 +
* Open Visual Studio / Visual Studio Shell.
 +
* From the '''Tools''' menu, select '''Options'''.
 +
* From the '''Projects and Solutions''' category on the left, select '''Visual D Directories'''.
 +
* In the '''Import paths''' box, paste the path to the folder you created.
 +
** (example image goes here)
 +
* Click OK.
 +
-->
 +
== SDL runtime ==
 +
You'll need the SDL 1.2 runtime to run the SDL demos.
 +
 +
* Download the Win32 runtime library for the [http://www.libsdl.org/download-1.2.php SDL 1.2 download page].
 +
* Place <code>SDL.dll</code> in your project's directory, or somewhere on the system path (e.g. <code>C:\Windows</code>)
 +
 +
== Geany ==
 +
There are many editors and IDEs supporting D. This page describes setting up Geany, but there are many others available. If you're feeling adventurous, you can try experimenting with some of the editors and IDEs on [http://prowiki.org/wiki4d/wiki.cgi?EditorSupport this page].
 +
 +
* Download and run the Windows Geany installer (with GTK) from the [http://www.geany.org/Download/Releases Geany download page].
 +
* Start Geany, and open a D file (for example, <code>ae/demo/pewpew/pewpew.d</code>).
 +
* From the '''Build''' menu, select '''Set build commands'''
 +
* Click the '''Build''' button below '''D source file Commands''', and change the text to '''Build and run''' in the pop-up box
 +
* In the edit box near the button (in the '''Command''' column), type: <tt>rdmd -w -g "%f"</tt>
 +
* [[File:ae-setup-geany-buildtools.png|thumb|400px|none|Screenshot]]
 +
 +
 +
<!--
 +
Notes:
 +
Entice - OK but outdated, simplistic (no jump-to-error)
 +
D-IDE - buggy-ish, no build tool support
 +
Geany - a bit laggy (GTK), freezes while building/running
 +
Zeus - shareware
 +
-->

Revision as of 18:22, 29 September 2011

(Up to 4)

This page describes how to set up a working development environment with D and Armageddon Engine on Windows, and build the sample ae demos.

D

There are two versions of the language: D 1 and 2. D2 is the current version, thus commonly referred to as just "D".

Warning: The D installer is known to truncate the system PATH environment variable over a certain limit. (If you don't know what this means, it most likely doesn't apply to you.)

  • Download and run the D Windows installer.
    • On the component selection screen, feel free to uncheck "D 1".

ae and requisites

There are two ways to set up development libraries: the proper way (using source control), and the easy way (zip snapshots). The proper way allows to easily update and contribute back to the libraries, but requires a lot more work when setting up from scratch. This page covers the easy way.

 

Folder structure
  • Unpack all ZIP files.
  • Create a new folder, and place the unpacked folders in the new folder as shown in the picture to the right. You will need to:
    • rename the root folder from the last zip file from CyberShadow-ae-something to simply ae.
    • merge the derelict directories from the derelict zip files.
  • Copy the path to the new folder from the address bar.

 

  • Navigate to C:\D\dmd2\windows\bin, and open sc.ini in Notepad.
  • Find the line starting with DFLAGS=
  • At the end of the line, type a space, then "-I, then paste the path copied above, then type " to close the quotes.
  • Example correct sc.ini
  • Save and close the file.

SDL runtime

You'll need the SDL 1.2 runtime to run the SDL demos.

  • Download the Win32 runtime library for the SDL 1.2 download page.
  • Place SDL.dll in your project's directory, or somewhere on the system path (e.g. C:\Windows)

Geany

There are many editors and IDEs supporting D. This page describes setting up Geany, but there are many others available. If you're feeling adventurous, you can try experimenting with some of the editors and IDEs on this page.

  • Download and run the Windows Geany installer (with GTK) from the Geany download page.
  • Start Geany, and open a D file (for example, ae/demo/pewpew/pewpew.d).
  • From the Build menu, select Set build commands
  • Click the Build button below D source file Commands, and change the text to Build and run in the pop-up box
  • In the edit box near the button (in the Command column), type: rdmd -w -g "%f"
  • Screenshot


Personal tools