coastline 0.0.4
Loading...
Searching...
No Matches
DirectDrawRenderer Class Reference

The DirectDraw and Direct3D objects of a window. More...

#include <renderer.h>

Public Member Functions

D3DMaterial * GetMaterial () const
int GetDeviceInit () const
int GetFlags () const
void AddFlags (int flags)
 Add flags to the renderer flags.
void RemoveFlags (int flags)
 Remove flags from the renderer flags.
int GetRenderStateFlags () const
int GetGdiModeRefCount () const
DirectDrawDriver * GetDriver () const
DisplayMode * GetMode () const
D3DDeviceNode * GetDevice () const
IDirectDraw2 * GetDirectDraw2 () const
IDirect3D2 * GetDirect3D2 () const
IDirectDrawSurface * GetPrimarySurface () const
IDirectDrawSurface * GetBackBuffer () const
IDirect3DDevice2 * GetD3DDevice () const
IDirect3DViewport2 * GetViewport () const
 DirectDrawRenderer ()
 Clear the renderer.
void Cleanup ()
 Release every object of the renderer and forget its window.
HRESULT InitializeWindow (HWND hWnd, GUID *pDriverGuid, int nWidth, int nHeight, int nBitDepth, void *pSurfaceFormat, GUID *pDeviceGuid, bool bOption)
 Select a driver, a device, and a mode, and create the objects that draw into a window.
HRESULT BeginRenderScene ()
 Create the material of the background of the viewport.
void FlipPrimarySurfaceAndWait ()
 Flip the back buffer to the front, waiting first until the front buffer can flip when g_bD3DWaitCanFlip is set and afterwards until the flip is done when g_bD3DWaitFlipDone is set.
int SwitchDisplayModeAndRebuildDevice (int nWidth, int nHeight, int nBitDepth, int nExtra)
 Switch the display mode of the window and create the device again.
HRESULT ChangeDisplayModeAndReinitDirectDraw (GUID *pGuid, D3DDeviceNode *pDevice, DisplayMode *pMode)
 Move the renderer to another DirectDraw driver, a device, and a display mode, and create its DirectDraw objects again.
HRESULT SetDeviceNotificationCallback (RenderHost *pRenderHost)
 Give the renderer the host that draws through it, and give the host the renderer.
HRESULT SetPrimarySurfacePalette ()
 Give the palette to the front buffer.
HRESULT AdjustGdiModeRefCount (bool bEnter)
 Give the screen to GDI or take it back.
HRESULT RestoreLostSurfaces ()
 Restore the front, back, and depth buffers that were lost, and the textures of the host.
HRESULT GetDeviceViewportRect (RECT *pRect)
 The rectangle of the viewport.

Detailed Description

The DirectDraw and Direct3D objects of a window.

Constructor & Destructor Documentation

◆ DirectDrawRenderer()

DirectDrawRenderer::DirectDrawRenderer ( )

Clear the renderer.

Ghidra address:
BRD3D: 0x1000a190

Member Function Documentation

◆ GetMaterial()

D3DMaterial * DirectDrawRenderer::GetMaterial ( ) const
inline
Returns
The renderer's active material.

◆ GetDeviceInit()

int DirectDrawRenderer::GetDeviceInit ( ) const
inline
Returns
The device initialisation state.

◆ GetFlags()

int DirectDrawRenderer::GetFlags ( ) const
inline
Returns
The renderer flags.

◆ AddFlags()

void DirectDrawRenderer::AddFlags ( int flags)
inline

Add flags to the renderer flags.

◆ RemoveFlags()

void DirectDrawRenderer::RemoveFlags ( int flags)
inline

Remove flags from the renderer flags.

◆ GetRenderStateFlags()

int DirectDrawRenderer::GetRenderStateFlags ( ) const
inline
Returns
The active render-state flags.

◆ GetGdiModeRefCount()

int DirectDrawRenderer::GetGdiModeRefCount ( ) const
inline
Returns
The count of requests to display GDI mode.

◆ GetDriver()

DirectDrawDriver * DirectDrawRenderer::GetDriver ( ) const
inline
Returns
The selected DirectDraw driver.

◆ GetMode()

DisplayMode * DirectDrawRenderer::GetMode ( ) const
inline
Returns
The selected display mode.

◆ GetDevice()

D3DDeviceNode * DirectDrawRenderer::GetDevice ( ) const
inline
Returns
The selected Direct3D device.

◆ GetDirectDraw2()

IDirectDraw2 * DirectDrawRenderer::GetDirectDraw2 ( ) const
inline
Returns
The DirectDraw 2 interface.

◆ GetDirect3D2()

IDirect3D2 * DirectDrawRenderer::GetDirect3D2 ( ) const
inline
Returns
The Direct3D 2 interface.

◆ GetPrimarySurface()

IDirectDrawSurface * DirectDrawRenderer::GetPrimarySurface ( ) const
inline
Returns
The primary DirectDraw surface.

◆ GetBackBuffer()

IDirectDrawSurface * DirectDrawRenderer::GetBackBuffer ( ) const
inline
Returns
The back buffer.

