Documentation
[SDK Documentation] [GapiDraw Structs]

 

GapiDraw Structs

Overview

This document contains a list of all structs used in GapiDraw.

This document has been updated for use with GapiDraw 4.0 or later.
Last updated on October 5, 2008.

 

GDAPPCONFIG

This struct is used to create a CGapiApplication.

typedef struct _GDAPPCONFIG
{
HINSTANCE hInstance;
const TCHAR* pAppTitle;
DWORD dwMaxFPS;
DWORD dwDisplayFlags;
BOOL bEnableDoubleClick;
BOOL bMinimizedActive;
BOOL bRegainLostFocus;
DWORD dwDisplayWidth;
DWORD dwDisplayHeight;
DWORD dwDisplayZoomWidth;
DWORD dwDisplayZoomHeight;
DWORD dwDisplayBPP;
DWORD dwDisplayHz;
DWORD dwWindowIcon;
DWORD dwWindowBorder;
BOOL bDisableWindowCursor;
} GDAPPCONFIG;
Parameters
hInstance
[REQUIRED] Application instance handle. The HINSTANCE is passed as the first parameter in WinMain.
pAppTitle
[REQUIRED] The title of your application. CGapiApplication will use this name as the window title, and also appends " WndCls" to set the window class of the main window.
dwMaxFPS
[REQUIRED] Limits the number of calls to ProcessNextFrame() each second to dwMaxFPS to save battery. Set this value to 0 to call ProcessNextFrame() continuously, or if you want to synchronize the display updates with the vertical blanking period (set the flag GDDISPLAY_VSYNC in dwDisplayFlags).
dwDisplayFlags
[OPTIONAL] Flags sent directly to CGapiDisplay::OpenDisplay(). Please see the documentation on GapiDisplay for available flags.
bEnableDoubleClick
[OPTIONAL] Set this to TRUE if you want to receive double click notifications. Please note that you will receive less single clicks if double clicks are enabled.
bMinimizedActive
[OPTIONAL] Keep calling CGapiApplication::ProcessNextFrame() when the application is minimized.
bRegainLostFocus
[OPTIONAL] Regain lost focus immediately if it is lost. This can be used to enable "kiosk mode" applications running on Windows Mobile devices.
dwDisplayWidth
[OPTIONAL] (Stationary PCs) The width of the display.
dwDisplayHeight
[OPTIONAL] (Stationary PCs) The height of the display.
dwDisplayZoomWidth
[OPTIONAL] (Stationary PCs) The zoomed width of the display when windowed. Can be NULL.
dwDisplayZoomHeight
[OPTIONAL] (Stationary PCs) The zoomed height of the display when windowed. Can be NULL.
dwDisplayBPP
[OPTIONAL] (Stationary PCs) The bit depth of the display. Must be NULL or 16.
dwDisplayHz
[OPTIONAL] (Stationary PCs) The preferred refresh rate of the display. Can be NULL.
dwWindowIcon
[OPTIONAL] The icon of your main window. The window icon is visible on stationary PCs or when the application is minimized on Windows Mobile devices.
dwWindowBorder
[OPTIONAL] The border style of your main window. This only applies to applications running in windowed mode on Stationary PCs. The default border style is WS_THICKFRAME that enables a resizable border. Set this to WS_DLGFRAME if you want a window frame that cannot be resized.
bDisableWindowCursor
[OPTIONAL] The cursor is always disabled in full screen mode on Stationary PCs. Set this option if you also want to disable the mouse cursor in windowed mode.

GDBUFFERDESC

This struct is used by CGapiSurface::GetBuffer().

typedef struct _GDBUFFERDESC
{
DWORD dwWidth;
DWORD dwHeight;
LONG xPitch;
LONG yPitch;
void* pBuffer;
DWORD dwPixelFormat;
} GDBUFFERDESC;
Parameters
dwWidth
Buffer width in pixels.
dwHeight
Buffer height in pixels.
xPitch
xPitch in bytes.
yPitch
yPitch in bytes.
pBuffer
Pointer to the raw buffer.
dwPixelFormat
Pixel format - currently GDPIXELFORMAT_555 and GDPIXELFORMAT_565 are supported on CGapiSurface instances. GDPIXELFORMAT_444A, GDPIXELFORMAT_555A, and GDPIXELFORMAT_565A are used on CGapiRGBASurface instances.

GDSURFACEDESC

This struct is used by CGapiSurface::Lock().

typedef struct _GDSURFACEDESC
{
DWORD dwWidth;
DWORD dwHeight;
LONG lPitch;
WORD* pSurface;
DWORD dwPixelFormat;
} GDSURFACEDESC;
Parameters
dwWidth
Width of surface in pixels.
dwHeight
Height of surface in pixels.
lPitch
Distance, in bytes, to the start of the next line (locked surfaces are always DWORD-aligned).
pSurface
Pointer to the raw buffer. Locked surfaces are 16-bit only.
dwPixelFormat
Pixel format - currently GDPIXELFORMAT_555 and GDPIXELFORMAT_565 are supported.

GDBLTFX

This struct is used by CGapiSurface::Blt().

typedef struct _GDBLTFX
{
COLORREF dwFillColor;
DWORD dwOpacity;
LONG nRotationAngle;
DWORD dwRotationScale;
POINT rotationCenter;
} GDBLTFX;
Parameters
dwFillColor
Uses the specified color instead of source image color.
dwOpacity
Specifies opacity of the source image (0 transparent - 128 (50% quick alpha) - 255 opaque).
nRotationAngle
1/100 degrees clockwise rotation angle. Can be negative.
dwRotationScale
Scale rotated image by percentage (100 = 1:1 copy).
rotationCenter
Use the specified point on the destination surface as center for the rotation.

GDBLTFASTFX

This struct is used by CGapiSurface::BltFast().

typedef struct _GDBLTFASTFX
{
COLORREF dwFillColor;
DWORD dwOpacity;
LONG dwFXparam1;
COLORREF dwFXcolor1;
DWORD dwFXopacity;
} GDBLTFASTFX;
Parameters
dwFillColor
Uses the specified color instead of source image color.
dwOpacity
Specifies opacity of the source image (0 transparent - 128 (50% quick alpha) - 255 opaque).
dwFXparam1
Parameter1 to send to the blit effects. See documentation on CGapiSurface::BltFast for details.
dwFXcolor1
Color1 to send to the blit effects. See documentation on CGapiSurface::BltFast for details.
dwFXopacity
The amount of blending to use for the effect. See documentation on CGapiSurface::BltFast for details.

GDALPHABLTFX

This struct is used by CGapiSurface::AlphaBlt().

typedef struct _GDALPHABLTFX
{
DWORD dwOpacity;
} GDALPHABLTFX;
Parameters
dwOpacity
Specifies opacity of the source image (0 transparent - 128 (50% quick alpha) - 255 opaque).

GDALPHABLTFASTFX

This struct is used by CGapiSurface::AlphaBltFast().

typedef struct _GDALPHABLTFASTFX
{
DWORD dwOpacity;
} GDALPHABLTFASTFX;
Parameters
dwOpacity
Specifies opacity of the source image (0 transparent - 128 (50% quick alpha) - 255 opaque).

GDLINEFX

This struct is used by CGapiSurface::DrawRect() and CGapiSurface::DrawLine().

typedef struct _GDLINEFX
{
DWORD dwOpacity;
} GDLINEFX;
Parameters
dwOpacity
Specifies opacity of the line (0 transparent - 128 (50% quick alpha) - 255 opaque).

GDFILLRECTFX

This struct is used by CGapiSurface::FillRect().

typedef struct _GDFILLRECTFX
{
DWORD dwOpacity;
} GDFILLRECTFX;
Parameters
dwOpacity
Specifies opacity of the area (0 transparent - 128 (50% quick alpha) - 255 opaque).

GDGRADIENTRECTFX

This struct is used by CGapiSurface::GradientRect().

