|
coastline 0.0.4
|
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. | |
The DirectDraw and Direct3D objects of a window.
| DirectDrawRenderer::DirectDrawRenderer | ( | ) |
Clear the renderer.
|
inline |
|
inline |
|
inline |
|
inline |
Add flags to the renderer flags.
|
inline |
Remove flags from the renderer flags.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void DirectDrawRenderer::Cleanup | ( | ) |
Release every object of the renderer and forget its window.
| 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.
| hWnd | The window. |
| pDriverGuid | The DirectDraw driver, or nullptr for the default. |
| nWidth | The width of the mode, or 0. |
| nHeight | The height of the mode, or 0. |
| nBitDepth | The bits of a pixel of the mode, or 0. |
| pSurfaceFormat | The format of the surfaces, or nullptr. |
| pDeviceGuid | The Direct3D device, or nullptr for the default. |
| bOption | Whether bit 2 of dwFlags is set. Its meaning is not recovered yet. |
| HRESULT DirectDrawRenderer::BeginRenderScene | ( | ) |
Create the material of the background of the viewport.
| 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.
| int DirectDrawRenderer::SwitchDisplayModeAndRebuildDevice | ( | int | nWidth, |
| int | nHeight, | ||
| int | nBitDepth, | ||
| int | nExtra ) |
Switch the display mode of the window and create the device again.
| nWidth | The width of the display mode. |
| nHeight | The height of the display mode. |
| nBitDepth | The bits of a pixel of the display mode. |
| nExtra | The fourth value of the display mode. |
| HRESULT DirectDrawRenderer::ChangeDisplayModeAndReinitDirectDraw | ( | GUID * | pGuid, |
| D3DDeviceNode * | pDevice, | ||
| DisplayMode * | pMode ) |
| HRESULT DirectDrawRenderer::SetDeviceNotificationCallback | ( | RenderHost * | pRenderHost | ) |
Give the renderer the host that draws through it, and give the host the renderer.
| pRenderHost | The host. |
| HRESULT DirectDrawRenderer::SetPrimarySurfacePalette | ( | ) |
Give the palette to the front buffer.
| 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.
| bEnter | Whether the screen goes to GDI. |
| HRESULT DirectDrawRenderer::RestoreLostSurfaces | ( | ) |
Restore the front, back, and depth buffers that were lost, and the textures of the host.
The rectangle of the viewport.
| pRect | Receives the rectangle. |