Configuring a window

Some parameters in a REDsdk window can't be modified after its creation. All these parameters are stored in the RED::WindowRenderInfo class that can be optionally sent to RED::Factory::CreateREDWindow method.

RED::WindowRenderInfo

The RED::WindowRenderInfo class lists parameters that can be toggled to customize the window creation, and that can't be modified afterwards:

Adjusting the window size with OS decorations

The real size of the REDsdk rendering window should take into consideration the operating system decorations that can modify the real visible size of the display area. The code snippet below illustrates this:

// If we want a rendering window whose dimensions are set to 'width' and 'height' pixels:
int width = 1200;
int height = 800;

// On Windows, adjust the window dimensions to take the system window decorations into consideration:
RECT rect;
rect.top    = 0;
rect.left   = 0;
rect.bottom = height;
rect.right  = width;

AdjustWindowRectEx( &rect, WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_VISIBLE, NULL, WS_EX_CLIENTEDGE );

HWND hwnd = CreateWindowEx( WS_EX_CLIENTEDGE,
                            L"REDsdk",
                            L"myWindow",
                            WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_VISIBLE,
                            0, 0, ( rect.right - rect.left ), ( rect.bottom - rect.top ),
                            NULL, NULL, GetModuleHandle( NULL ), NULL );

RED_RC rc;
RED::Object* window = RED::Factory::CreateREDWindow( *resmgr, hwnd, width, height, NULL, rc );