Blender V5.3
GHOST

Introduction

GHOST is yet another acronym. It stands for "Generic Handy Operating System Toolkit". It has been created to replace the OpenGL utility tool kit GLUT. GLUT was used in Blender until the point that Blender needed to be ported to Apple's Mac OSX. Blender needed a number of modifications in GLUT to work but the GLUT sources for OSX were unavailable at the time. The decision was made to build our own replacement for GLUT. In those days, NaN Technologies BV was the company that developed Blender.

Enough history. What does GHOST have to offer?
In short: everything that Blender needed from GLUT to run on all its supported operating systems and some extra's. This includes :

  • Time(r) management.
  • Display/window management (windows are only created on the main display).
  • Event management.
  • Cursor shape management (no custom cursors for now).
  • Access to the state of the mouse buttons and the keyboard.
  • Menus for windows with events generated when they are accessed (this is work in progress).
  • Video mode switching.
  • Copy/Paste buffers.
  • System paths.

Font management has been moved to a separate library.

Platforms

GHOST supports the following platforms:

  • macOS Cocoa.
  • Microsoft Windows.
  • X11 (Linux).
  • Wayland (Linux).
  • SDL3.
  • null (headless mode).

GHOST

GHOST is not build standalone however there are tests in intern/ghost/test

Interface

The GHOST C++ API consists of the following files:

For an example of using the GHOST API, have a look at the GHOST_Test.cpp program in the ?/ghost/test/gears/ directory.

Work in progress

Todo
write WIP section