Skip to main content

ghost: Soul of the windowmanager Module

  • Chapter
  • First Online:
Core Blender Development
  • 979 Accesses

Abstract

This chapter illustrates the dividing line between “core” Blender source code and one of the most fundamental of Blender’s internal support libraries called ghost. We will uncover the connection between ghost and windowmanager, the module that provides the underpinnings for Blender’s window-based application. Importantly, Blender is also an OpenGL program. We outline the required steps client programs must undertake to obtain a platform-specific window, along with an associated rendering context. Additionally, we discuss how you may write your own OpenGL application on top of ghost. Following this, we show how the windowmanager itself calls ghost. This allows the windowmanager module to abstract the windowing system, which is part of the underlying operating system.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 49.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    GLUT (Graphics Library Utility Toolkit) was an early cross-platform support library for creating operating system-specific windows and an OpenGL rendering context. The original version was written by Mark Kilgard, the author of the “Green Book,” i.e., OpenGL Programming for the X Windows System. Following Kilgard’s GLUT, freeglut was used extensively by the “Red Book” (i.e., the OpenGL Programming Guide) until its ninth edition.

  2. 2.

    Today, most introductory texts on OpenGL development use an analog to the GLUT library called GLFW (Graphics Library Framework).

  3. 3.

    A software “toolkit” does not require such an abstraction of the event loop. However, GLUT also maintained the event loop for applications using it, despite it generally being called a “toolkit.”

  4. 4.

    For versions of Blender prior to 2.64, the POSIX C standard library’s interface is imported via <pwd.h> in GHOST_SystemPathsUnix.cpp, which provides access to the system file etc/passwd, a text-file database of information about the current user, including the user’s home directory.

  5. 5.

    Formerly X Desktop Group, an open source project providing standard interfaces to desktop environments using X11 windowing systems.

  6. 6.

    This is noted in the intern/ghost/GHOST_ISystem.h comments. See reference to abbreviated comment section in Listing 3-1.

  7. 7.

    The graph was created using graphviz (graphviz.org) and Doxygen (doxygen.nl).

  8. 8.

    “NDOF” is used for a 3D Mouse. It can be excluded from a build.

  9. 9.

    It should be noted that the GHOST_C-Test.c uses immediate mode OpenGL calls and a fixed function pipeline. Thus, with OpenGL versions above 3.0, GHOST_C-Test.c will not work.

  10. 10.

    We went over the execution path reaching WM_init() from Blender’s main entry point (source/creator/creator.c) in Chapter 2, regarding the “startup” blend file.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Author(s), under exclusive license to APress Media, LLC , part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Hollister, B.E. (2021). ghost: Soul of the windowmanager Module. In: Core Blender Development. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-6415-7_3

Download citation

Publish with us

Policies and ethics