Windows Extensions


Introduction

The core platform independent standard of OpenPTC 1.0 exposes a lot of common functionality across a large range of different graphics platforms. However, some things, no matter how useful, just dont make any sense in a platform independent standard so they had to be left out.

So that users of OpenPTC can still have full access to the underlying graphics platform functionality that they need, each distribution implements extensions to the standard. These extensions are protected by signature defines for portability.

The signature define of OpenPTC for Windows is __PTC_WIN32__, and the signature define for the OpenPTC for Windows extensions is __PTC_WIN32_EXTENSIONS__.

If you choose to use any of the extensions below, you should make sure that you wrap the code with #ifdef __PTC_WIN32_EXTENSIONS__ for portability to other platforms.

You can also use the signature define __PTC_WIN32__ to wrap around the WinMain and main so that your application is compilable on Win32 and other platforms without any changes.


Console Extensions

HWND Console::window()
LPDIRECTDRAW Console::lpDD()
LPDIRECTDRAW2 Console::lpDD2()
LPDIRECTDRAWSURFACE Console::lpDDS()
LPDIRECTDRAWSURFACE Console::lpDDS_primary()
LPDIRECTDRAWSURFACE Console::lpDDS_secondary()
void Console::open(HWND window,int pages = 0);
void Console::open(HWND window,const Format &format,int pages = 0);
void Console::open(HWND window,int width,int height,const Format &format,int pages = 0);
void Console::open(HWND window,const Mode &mode,int pages = 0);