◆ GetD3DDevice()

IDirect3DDevice2 * DirectDrawRenderer::GetD3DDevice ( ) const
inline
Returns
The Direct3D device interface.

◆ GetViewport()

IDirect3DViewport2 * DirectDrawRenderer::GetViewport ( ) const
inline
Returns
The Direct3D viewport.

◆ Cleanup()

void DirectDrawRenderer::Cleanup ( )

Release every object of the renderer and forget its window.

Ghidra address:
BRD3D: 0x1000a1c0

◆ InitializeWindow()

HRESULT DirectDrawRenderer::InitializeWindow ( HWND hWnd,
GUID * pDriverGuid,
int nWidth,
int nHeight,
int nBitDepth,
void * pSurfaceFormat,
GUID * pDeviceGuid,
bool bOption )

Select a driver, a device, and a mode, and create the objects that draw into a window.

A failure releases what was created.

Parameters
hWndThe window.
pDriverGuidThe DirectDraw driver, or nullptr for the default.
nWidthThe width of the mode, or 0.
nHeightThe height of the mode, or 0.
nBitDepthThe bits of a pixel of the mode, or 0.
pSurfaceFormatThe format of the surfaces, or nullptr.
pDeviceGuidThe Direct3D device, or nullptr for the default.
bOptionWhether bit 2 of dwFlags is set. Its meaning is not recovered yet.
Returns
S_OK, or the error of the step that failed.
Ghidra address:
BRD3D: 0x1000a1e0

◆ BeginRenderScene()

HRESULT DirectDrawRenderer::BeginRenderScene ( )

Create the material of the background of the viewport.

Returns
S_OK, or the error of Direct3D.
Ghidra address:
BRD3D: 0x1000af00

◆ FlipPrimarySurfaceAndWait()

void DirectDrawRenderer::FlipPrimarySurfaceAndWait ( )

Flip the back buffer to the front, waiting first until the front buffer can flip when g_bD3DWaitCanFlip is set and afterwards until the flip is done when g_bD3DWaitFlipDone is set.

g_bRenderTargetCleared is cleared.

Ghidra address:
BRD3D: 0x1000b610

◆ SwitchDisplayModeAndRebuildDevice()

int DirectDrawRenderer::SwitchDisplayModeAndRebuildDevice ( int nWidth,
int nHeight,
int nBitDepth,
int nExtra )

Switch the display mode of the window and create the device again.

Parameters
nWidthThe width of the display mode.
nHeightThe height of the display mode.
nBitDepthThe bits of a pixel of the display mode.
nExtraThe fourth value of the display mode.
Returns
The result of the switch. Its meaning is not recovered yet.
Ghidra address:
BRD3D: 0x1000b4d0

◆ ChangeDisplayModeAndReinitDirectDraw()

HRESULT DirectDrawRenderer::ChangeDisplayModeAndReinitDirectDraw ( GUID * pGuid,
D3DDeviceNode * pDevice,
DisplayMode * pMode )

Move the renderer to another DirectDraw driver, a device, and a display mode, and create its DirectDraw objects again.

Parameters
pGuidThe GUID of the driver.
pDeviceThe device.
pModeThe display mode.
Returns
S_OK, or the error of the move.
Ghidra address:
BRD3D: 0x1000b390

◆ SetDeviceNotificationCallback()

HRESULT DirectDrawRenderer::SetDeviceNotificationCallback ( RenderHost * pRenderHost)

Give the renderer the host that draws through it, and give the host the renderer.

Parameters
pRenderHostThe host.
Returns
S_OK, or E_INVALIDARG without a host.
Ghidra address:
BRD3D: 0x1000b280

◆ SetPrimarySurfacePalette()

HRESULT DirectDrawRenderer::SetPrimarySurfacePalette ( )

Give the palette to the front buffer.

Returns
S_OK, or the error of DirectDraw.
Ghidra address:
BRD3D: 0x1000b150

◆ AdjustGdiModeRefCount()

HRESULT DirectDrawRenderer::AdjustGdiModeRefCount ( bool bEnter)

Give the screen to GDI or take it back.

The screen goes to GDI on the first request and comes back on the last.

Parameters
bEnterWhether the screen goes to GDI.
Returns
S_OK, the error of the change, or RENDERER_E_NOT_IN_GDI_MODE for a return that was not requested.
Ghidra address:
BRD3D: 0x1000b220

◆ RestoreLostSurfaces()

HRESULT DirectDrawRenderer::RestoreLostSurfaces ( )

Restore the front, back, and depth buffers that were lost, and the textures of the host.

Returns
S_OK, the error of a restore, or RENDERER_E_NOT_READY.
Ghidra address:
BRD3D: 0x1000b2c0

◆ GetDeviceViewportRect()

HRESULT DirectDrawRenderer::GetDeviceViewportRect ( RECT * pRect)

The rectangle of the viewport.

Parameters
pRectReceives the rectangle.
Returns
S_OK, or RENDERER_E_NOT_READY.
Ghidra address:
BRD3D: 0x1000b350

The documentation for this class was generated from the following file: