Download the engine source code with examples, unpack it anywhere.
If you use Lazarus for development:
Open and compile the package
You will find it in the
Use the Lazarus menu item "Package -> Open Package File (.lpk)"
to open the package file, press "Compile" in a dialog that appears.
Then open and compile the package
Note: do not install the
Finally, open and install the package
In the package dialog, the option to "Install" package is under the "Use" button.
castle_components.lpk is successfully installed,
Lazarus restarts, and you should see the "Castle" tab
with our components.
Now compile and run from Lazarus any engine example.
Open the project file (
xxx.lpi) using Lazarus,
and compile and run.
A good examples to try at the beginning are
From Lazarus, you can use the engine integrated with Lazarus forms (and the rest of the Lazarus Component Library) through the TCastleControl class. Or you can use Lazarus only as an editor and debugger, and use the engine without the Lazarus forms, initializing the window using the TCastleWindow class.Watch the movie showing the Lazarus installation process.
If you don't use Lazarus (only command-line FPC):
Our engine can be used without the LCL (Lazarus Component Library) through the TCastleWindow class. To compile the engine and applications without the help of Lazarus, you have a couple of options:
Use simple shell scripts that call FPC with proper
command-line options. They pass to FPC file
that contains engine paths and compilation options.
Just try compiling any example program this way.
A good examples to try at the beginning is
examples/fps_game/fps_game.lpr, so do
cd examples/fps_game/ ./fps_game_compile.sh
And run the resulting executable (run
on Unix, or
fps_game.exe on Windows).
You can use a similar approach as the
script for your own programs.
Once you get friendly with the engine, we highly advice using our
to compile and package your games. The build tool reads the project
configuration from the
It provides a lot of cool options, e.g. can easily
package your Android game, or prepare compressed versions of your textures.
Other option is to compile the engine
units by executing
make inside the
This uses FpMake.
Then add the path with compiled units to your
fpc.cfg file by
adding a line like
(see FPC documentation "Configuration file" to know where you can find your
Programs developed using our engine (engine examples, and your own programs too) can use a couple of libraries.
You can just copy the DLL files to every directory
.exe files that you compile with our engine.
Or you can modify your $PATH environment variable to include the directory where these libraries are. Google "windows how to modify path" if you're not sure how to do this. Remember to restart the appropriate programs, to make them use the new value of $PATH.
Be sure to use the DLL files corresponding to your compiler — if you use FPC/Lazarus for 32-bits, then you make executable for 32-bits, and you should use DLLs for 32-bits. Even if you work on 64-bit Windows.
On Linux and FreeBSD you should install the following libraries
using your favorite package Manager:
LibPng, ZLib, GtkGLExt OpenAL, FreeType and VorbisFile.
Remember to install
-dev versions of these libraries too
(if you're under Debian or similar distribution) to be able to compile
programs that link to these libraries.
On Mac OS X: Mac OS X requirements are listed here.