Crystal Space 2.0.0: 4.2.1 Simple Tutorial 1: Basic Setup, World Creation

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 4.2.1 Simple Tutorial 1: Basic Setup, World Creation

This tutorial provides a step-by-step explanation on how you can use Crystal Space from within your application. This tutorial is mainly based on the `‘simple1’` application which you can compile and run to see what it does. To build `‘simple1’` which ships with Crystal Space, type `‘make simple1’` or `‘jam simple1’`, or build the `‘appsimple1’` project if you use MSVC.

When you downloaded the Crystal Space package it contains a `‘CS/include’` directory. This directory contains all header files you need when using the Crystal Space components and libraries in your own applications. On one hand, the include directory contains SCF interface definitions. These pure interface file are stored in directories with names starting with the letter `‘i’` (as in `‘iengine/engine.h’`). On the other hand we also have plain C++ include files for interfacing with the libraries of Crystal Space. When you install Crystal Space on your development system (for instance, by invoking `‘make install’` or `‘jam install’`), these headers are placed in a location where they can be easily accessed when writing new programs based on Crystal Space. On Unix systems, for instance, these files usually end up in `‘/usr/local/include/crystalspace’`. Since it can be difficult to remember which header files contain which classes and interfaces, you can instead include the convenient catch-all header file `‘crystalspace.h’`.

Crystal Space also has a reference manual and API documentation. The manual is included in HTML form Crystal Space itself in the `‘CS/docs/html’` directory. After you install Crystal Space, the documentation resides at `‘/usr/local/share/docs/crystalspace-*’`. Documentation is also available online. The API documentation can be generated locally or viewed online. See section Where to Get Crystal Space.

Additionally, note that the source code for some of these tutorials can be found in the `‘CS/apps/tutorials’` directory. There are also a few additional tutorials at that location which are not (yet) covered in the documentation.

Before reading this tutorial you should first read the basics (see section Basics and Overview).

This tutorial features:

- Basic setup of a Crystal Space application using `csApplicationFramework`.
- Setting up the application event handler using `csBaseEventHandler`.
- Using events to draw 3D frame and listen to keyboard so we can quit the application.
- Loading of the basic plugins needed to get the engine going using `csInitializer::RequestPlugins()`.
- Creating of the 3D window.
- Loading of a texture and material using `iLoader::LoadTexture()`.
- Creation of a simple room using `iEngine::CreateSector()` and `CS::Geometry::GeneralMeshBuilder`. Also adding a few lights so that everything is visible.
- Creation of a view (`csView` class) and a camera.
- Basic movement using the keyboard.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated using texi2html 1.76.