---
name: "CL_ClanApplication"
section: "3"
platform: "linux"
package: "clanlib0-common-dev"
version: "0.4.4-8"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/CL_ClanApplication"
---

# CL\_ClanApplication(3)

The starting place for all applications.

## NAME

CL\_ClanApplication - The starting place for all applications.

## DESCRIPTION

The application class must be inherited by all ClanLib applications. In your application create a class inheriting CL\_ClanApplication,  make a global instance of it, and fill in the main() and get\_title() functions.

## CLASS MEMBERS

- **CL\_ClanApplication**()

  - virtual **~CL\_ClanApplication**()

  - virtual char \***get\_title**()

  - virtual void **init\_modules**()

  - virtual void **deinit\_modules**()

  - virtual int **main**(

  ```
  int argc,
  char** argv)
  ```

- static CL\_ClanApplication \***app**

  ## MEMBERS WITH DESCRIPTIONS

- **CL\_ClanApplication**()

  ```
  Description:
  ```

- virtual **~CL\_ClanApplication**()

  ```
  Description:
  ```

- virtual char \***get\_title**()

  ```
  Description:
  ```

  Every program made using ClanLib must implement this function. It returns the title of the application, which depending on the platform on which it is run, will be passed on to the operating system.

  ```
  Return value:
  ```

  The application title

- virtual void **init\_modules**()

  ```
  Description:
  ```

  Before main() is called, or before the datafile compiler is invoked, this function gets called. Use it to initialize libraries.

- virtual void **deinit\_modules**()

  ```
  Description:
  ```

  Called after main() or after the datafile compiler completes. Use it to shutdown libraries.

- virtual int **main**(

  ```
  int argc,
  char** argv)
  ```

  ```
  Parameters:
  argc - The number of arguments to the program (c-style)
  argv - A pointer to strings, containing the program arguments. The name of the program executable is always passed as first argument.
  ```

  ```
  Description:
  ```

  Every program made using ClanLib must implement this function. This is the main application function, which will be called \_once\_ following system initialization.

  ```
  Return value:
  ```

  Program return value

- static CL\_ClanApplication \***app**

  ```
  Description:
  ```

  Static pointer to an initialized instance of this class. This is set by the constructor.

## SEE ALSO

All ClanLib API classes can be found in **clanlib (3)**.

## AUTHORS

Originally written by Magnus Norddahl \<*mbn@dark.x.dtu.dk*\> and Martin Starch \<*starch@dark.x.dtu.dk*\>. ClanLib is now developed by the ClanLib Development team as an Open Source project.

The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at **http://somewhere.in.the.world.org**).

See **clanlib (3)** to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.