typedef struct _GDGRADIENTRECTFX
{
DWORD dwOpacity;
DWORD dwDitherMultiplier;
 
} GDGRADIENTRECTFX;
Parameters
dwOpacity
Specifies opacity of the gradient (0 transparent - 128 (50% quick alpha) - 255 opaque).
dwDitherMultiplier
Specifies the amount of dithering to add if the parameter GDGRADIENTRECT_DITHER is used. Set it to a high value for more dithering. Dithering on gradients is calculated based on the current pixel X and Y coordinate. Based on its coordinate an offset is generated to the gradient lookup table, and the higher this offset is the higher the dithering.
The formula used to dither is: Gradient LUT offset = (((x & 1) + (y & 1)) << dwDitherMultiplier)

GDPIXEL

This struct is used by CGapiSurface::SetPixels().

typedef struct _GDPIXEL
{
LONG x;
LONG y;
COLORREF dwColor;
DWORD dwFlags;
GDPIXELFX pixelfx;
} GDPIXEL;
Parameters
x
X-Coordinate of the pixel. Can be 16:16 fixed point if CGapiSurface::SetPixels() is called with the GDSETPIXELS_FIXEDPOINT flag.
y
Y-Coordinate of the pixel. Can be 16:16 fixed point if CGapiSurface::SetPixels() is called with the GDSETPIXELS_FIXEDPOINT flag.
dwColor
The color of the pixel.
dwFlags
The following table shows the possible flags.
Type Description

GDPIXEL_OPACITY

Uses the opacity value in pixelfx.dwOpacity to perform an alpha blend. Allowed range is from 0 (transparent) to 255 (opaque). If the opacity is set to 128, an optimized blending mode will be used.

GDPIXEL_DISABLED

Does not draw the current pixel.

pixelfx
A GDPIXELFX structure.

GDPIXELFX

This struct is used by CGapiSurface::SetPixels().

typedef struct _GDPIXELFX
{
DWORD dwOpacity;
} GDPIXELFX;
Parameters
dwOpacity
Specifies opacity of each pixel (0 transparent - 128 (50% quick alpha) - 255 opaque).

GDPIXELNODE

This struct is used by the linked list version of CGapiSurface::SetPixels().

typedef struct _GDPIXELNODE
{
GDPIXEL pixel;
_GDPIXELNODE* pNext;
} GDPIXELNODE;
Parameters
pixel
A GDPIXEL structure.
pNext
Pointer to the next GDPIXEL in list.

GDDRAWTEXTFX

This struct is used by CGapiSurface::Drawtext().

typedef struct _GDDRAWTEXTFX
{
 
} GDDRAWTEXTFX;
Parameters
NONE

GDKEYLIST

This struct is used by CGapiInput::GetKeyList().

typedef struct _GDKEYLIST
{
DWORD vkUp;
DWORD vkDown;
DWORD vkLeft;
DWORD vkRight;
DWORD vkStart;
DWORD vkA;
DWORD vkB;
DWORD vkC;
} GDKEYLIST;
Parameters
vkUp
Key code for up.
vkDown
Key code for down.
vkLeft
Key code for left.
vkRight
Key code for right.
vkStart
Hardware key <Start> ('<Enter>' on stationary PCs).
vkA
Hardware key #1.
vkB
Hardware key #2.
vkC
Hardware key #3.

GDFONTFX

This struct is used by CGapiBitmapFont::CreateFont().

typedef struct _GDFONTFX
{
LONG lTracking;
} GDFONTFX;
Parameters
lTracking
Put a space of n pixels between all font characters. Can be negative.

GAPIFILEBUFFER

This struct is used by CGapiFileBuffer::GetBuffer().

typedef struct _GAPIFILEBUFFER
{
DWORD dwSize;
BYTE* pBuffer;
} GAPIFILEBUFFER;
Parameters
dwSize
The size of the memory buffer in bytes.
pBuffer
A pointer to the memory buffer. Do not attempt to free this pointer, the memory will be automatically freed by CGapiFileBuffer::Close.

VFILEINFO

This struct is used by CGapiFileBuffer::GetFileInfo() and CGapiFileStream::GetFileInfo().

typedef struct _VFILEINFO
{
DWORD dwSize;
BOOL bCompressed;
} VFILEINFO;
Parameters
dwSize
The size of the file in bytes.
bCompressed
TRUE if the file is zip-compressed, FALSE if the file is uncompressed. If the file is compressed it will automatically be decompressed when opened.