Windows Options


Introduction

Options strings give users of an OpenPTC distribution control over aspects of specific internal details that cannot be expressed in the platform independent OpenPTC API. For example, one platform may introduce an option string of "windowed output" which would force the console to output in a window instead of fullscreen.

You can pass option strings to both consoles and surfaces. Most options apply to consoles only, some apply to both surfaces and consoles. A few options apply to several implementations of OpenPTC, but most apply to only a specific implementation.

To pass an option to a surface or a console you do the following:

// set surface option
surface.option("enable dithering");

// set console option
console.option("windowed output");

Remember that option strings are case independent, and that its safe to pass an option string that is not supported by the implementation (the option function just returns false).

For your convenience every implementation of OpenPTC reads console options from the file "ptc.cfg" in the current dir, if it exists, when a console is created. This lets you, and your users pass options strings easily without having to recompile. "ptc.cfg" is just a plain text file in which each line is passed to the console as an option string.

NOTE: options in a merged distribution behave in a slightly different way to normal. If you want to pass options before the console is opened, you have to manually specify which console the options are directed to. In the case of this distribution, you have to choose "DirectX" for the console options listed below like this:

// create console
Console console;

// set console options
console.option("DirectX");  // this is required!
console.option("fullscreen output");
console.option("default width 640");
console.option("default height 480");
// open console
console.open(...);


Options that apply to both surfaces and consoles

"enable dithering"

"disable dithering"


Options that apply to consoles only

"default output"

"windowed output"

"default output"

"default width [n]"

"default height [n]"

"default bits [n]"

"frequency [n]"

"resizable window"

"fixed window"

"center window"

"default window position"

"windowed primary direct"

"windowed primary secondary"

"fullscreen primary direct"

"fullscreen primary secondary"

"synchronized update"

"unsynchronized update"

"default nearest"

"center nearest"

"stretch nearest"

"default cursor"

"show cursor"

"hide cursor"

"enable key buffering"

"disable key buffering"

"enable logging"

"disable logging"

"enable blocking"

"disable blocking"