Subsystems

Introduction

PureBasic integrated commandset relies on available OS libraries. Sometimes, there is different way to achieve the same goal and when it makes sense, PureBasic offers the possibility to change the used underlying libraries for specific commands, without changing one line of source code. For example, on Windows there is the 'DirectX11' subsystem available, which will use DirectX functions to render sprites, instead of OpenGL (which is the default subsystem). It can be useful to use DirectX instead of OpenGL when wanting a bit quicker rendering on Windows.

To enable a subsystem, its name has to be set in the IDE compiler options, or through the /SUBSYSTEM command-line switch. This is a compile time option, which means an executable can not embed more than one subsystem at once. If multiple support is needed (for example shipping an OpenGL and DirectX version of a game), two executables needs to be created.

The available subsystems are located in the PureBasic 'subsystems' folder. Any residents or libraries found in this drawer will have precedency over the default libraries and residents, when a subsystem is specified. Any number of different subsystems can be specified (as long it doesn't affect the same libraries). As a subsystem is a directory, the subsystem name is case-sensitive on Linux but not on Windows or OS X.

The Subsystem compiler function can be used to detect if a specific subsystem is used for the compilation.

Available subsystems

Here is a list of available subsystems, and the affected libraries:

Windows
  DirectX9: use DirectX 9 instead of OpenGL. Affected libraries: 
          - Sprite
          - Screen
          - Note: 3D engine no more available as it uses OpenGL
  DirectX11: use DirectX 11 instead of OpenGL. Affected libraries: 
          - Sprite
          - Screen
          - Note: 3D engine no more available as it uses OpenGL

Linux
  gtk2: Affected libraries:
          - 2D Drawing
          - AudioCD
          - Clipboard
          - Desktop
          - Drag & Drop
          - Font
          - Gadget
          - Image
          - Menu
          - Movie
          - Printer
          - Requester
          - Scintilla
          - StatusBar
          - SysTray
          - Toolbar
          - Window
          
  qt: Affected libraries:
          - 2D Drawing
          - AudioCD
          - Clipboard
          - Desktop
          - Drag & Drop
          - Font
          - Gadget
          - Image
          - Menu
          - Movie
          - Printer
          - Requester
          - Scintilla
          - StatusBar
          - SysTray
          - Toolbar
          - Window          

MacOS X
  None