If you haven't done it yet, download the engine source code with examples.
If you want to develop using Lazarus forms:
castle_base.lpkYou will find it in the
castle_window.lpk. (You should not install this package.)
castle_components.lpk. (It will also automatically install the package
castle_base, as a dependency. That's cool.)
castle_components.lpk is successfully installed,
Lazarus restarts, and you should see the "Castle" tab
with our components.
Alternatively, our engine can be used without Lazarus and LCL
(Lazarus Component Library). Only FPC
(Free Pascal Compiler) is required. Many of the example programs
use our own
CastleWindow unit to communicate with window manager,
and they do not depend on Lazarus LCL.
You can use command-line
xxx_compile.sh scripts (or just call
make examples) to compile them using FPC.
In this case, to develop your own programs, you have several options:
Use Lazarus just to manage a custom application:
Or compile your projects using our build tool. Edit and debug them using whatever tool you like.
Or compile the engine with
and add the engine unit output path (like
fpc.cfg file (see FPC documentation "Configuration file" to know where you can find your
We suggest you compile and run now our example project
Also look at it's source code for a complete demo of various concepts
presented in this tutorial.
If you use Lazarus LCL, try also compiling and running the demo inside
To run the example, simply open it's project
.lpi in Lazarus
and run. If you compiled the necessary packages previously (see above point),
the examples should just run. If you prefer to use the command-line,
you can also compile all examples using the
make examples command.