36 memset(m_unk0x78, 0,
sizeof(m_unk0x78));
38 m_phonemeRefList =
NULL;
39 m_isFullscreenMovie =
FALSE;
43 m_cursorX = m_cursorY;
44 m_cursorYCopy = m_cursorY;
45 m_cursorXCopy = m_cursorY;
46 m_cursorSurface =
NULL;
47 m_fullScreenMovie =
FALSE;
64MxResult LegoVideoManager::CreateDirect3D()
97 paletteCreated =
TRUE;
100 PALETTEENTRY paletteEntries[256];
103 if (CreateDirect3D() !=
SUCCESS) {
113 if (deviceNum >= 0) {
114 if ((deviceNum = deviceEnumerate.
GetDevice(deviceNum, driver, device)) !=
SUCCESS) {
123 deviceNum = deviceEnumerate.
GetDevice(deviceNum, driver, device);
126 m_direct3d->
SetDevice(deviceEnumerate, driver, device);
146 sizeof(paletteEntries) /
sizeof(paletteEntries[0])
177 memset(&createStruct, 0,
sizeof(createStruct));
188 if (!m_3dManager->
Create(createStruct)) {
194 if (ConfigureD3DRM() !=
SUCCESS) {
199 m_viewROI =
new TimeROI(m_renderer, pLODList,
Timer()->GetTime());
205 m_3dManager->
Add(*m_viewROI);
211 m_stopWatch->
Start();
216 if (paletteCreated) {
228 if (m_cursorSurface !=
NULL) {
229 m_cursorSurface->Release();
230 m_cursorSurface =
NULL;
233 if (m_unk0x528 !=
NULL) {
234 m_unk0x528->Release();
238 if (m_arialFont !=
NULL) {
245 if (m_viewROI !=
NULL) {
246 if (m_3dManager !=
NULL) {
247 m_3dManager->
Remove(*m_viewROI);
255 delete m_phonemeRefList;
262 m_cursorX = p_cursorX;
263 m_cursorY = p_cursorY;
266 if (623 < p_cursorX) {
270 if (463 < p_cursorY) {
278 if (p_visible && !m_drawFPS) {
284 m_drawFPS = p_visible;
298 m_stopWatch->
Reset();
299 m_stopWatch->
Start();
308 while (cursor.
Next(presenter)) {
312 if (m_render3d && !m_paused) {
319 if (!m_paused && (m_render3d || m_unk0xe5)) {
333 while (cursor.
Next(presenter)) {
345 else if (m_fullScreenMovie) {
349 if (cursor.
Last(presenter)) {
368inline void LegoVideoManager::DrawCursor()
370 if (m_cursorX != m_cursorXCopy || m_cursorY != m_cursorYCopy) {
371 if (m_cursorX >= 0 && m_cursorY >= 0) {
372 m_cursorXCopy = m_cursorX;
373 m_cursorYCopy = m_cursorY;
379 if (!m_cursorSurface) {
380 m_cursorRect.top = 0;
381 m_cursorRect.left = 0;
382 m_cursorRect.bottom = 16;
383 m_cursorRect.right = 16;
386 if (!m_cursorSurface) {
387 m_drawCursor =
FALSE;
396void LegoVideoManager::DrawFPS()
398 char zeros[8] =
"0000.00";
400 if (m_unk0x528 ==
NULL) {
401 m_arialFont = CreateFontA(
414 FF_DONTCARE | VARIABLE_PITCH,
418 HDC dc = GetDC(
NULL);
419 SelectObject(dc, m_arialFont);
420 GetTextExtentPointA(dc, zeros, strlen(zeros), &m_fpsSize);
424 SetRect(&m_fpsRect, 0, 0, m_fpsSize.cx, m_fpsSize.cy);
426 if (m_unk0x528 ==
NULL) {
433 memset(&colorKey, 0,
sizeof(colorKey));
437 memset(&surfaceDesc, 0,
sizeof(surfaceDesc));
438 surfaceDesc.
dwSize =
sizeof(surfaceDesc);
441 m_unk0x528->Release();
448 char* ptr = (
char*) surfaceDesc.
lpSurface;
450 for (i = 0; i < surfaceDesc.
dwHeight; i++) {
452 ptr += surfaceDesc.
lPitch;
455 m_unk0x528->Unlock(surfaceDesc.
lpSurface);
461 if (
Timer()->GetTime() > m_unk0x54c + 5000.f) {
464 MxS32 nb = sprintf(buffer,
"%.02f", m_unk0x550 / time);
468 memset(&surfaceDesc, 0,
sizeof(surfaceDesc));
469 surfaceDesc.
dwSize =
sizeof(surfaceDesc);
473 char* ptr = (
char*) surfaceDesc.
lpSurface;
475 for (i = 0; i < surfaceDesc.
dwHeight; i++) {
477 ptr += surfaceDesc.
lPitch;
480 m_unk0x528->Unlock(surfaceDesc.
lpSurface);
484 if (m_unk0x528->GetDC(&dc) !=
DD_OK) {
485 m_unk0x528->Release();
492 SelectObject(dc, m_arialFont);
493 SetTextColor(dc,
RGB(255, 255, 0));
494 SetBkColor(dc,
RGB(0, 0, 0));
495 SetBkMode(dc, OPAQUE);
496 GetTextExtentPoint32A(dc, buffer, nb, &m_fpsSize);
499 SetRect(&rect, 0, 0, m_fpsSize.cx, m_fpsSize.cy);
500 ExtTextOutA(dc, 0, 0, ETO_OPAQUE, &rect, buffer, nb,
NULL);
501 m_unk0x528->ReleaseDC(dc);
508 if (m_unk0x528 !=
NULL) {
522 while (cursor.
Prev(presenter)) {
523 if (presenter->
IsHit(p_x, p_y)) {
539 if (!cursor.
Prev(presenter)) {
588 if (m_isFullscreenMovie != p_enable) {
589 m_isFullscreenMovie = p_enable;
598 m_fullScreenMovie =
TRUE;
622 m_fullScreenMovie =
FALSE;
637 PALETTEENTRY colorStrucure;
639 colorStrucure.peRed = (p_red * 255.0f);
640 colorStrucure.peGreen = (p_green * 255.0f);
641 colorStrucure.peBlue = (p_blue * 255.0f);
642 colorStrucure.peFlags = -124;
686 IDirect3DRMViewport* viewport;
693 IDirect3DRMDevice2* d3drmDev2 =
NULL;
694 IDirect3D2* d3d2 = m_direct3d->
Direct3D();
702 if (d3drm2->CreateDeviceFromD3D(d3d2, d3dDev2, &d3drmDev2) ==
D3DRM_OK) {
706 if (d3drm2->CreateViewport(d3drmDev2, m_camera, 0, 0, m_cameraWidth, m_cameraHeight, &viewport) ==
D3DRM_OK) {
707 viewport->SetBack(m_back);
708 viewport->SetFront(m_front);
709 viewport->SetField(m_fov);
710 viewport->SetCamera(m_camera);
711 viewport->SetProjection(m_projection);
712 viewport->SetAppData((
DWORD) m_appdata);
713 d3drmDev2->SetQuality(m_quality);
714 d3drmDev2->SetShades(m_shades);
715 d3drmDev2->SetTextureQuality(m_textureQuality);
716 d3drmDev2->SetRenderMode(m_rendermode);
717 d3drmDev2->SetDither(m_dither);
718 d3drmDev2->SetBufferCount(m_bufferCount);
739 IDirect3DRMDevice2* d3drmDev2 =
742 if (d3drmDev2 !=
NULL) {
743 IDirect3DRMViewportArray* viewportArray =
NULL;
745 if (d3drmDev2->GetViewports(&viewportArray) ==
D3DRM_OK && viewportArray !=
NULL) {
746 if (viewportArray->GetSize() == 1) {
747 IDirect3DRMViewport* viewport =
NULL;
749 if (viewportArray->GetElement(0, &viewport) ==
D3DRM_OK) {
750 m_back = viewport->GetBack();
751 m_front = viewport->GetFront();
752 m_cameraWidth = viewport->GetWidth();
753 m_cameraHeight = viewport->GetHeight();
754 m_fov = viewport->GetField();
755 viewport->GetCamera(&m_camera);
756 m_projection = viewport->GetProjection();
758 viewportArray->Release();
767 viewportArray->Release();
772 m_quality = d3drmDev2->GetQuality();
773 m_shades = d3drmDev2->GetShades();
774 m_textureQuality = d3drmDev2->GetTextureQuality();
775 m_rendermode = d3drmDev2->GetRenderMode();
776 m_dither = d3drmDev2->GetDither();
777 m_bufferCount = d3drmDev2->GetBufferCount();
778 d3drmDev2->Release();
790MxResult LegoVideoManager::ConfigureD3DRM()
792 IDirect3DRMDevice2* d3drm =
806 d3drm->SetDither(
TRUE);
[AI] Central class managing the LEGO Island 3D rendering subsystem.
BOOL Create(CreateStruct &rCreateStruct)
[AI] Initializes the LEGO 3D system using the specified creation parameters.
BOOL Add(ViewROI &rROI)
[AI] Adds a ViewROI (rendered object) to the scene.
ViewLODListManager * GetViewLODListManager()
[AI] Returns the internal ViewLODListManager instance.
double Render(double p_und)
[AI] Renders the current frame.
Lego3DView * GetLego3DView()
[AI] Returns the encapsulated Lego3DView instance.
BOOL Remove(ViewROI &rROI)
[AI] Removes a ViewROI from the scene.
BOOL SetPointOfView(ViewROI &rROI)
[AI] Sets the camera's point of view to match the given ROI.
[AI] Enumerates and manages Direct3D devices and drivers for the LEGO Island engine.
int GetDevice(int p_deviceNum, MxDriver *&p_driver, Direct3DDeviceInfo *&p_device)
[AI] Outputs pointers to the MxDriver and Direct3DDeviceInfo for the given device index.
int FUN_1009d0d0()
[AI] Finds and returns the preferred device index that supports required features.
int ParseDeviceName(const char *p_deviceId)
[AI] Parses a device string identifier and locates the matching device entry.
int FUN_1009d210()
[AI] Prunes the enumeration to only include devices/drivers that support the required display mode an...
static LegoOmni * GetInstance()
[AI] Returns the current LegoOmni singleton pointer, cast from MxOmni.
Specialized list class for managing LegoPhoneme objects.
[AI] Extends the functionality of MxVideoManager to provide LEGO Island–specific video and 3D graphic...
MxResult ResetPalette(MxBool p_ignoreSkyColor)
[AI] Resets palette entries and re-installs base palette, restoring sky color if requested.
virtual MxPresenter * GetPresenterAt(MxS32 p_x, MxS32 p_y)
[AI] Finds a presenter at the specific screen coordinates (for hit testing).
int EnableRMDevice()
[AI] Enables the Direct3D Retained Mode (RM) rendering device, and re-creates the device/viewport if ...
void UpdateView(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height) override
[AI] Notifies the manager of changes in view rectangle, updating the 3D device's viewport as needed.
void EnableFullScreenMovie(MxBool p_enable)
[AI] Convenience method to enable or disable fullscreen movie playback with default scaling.
MxResult Tickle() override
[AI] Performs per-frame update for all video, 3D, and interface layers.
~LegoVideoManager() override
[AI] Releases all allocated resources and restores graphics state.
void FUN_1007c520()
[AI] Sets rendering state to allow PutData for all overlay presenters, disables 3D main rendering.
int DisableRMDevice()
[AI] Disables the Direct3D Retained Mode (RM) rendering device and saves/restores 3D state as needed.
void OverrideSkyColor(MxBool p_shouldOverride)
[AI] Requests that the palette override the sky color entry, for movie transitions or when re-enablin...
void Destroy() override
[AI] Cleans up graphics resources, disables overlays, removes from 3D scene and releases presenters/l...
MxResult RealizePalette(MxPalette *) override
[AI] Sets the realized palette to use for rendering and updates the display surface.
void ToggleFPS(MxBool p_visible)
[AI] Toggles display of the on-screen frames-per-second (FPS) overlay.
MxPresenter * GetPresenterByActionObjectName(const char *p_char)
[AI] Searches all active presenters for one associated with the given action object name.
void SetRender3D(MxBool p_render3d)
[AI] Enables or disables main 3D rendering (e.g., used internally on video transitions).
void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY)
[AI] Updates the position of the custom software cursor overlay, and ensures it renders on the next f...
void SetSkyColor(float p_red, float p_green, float p_blue)
[AI] Sets the RGB color for the sky/background in the 3D view and updates the palette accordingly.
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
[AI] Holds assignment and description details for a Direct3D rendering device in use.
@ c_hardwareMode
[AI] Indicates that the device is a hardware rendering device.
D3DDEVICEDESC & GetDesc()
[AI] Accessor for device's current description.
unsigned int GetFlags()
[AI] Returns all flags describing hardware mode/primary device status.
const char * GetObjectName() const
[AI] Returns the object name string.
virtual int DoEnumerate()
[AI] Begins enumeration of DirectDraw drivers, their devices, and available display modes.
[AI] MxDirect3D provides Direct3D (D3D) rendering capabilities layered on top of MxDirectDraw,...
BOOL SetDevice(MxDeviceEnumerate &p_deviceEnumerate, MxDriver *p_driver, Direct3DDeviceInfo *p_device)
[AI] Selects which Direct3D device to be used for rendering, given an enumeration of available device...
IDirect3DDevice2 * Direct3DDevice()
[AI] Provides access to the currently selected Direct3D device interface.
MxAssignedDevice * AssignedDevice()
[AI] Returns the currently selected/active rendering device information for 3D output.
IDirect3D2 * Direct3D()
[AI] Provides access to the underlying IDirect3D2 interface for advanced 3D rendering operations.
BOOL Create(HWND hWnd, BOOL fullscreen_1, BOOL surface_fullscreen, BOOL onlySystemMemory, int width, int height, int bpp, const PALETTEENTRY *pPaletteEntries, int paletteEntryCount) override
[AI] Initializes DirectDraw and Direct3D, prepares primary surfaces and selects the video mode,...
IDirectDrawSurface * BackBuffer()
Returns the back buffer surface.
IDirectDraw * DirectDraw()
Returns the DirectDraw device interface pointer.
IDirectDrawSurface * FrontBuffer()
Returns the surface used as the primary/front buffer.
IDirectDrawClipper * Clipper()
Returns the current DirectDraw clipper object used for window clipping.
BOOL RestoreSurfaces()
Attempts to restore all DirectDraw surfaces that may have been lost.
LPDIRECTDRAWSURFACE FUN_100bc8b0(MxS32 width, MxS32 height)
[AI] Creates a 16-bit DirectDraw surface of specified size, either in video or system memory.
LPDIRECTDRAWSURFACE GetDirectDrawSurface1()
[AI] Returns the primary DirectDraw surface (front buffer).
virtual void SetPalette(MxPalette *p_palette)
[AI] Sets the palette used for the primary and secondary DirectDraw surfaces.
void ClearScreen()
[AI] Fills the current back buffer with black (clears the display area). [AI]
LPDIRECTDRAWSURFACE GetDirectDrawSurface2()
[AI] Returns the secondary DirectDraw surface (back buffer).
static LPDIRECTDRAWSURFACE CreateCursorSurface()
[AI] Creates and draws a 16x16 cursor DirectDraw surface.
MxVideoParam & GetVideoParam()
[AI] Gets the video parameter configuration (mode/resolution/etc) in use by this surface.
Utility for measuring the frequency (operations per second) of a repeated operation.
MxBool Last(T &p_obj)
[AI]
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
static MxOmni * GetInstance()
[AI] Returns the singleton instance of the MxOmni subsystem coordinator.
HWND GetWindowHandle() const
[AI] Gets the window handle (HWND) associated with the engine (ownership not transferred).
[AI] Encapsulates a DirectDraw 8-bit (256 color) palette for use with DirectX rendering.
LPDIRECTDRAWPALETTE CreateNativePalette()
[AI] Creates the internal DirectDraw palette object and populates it with the current palette entries...
MxResult SetEntries(LPPALETTEENTRY p_palette)
[AI] Sets the palette's RGB entries from an external array and updates the DirectDraw palette if atta...
void SetOverrideSkyColor(MxBool p_value)
[AI] Sets whether the sky color is overridden, preventing calls to SetSkyColor from effecting palette...
MxPalette * Clone()
[AI] Creates a duplicate of this palette object with the same palette data and override flag.
MxResult GetEntries(LPPALETTEENTRY p_entries)
[AI] Copies all palette entries to external buffer.
MxResult SetSkyColor(LPPALETTEENTRY p_skyColor)
[AI] Sets the "sky color" palette entry (typically index 141, reserved for sky background),...
void Reset(MxBool p_ignoreSkyColor)
[AI] Resets palette entries to default system values, optionally preserving the current sky color,...
[AI] Cursor/iterator for traversing an MxPresenterList.
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
virtual MxResult PutData()
[AI] Allows the presenter to submit pending results or output to the engine.
MxResult Tickle() override
[AI] Main tickle handler, called periodically to progress presenter's internal state.
MxS32 GetDisplayZ() const
[AI] Returns the display Z (depth) order.
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
virtual MxBool IsHit(MxS32 p_x, MxS32 p_y)
[AI] Returns TRUE if the given (x, y) falls within hit-test bounds for the presenter (e....
[AI] Rectangle using 32-bit signed integer coordinates.
T GetTop() const
[AI] Get the top edge.
T GetWidth() const
[AI] Get the rectangle's width.
T GetRight() const
[AI] Get the right edge.
T GetHeight() const
[AI] Get the rectangle's height.
T GetLeft() const
[AI] Get the left edge.
T GetBottom() const
[AI] Get the bottom edge.
virtual void Reset()
[AI] Removes all spans and resets the bounding rectangle to an empty state.
Measures elapsed wall clock time using high resolution performance counters.
void Stop()
Stops timing and accumulates the elapsed interval to m_elapsedSeconds.
void Reset()
Resets the stopwatch to zero.
double ElapsedSeconds() const
Returns the total accumulated elapsed time in seconds.
void Start()
Starts (or resumes) timing from the current moment.
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
@ e_idle
[AI] No transition is active.
virtual MxResult VTable0x28(MxVideoParam &p_videoParam, LPDIRECTDRAW p_pDirectDraw, LPDIRECT3D2 p_pDirect3D, LPDIRECTDRAWSURFACE p_ddSurface1, LPDIRECTDRAWSURFACE p_ddSurface2, LPDIRECTDRAWCLIPPER p_ddClipper, MxU32 p_frequencyMS, MxBool p_createThread)
[AI] Main DirectDraw/Direct3D allocator and presenter chain creation.
void UpdateRegion()
[AI] Updates the portion of the display surface that is marked dirty based on m_region,...
void InvalidateRect(MxRect32 &p_rect)
[AI] Invalidates a rectangular region in the display; marks it for redraw on next tick.
void Destroy() override
[AI] Releases all display/video resources, any DirectDraw/Direct3D handles, and associated objects.
MxVideoParam m_videoParam
[AI] Video configuration, containing palette, source/dest rectangles, and other state....
MxRegion * m_region
[AI] Tracks regions that have been invalidated and need to be updated/redrawn. [0x5c]
MxDisplaySurface * m_displaySurface
[AI] Concrete blitting/output surface where final image is copied each frame. [0x58]
LPDIRECTDRAW m_pDirectDraw
[AI] DirectDraw interface pointer. May be allocated here, or passed in/injected. [0x50]
void SortPresenterList()
[AI] Sorts presenters in descending Z order for proper overdraw order during tickle (bubble-sort).
MxBool GetWideViewAngle()
[AI] Get whether a wide view angle is enabled.
MxBool GetFullScreen()
[AI] Get whether fullscreen mode is enabled.
MxBool Get16Bit()
[AI] Get whether 16-bit rendering mode is selected.
void SetF2bit0(MxBool p_e)
[AI] Set secondary flag 0 (often used for internal video logic).
void SetF1bit3(MxBool p_e)
[AI] Set an additional primary flag; exact usage is unknown but may control a video mode detail.
MxBool GetF2bit0()
[AI] Get the value of secondary flag 0.
MxBool GetFlipSurfaces()
[AI] Get whether page flipping of surfaces is enabled.
MxBool GetBackBuffers()
[AI] Get whether back buffering (double buffering) is enabled.
[AI] Video parameter configuration for display and rendering, encapsulates resolution,...
void SetPalette(MxPalette *p_palette)
[AI] Assign the palette pointer (color indexing) for the video mode.
MxPalette * GetPalette()
[AI] Get the palette used for rendering (may be NULL if not set).
MxVideoParamFlags & Flags()
[AI] Access the video parameter flags (windowed/fullscreen, rendering mode, etc).
MxRect32 & GetRect()
[AI] Get the rectangle specifying the display dimensions and screen area.
char * GetDeviceName()
[AI] Get a pointer to the internal device name string (may be NULL).
void WrappedSetLocalTransform(const Matrix4 &p_transform)
Wraps SetLocalTransform, for possible override or interface uniformity.
[AI] Implements the Tgl::Device interface, encapsulates Direct3DRMDevice2 and provides rendering devi...
void SetImplementationData(IDirect3DRMDevice2 *device)
Replaces the implementation pointer [AI].
[AI] Implements Tgl::MeshBuilder; facilitates mesh construction [AI]
[AI] Implementation of Tgl::View backed by Direct3DRMViewport, handles scene rendering,...
Tgl::View * GetView() const
[AI] Gets the current view/camera for this surface.
Tgl::Device * GetDevice() const
[AI] Returns the graphics device used by this surface, e.g.
virtual Result Update()=0
[AI] Performs a device update/synchronization.
virtual Result SetBackgroundColor(float r, float g, float b)=0
[AI] Sets the background color for the view.
virtual Result Clear()=0
[AI] Clears the current contents of the view.
virtual Result ForceUpdate(unsigned long x, unsigned long y, unsigned long width, unsigned long height)=0
[AI] Forces update/redraw of a region in the view.
[AI] An extension of LegoROI that adds support for keeping and applying a base time reference (used f...
ViewLODList * Create(const ROIName &rROIName, int lodCount)
[AI] Creates and registers a new ViewLODList for a named ROI, with space for the specified number of ...
[AI] Reference-counted list of Level-of-Detail (LOD) objects associated with a single ROI (Realtime O...
int Release()
[AI] Decrements the reference count.
static undefined SetUnk101013d8(undefined p_flag)
[AI] Sets the global flag g_unk101013d8 and returns its previous value.
#define D3DPTFILTERCAPS_LINEAR
#define D3DPSHADECAPS_ALPHAFLATBLEND
#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY
struct IDirectDrawSurface FAR * LPDIRECTDRAWSURFACE
typedef DWORD(FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper
#define DDBLTFAST_SRCCOLORKEY
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
void ViewportDestroyCallback(IDirect3DRMObject *, void *)
MxTransitionManager * TransitionManager()
[AI] Accessor for the MxTransitionManager, handling level transitions, fades, and world changes....
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
MxTimer * Timer()
[AI] Returns the global simulation timer.
void DeleteObject(MxDSAction &p_dsAction)
[AI] Deletes the specified action object, removing it from the global action list.
Renderer * CreateRenderer()
[AI] Instantiates and returns a new Tgl::Renderer implementation.
@ RGB
[AI] Uses direct RGB color values. [AI]
void CalcLocalTransform(const Vector3 &p_posVec, const Vector3 &p_dirVec, const Vector3 &p_upVec, Matrix4 &p_outMatrix)
[AI] Computes a transformation matrix based on a position, direction, and up vector.
[AI] Encapsulates Direct3D device enumeration information and capability structures.
[AI] Construction parameters for initializing the 3D system.
IDirectDrawSurface * m_pFrontBuffer
[AI] DirectDraw front buffer surface
IDirect3D2 * m_direct3d
[AI] Direct3D interface
IDirectDrawPalette * m_pPalette
[AI] Color palette for indexed display modes
IDirect3DDevice2 * m_d3dDevice
[AI] Direct3D device to use for rendering
HWND m_hWnd
[AI] Window handle to associate DirectDraw surfaces with
IDirectDrawSurface * m_pBackBuffer
[AI] DirectDraw back buffer surface
IDirectDraw * m_pDirectDraw
[AI] Pointer to active DirectDraw interface
BOOL m_isFullScreen
[AI] TRUE if 3D system should run in full-screen mode
BOOL m_isWideViewAngle
[AI] TRUE for wide-angle (FOV) projection
[AI] Holds data about a DirectDraw driver including devices and supported display modes.
DDCAPS m_ddCaps
[AI] Capabilities structure as reported by the driver.
DWORD dwTextureFilterCaps
DWORD dwSVBRops[DD_ROP_SPACE]
DDPIXELFORMAT ddpfPixelFormat