Standard command-line options for GUI programs

1. Introduction

GUI programs using Castle Game Engine accept standard command-line options listed below.

Note
To developers: The options documented on this page, and in common options, are handled automatically if you follow the default "New Project" template. This happens thanks to calling Application.ParseStandardParameters from castleautogenerated.pas. You can still use Parameters singleton and Parameters.Parse in your application code to handle any remaining options.

2. Options

--fullscreen

Start in fullscreen mode.

For some programs, you can also switch between fullscreen and windowed mode at runtime. Standard key shortcut for this is F11.

--geometry WIDTHxHEIGHT

Start in window mode with given window WIDTH and HEIGHT.

--geometry WIDTHxHEIGHT<sign>XOFF<sign>YOFF

Start in window mode with given window WIDTH and HEIGHT and position window at XOFF, YOFF.

<sign> is either + or -:

  • \+XOFF means that left window border should be XOFF pixels from left screen border. Note that XOFF itself may be negative (e.g. in --geometry 100x100+-100+100) and then window will be positioned slightly offscreen.

  • -XOFF means that right window border should be XOFF pixels from right screen border.

  • Similar for +YOFF or -YOFF — they specify distance from upper or lower screen border.

Note that you can omit WIDTHxHEIGHT part and provide only <sign>XOFF<sign>YOFF part, to change window position from default, but keep default window size.

This option works the same as the standard -geometry option for most XWindows programs.

Note that window manager may disallow or modify requested window position and/or size.

--display DISPLAY-NAME

(Available only on platforms using X Windows, in practice: Linux and FreeBSD.)

Set the XWindows display to use.

--log-file

Force log to the given file. Sets LogFileName. When this is not used, we determine log location using our default logic (see Logging).

--no-limit-fps

Disables ApplicationProperties.LimitFPS, to observe maximum possible FPS. See optimization to understand when this could be useful for developers.

--capabilities automatic|force-fixed-function|force-modern

Force rendering context to have specific capabilities, to test rendering on modern or ancient GPUs. See TGLFeatures.RequestCapabilities for more information.

--pretend-touch-device

Set ApplicationProperties.TouchDevice to true. This can be useful in development, to test how does the application behave on touch devices.

3. Deprecated options

--fullscreen-custom WIDTHxHEIGHT

(Deprecated) Start in fullscreen mode with screen resolution changed to WIDTH x HEIGHT.

If given WIDTH x HEIGHT resolution is not available then error message will be shown and program will start in fullscreen mode using current screen resolution.

Note
We support changing screen resolution only on some platforms, and we don’t recommend it. See Changing the physical screen resolution.

To improve this documentation just edit this page and create a pull request to cge-www repository.