Public Member Functions | |
DisplayDIB (GameApp *pGameApp) | |
Default constructor. | |
Public Member Functions inherited from Burger::Display | |
const Burger::StaticRTTI * | get_StaticRTTI (void) const noexcept override |
Get the description to the class. | |
Display (GameApp *pGameApp) | |
Default constructor. | |
virtual | ~Display () |
Default destructor. | |
uint_t | Init (uint_t uWidth, uint_t uHeight, uint_t uDepth=32, uint_t uFlags=DEFAULTFLAGS) |
Initialize the display. | |
void | Shutdown (void) |
Shut down the current video display context. | |
void | BeginScene (void) |
Prepare the display for rendering. | |
void | EndScene (void) |
Render the scene to the display. | |
Texture * | CreateTextureObject (void) |
VertexBuffer * | CreateVertexBufferObject (void) |
void | Resize (uint_t uWidth, uint_t uHeight) |
void | SetViewport (uint_t uX, uint_t uY, uint_t uWidth, uint_t uHeight) |
void | SetScissorRect (uint_t uX, uint_t uY, uint_t uWidth, uint_t uHeight) |
void | SetClearColor (float fRed, float fGreen, float fBlue, float fAlpha) |
void | SetClearDepth (float fDepth) |
void | Clear (uint_t uMask) |
void | Bind (Texture *pTexture, uint_t uIndex=0) |
void | Bind (Effect *pEffect) |
void | SetBlend (uint_t bEnable) |
void | SetBlendFunction (eSourceBlendFactor uSourceFactor, eDestinationBlendFactor uDestFactor) |
void | SetLighting (uint_t bEnable) |
void | SetZWrite (uint_t bEnable) |
void | SetDepthTest (eDepthFunction uDepthFunction) |
void | SetCullMode (eCullMode uCullMode) |
void | SetScissor (uint_t bEnable) |
void | DrawPrimitive (ePrimitiveType uPrimitiveType, VertexBuffer *pVertexBuffer) |
void | DrawElements (ePrimitiveType uPrimitiveType, VertexBuffer *pVertexBuffer) |
tagWINDOWPLACEMENT * | GetWindowedPlacement (void) noexcept |
Return the pointer to a WINDOWPLACEMENT. | |
uint_t | HandleMinMax (HWND__ *pWindow, uintptr_t lParam) |
Handler for WM_GETMINMAXINFO events. | |
virtual void | CheckForWindowSizeChange (void) |
Resize the back buffer if the window size changed. | |
virtual void | CheckForWindowChangingMonitors (void) |
Check if the window has changed monitors. | |
D3DVertexShader * | CreateVertexShader (const void *pVertexShaderBinary) const |
D3DPixelShader * | CreatePixelShader (const void *pPixelShaderBinary) const |
D3DDevice * | GetD3DDevice (void) const noexcept |
void | InitState (void) |
uint_t | IsWideScreen (void) noexcept |
uint_t | IsHiDef (void) noexcept |
uint_t | IsInterlaced (void) noexcept |
NSView * | GetView (void) const noexcept |
Get the window's NSView. | |
NSWindowController * | GetWindowController (void) const noexcept |
Get the window's NSWindowController. | |
NSOpenGLView * | GetOpenGLView (void) const noexcept |
Get the window's NSOpenGLView. | |
_CGLContextObject * | GetOpenGLContext (void) const noexcept |
Get the window's _CGLContextObject. | |
NSWindow * | GetFullScreenWindow (void) const noexcept |
Get the window pointer. | |
void | SetFullScreenWindow (NSWindow *pFullScreenWindow) noexcept |
Enable a full screen window and disable the primary game window. | |
EAGLContext * | GetGLContext (void) const noexcept |
The currently active OpenGL context. | |
uint_t | GetFrontBuffer (void) const noexcept |
Front buffer index. | |
uint_t | GetColorBuffer (void) const noexcept |
Color buffer index. | |
uint_t | GetDepthBuffer (void) const noexcept |
Depth buffer index. | |
void | Pause (uint_t bPauseRendering) |
Pause or resume rendering. | |
Texture * | GetBoundTexture (uint_t uIndex=0) const noexcept |
Texture * | CreateTexture (Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping and filters preset. | |
Texture * | CreateTexture (uint_t uWidth, uint_t uHeight, Image::ePixelTypes uPixelType, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with buffer and wrapping and filters preset. | |
Texture * | CreateTexturePNG (const char *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTexturePNG (Filename *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTexturePNG (RezFile *pRezFile, uint_t uRezNum, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTextureGIF (const char *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTextureGIF (Filename *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTextureGIF (RezFile *pRezFile, uint_t uRezNum, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTextureTGA (const char *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTextureTGA (Filename *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTextureTGA (RezFile *pRezFile, uint_t uRezNum, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTextureBMP (const char *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTextureBMP (Filename *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
Texture * | CreateTextureBMP (RezFile *pRezFile, uint_t uRezNum, Texture::eWrapping uWrapping, Texture::eFilter uFilter) |
Create a texture object with wrapping, filters and a texture source. | |
VertexBuffer * | CreateVertexBuffer (const VertexBuffer::VertexAoS_t *pDescription) |
Create a vertex buffer object with from a vertex description. | |
void | SetPalette (uint_t uStart, uint_t uCount, const uint8_t *pPalette) |
Update the color palette. | |
void | SetPalette (uint_t uStart, uint_t uCount, const RGBAWord8_t *pPalette) |
Update the color palette. | |
void | SetBorderColor (uint_t uColor) |
Update the display border color. | |
void | SetWindowTitle (const char *pTitle) |
Set the display window title. | |
void | SetPaletteBlack (void) |
Set the screen palette to all black. | |
void | SetPaletteWhite (void) |
Set the screen palette to all white. | |
void | SetPalette (const uint8_t *pPalette) |
Update the color palette. | |
void | SetPalette (const RGBAWord8_t *pPalette) |
Update the color palette. | |
void | SetPalette (void **pHandle) |
Update the color palette using a memory handle. | |
void | SetPalette (RezFile *pRez, uint_t uResID) |
Update the color palette using a resource. | |
void | SetPalette (uint_t uStart, uint_t uCount, RezFile *pRez, uint_t uResID) |
Update a partial color palette using a resource. | |
void | FadeTo (const uint8_t *pPalette, FadeProc pProc=nullptr, void *pData=nullptr) |
Fade the hardware palette to a palette. | |
void | FadeToBlack (FadeProc pProc=nullptr, void *pData=nullptr) |
Fade the hardware palette to black. | |
void | FadeToWhite (FadeProc pProc=nullptr, void *pData=nullptr) |
Fade the hardware palette to white. | |
void | FadeTo (RezFile *pRez, uint_t uResID, FadeProc pProc=nullptr, void *pData=nullptr) |
Fade the hardware palette to a palette. | |
void | FadeTo (void **pHandle, FadeProc pProc=nullptr, void *pData=nullptr) |
Fade the hardware palette to a palette. | |
GameApp * | GetGameApp (void) const noexcept |
Get the parent application pointer. | |
uint_t | GetWidth (void) const noexcept |
Get the width in pixels of the display buffer. | |
uint_t | GetHeight (void) const noexcept |
Get the height in pixels of the display buffer. | |
uint_t | GetDepth (void) const noexcept |
Get the depth in bits of the display buffer. | |
uint_t | GetFlags (void) const noexcept |
Get the flags associated with this Display class instance. | |
uint_t | GetDisplayWidth (void) const noexcept |
Get the width in pixels of the display hardware. | |
uint_t | GetDisplayHeight (void) const noexcept |
Get the height in pixels of the display hardware. | |
float | GetWidthFloat (void) const noexcept |
Get the width in pixels of the display buffer. | |
float | GetHeightFloat (void) const noexcept |
Get the height in pixels of the display buffer. | |
float | GetAspectRatioX (void) const noexcept |
Get the aspect ratio in the format of width/height. | |
float | GetAspectRatioY (void) const noexcept |
Get the aspect ratio in the format of height/width. | |
eAspectRatio | GetAspectRatio (void) const |
Get the enumeration of the screen aspect ratio. | |
const uint8_t * | GetPalette (void) const noexcept |
Get the current palette. | |
uint_t | GetBorderColor (void) const noexcept |
Get the hardware border color. | |
uint_t | GetFadeSpeed (void) const noexcept |
Return the timer constant in Burger::Tick. | |
void | SetFadeSpeed (uint_t uPaletteFadeSpeed) noexcept |
Set the timer constant in Burger::Tick. | |
uint_t | GetPaletteVSync (void) const noexcept |
Return non-zero if palette updates are synced to vertical blank. | |
void | SetPaletteVSync (uint_t bPaletteVSync) noexcept |
Set the flag to enable palette updates. | |
void | SetResizeCallback (ResizeProc pResize, void *pResizeData) noexcept |
Set window resize callback. | |
ResizeProc | GetResizeCallback (void) const noexcept |
Return the function pointer for the callback when the window's size is changed. | |
void * | GetResizeCallbackData (void) const noexcept |
Return the window resize function. | |
void | SetRenderCallback (RenderProc pRender, void *pRenderData) noexcept |
Set window update function. | |
RenderProc | GetRenderCallback (void) const noexcept |
Set the window updat function. | |
void * | GetRenderCallbackData (void) const noexcept |
Get the redraw callback function. | |
void | SetReleaseCallback (ReleaseProc pRelease, void *pReleaseData) noexcept |
Set the purge callback. | |
ReleaseProc | GetReleaseCallback (void) const noexcept |
Purge resource callback. | |
void * | GetReleaseCallbackData (void) const noexcept |
Return pointer to callback void *. | |
Public Member Functions inherited from Burger::Base | |
const char * | get_class_name (void) const noexcept |
Get the name of the class. | |
virtual | ~Base () noexcept=default |
Destructor. | |
Protected Member Functions | |
virtual uint_t | InitContext (void) |
Initialize a windowed video context. | |
virtual void | PostShutdown (void) |
Shut down a windowed video context. | |
virtual void | PostEndScene (void) |
Update the window assuming the entire buffer must be redrawn. | |
Protected Member Functions inherited from Burger::Display | |
void | InitDefaults (GameApp *pGameApp) |
Initialize shared variables. | |
void | SetWidthHeight (uint_t uWidth, uint_t uHeight) |
Set the width and height of the screen. | |
Protected Attributes | |
HDC__ * | m_pWindowDC |
Pointer to the window's device context. | |
HDC__ * | m_pBitMapDC |
Pointer to the BitMap's device context. | |
Protected Attributes inherited from Burger::Display | |
GameApp * | m_pGameApp |
Pointer to the game application instance. | |
Renderer * | m_pRenderer |
Pointer to a renderer. | |
uint32_t | m_WindowPlacement [11] |
WINDOWPLACEMENT record. | |
D3DDevice * | m_pD3DDevice |
(Xbox 360 Only) Direct 3D device | |
uint_t | m_uClearColor |
(Xbox 360 Only) 32 bit RGBA color for screen clear | |
float | m_fClearDepth |
(Xbox 360 Only) ZValue to write for screen clear | |
uint_t | m_bWideScreen |
(Xbox 360 Only) TRUE if wide screen display is active | |
NSView * | m_pView |
(MacOSX Only) Pointer to the main view | |
NSWindowController * | m_pWindowController |
(MacOSX Only) Pointer to the window controller | |
NSOpenGLView * | m_pOpenGLView |
(MacOSX Only) Pointer to the OpenGL view | |
_CGLContextObject * | m_pOpenGLContext |
(MacOSX Only) Pointer to the OpenGL context | |
NSWindow * | m_pFullScreenWindow |
(MacOSX Only) Pointer to the main full screen window | |
EAGLContext * | m_pEAGLContext |
(iOS Only) OpenGL Context | |
uint_t | m_uFrontBuffer |
(iOS Only) Main render buffer GL name | |
uint_t | m_uColorRenderBuffer |
(iOS Only) Color render buffer GL name | |
uint_t | m_uDepthRenderBuffer |
(iOS Only) Depth buffer for rendering | |
ResizeProc | m_pResize |
Callback if the screen changed sizes. | |
void * | m_pResizeData |
pThis pointer for m_pResize calls | |
RenderProc | m_pRender |
Callback if the operating system requests a scene draw. | |
void * | m_pRenderData |
pThis pointer for m_pRender calls | |
ReleaseProc | m_pRelease |
Callback if the operating system requests a scene draw. | |
void * | m_pReleaseData |
pThis pointer for m_pRender calls | |
Texture * | m_pBoundTextures [8] |
Bound textures for the current context. | |
uint_t | m_uWidth |
Width in pixels of the display buffer. | |
uint_t | m_uHeight |
Height in pixels of the display buffer. | |
uint_t | m_uDepth |
Depth in bits of the display buffer. | |
uint_t | m_uFlags |
Flags for describing available features. | |
uint_t | m_uDisplayWidth |
Width of the display hardware (Can differ from m_uWidth for pixel stretching) | |
uint_t | m_uDisplayHeight |
Height of the display hardware (Can differ from m_uHeight for pixel stretching) | |
uint_t | m_uDisplayDepth |
Depth of the display hardware (Can differ from m_uDepth for pixel depth change) | |
float | m_fWidth |
Width of the rendering target as a float. | |
float | m_fHeight |
Height of the rendering target as a float. | |
float | m_fAspectRatioX |
Width/Height. | |
float | m_fAspectRatioY |
Height/Width. | |
uint_t | m_uBorderColor |
Hardware border color (MSDOS / Amiga only) | |
uint_t | m_uPaletteFadeSpeed |
Speed in 1/60ths of a second for a palette fade. | |
int | m_iPauseRenderingCount |
Rendering pausing reference count. | |
uint8_t | m_bRenderingPaused |
If TRUE, rendering is paused. | |
uint8_t | m_bPaletteDirty |
TRUE if the palette buffer was changed | |
uint8_t | m_bPaletteVSync |
TRUE if palette updates sync to video | |
uint8_t | m_bNotUsed [1] |
Padding. | |
uint8_t | m_Palette [256 *3] |
Palette of 256 RGB values. | |
Additional Inherited Members | |
Public Types inherited from Burger::Display | |
enum | { INWINDOW = 0x0 , FULLSCREEN = 0x1 , ALLOWFULLSCREENTOGGLE = 0x2 , ALLOWRESIZING = 0x4 , MAINTAIN_ASPECT_RATIO = 0x8 , STENCILENABLE = 0x20 , FULLPALETTEALLOWED = 0x40 , STEREO = 0x80 , MULTITHREADED = 0x100 , GAMMAENABLE = 0x200 , DITHERENABLE = 0x400 , INTERLACEENABLE = 0x800 , LANDSCAPE = 0x0000 , PORTRAIT = 0x1000 , INVERTED = 0x2000 , LANDSCAPEINVERTED = 0x2000 , PORTRAITINVERTED = 0x3000 , PALMODE = 0x4000 , DEFAULTFLAGS = INWINDOW } |
enum | eAspectRatio { kAspectRatioUnknown , kAspectRatio1x1 , kAspectRatio4x3 , kAspectRatio16x10 , kAspectRatio16x9 , kAspectRatio21x9 , kAspectRatio32x9 , kAspectRatioCustom , kAspectRatioCount } |
enum | eClearBits { CLEAR_COLOR = 0x01 , CLEAR_DEPTH = 0x02 , CLEAR_STENCIL = 0x04 } |
Settings for Clear(uint_t) More... | |
enum | eDepthFunction { DEPTHCMP_NEVER , DEPTHCMP_LESS , DEPTHCMP_EQUAL , DEPTHCMP_LESSEQUAL , DEPTHCMP_GREATER , DEPTHCMP_NOTEQUAL , DEPTHCMP_GREATEREQUAL , DEPTHCMP_ALWAYS } |
Settings for SetDepthTest(eDepthFunction) More... | |
enum | eCullMode { CULL_NONE , CULL_CLOCKWISE , CULL_COUNTERCLOCKWISE } |
Settings for SetCullMode(eCullMode) More... | |
enum | eSourceBlendFactor { SRCBLEND_ZERO , SRCBLEND_ONE , SRCBLEND_COLOR , SRCBLEND_ONE_MINUS_COLOR , SRCBLEND_SRC_ALPHA , SRCBLEND_ONE_MINUS_SRC_ALPHA , SRCBLEND_DST_ALPHA , SRCBLEND_ONE_MINUS_DST_ALPHA , SRCBLEND_SRC_ALPHA_SATURATE } |
Settings for SetBlendFunction(eSourceBlendFactor) More... | |
enum | eDestinationBlendFactor { DSTBLEND_ZERO , DSTBLEND_ONE , DSTBLEND_COLOR , DSTBLEND_ONE_MINUS_COLOR , DSTBLEND_DST_ALPHA , DSTBLEND_ONE_MINUS_DST_ALPHA , DSTBLEND_SRC_ALPHA , DSTBLEND_ONE_MINUS_SRC_ALPHA } |
Settings for SetBlendFunction(eDestinationBlendFactor) More... | |
enum | ePrimitiveType { PRIM_POINTS , PRIM_LINES , PRIM_LINESTRIP , PRIM_TRIANGLES , PRIM_TRIANGLESTRIP , PRIM_TRIANGLEFAN } |
Describe how to render a vertex array. More... | |
typedef uint_t(*) | FadeProc(void *pThis, uint_t uStep) |
Callback function prototype for palette fading functions. | |
typedef void(*) | ResizeProc(void *pThis, uint_t uWidth, uint_t uHeight) |
Callback function prototype for window resizing. | |
typedef void(*) | RenderProc(void *pThis) |
Callback function for rendering the scene. | |
typedef void(*) | ReleaseProc(void *pThis) |
Callback function for releasing resources on shutdown. | |
Static Public Member Functions inherited from Burger::Display | |
static float | GetRetinaScale (void) noexcept |
Get the scale factor for the retina display. | |
static uint_t | GetVideoModes (ClassArray< VideoCardDescription > *pOutput) |
Get a list of available video modes. | |
static uint_t | GetDefaultWidth (void) noexcept |
Get the width of the default monitor. | |
static uint_t | GetDefaultHeight (void) noexcept |
Get the height of the default monitor. | |
static uint_t | GetDefaultDepth (void) noexcept |
Get the pixel depth of the default monitor. | |
static uint_t | GetDefaultHertz (void) noexcept |
Get the refresh rate of the default monitor. | |
static uint_t | GetDefaultTotalWidth (void) noexcept |
Get the width of the default monitor. | |
static uint_t | GetDefaultTotalHeight (void) noexcept |
Get the height of the default monitor. | |
static uint_t | GetDefaultMonitorCount (void) noexcept |
Get the number of active monitors. | |
static eAspectRatio | get_aspect_ratio (uint32_t uWidth, uint32_t uHeight, uint_t bExactOnly) noexcept |
Calculate the screen aspect ratio. | |
Static Public Attributes inherited from Burger::Display | |
static const Burger::StaticRTTI | g_StaticRTTI |
The global description of the class. | |
Static Public Attributes inherited from Burger::Base | |
static const Burger::StaticRTTI | g_StaticRTTI |
The global description of the class. | |
Static Protected Member Functions inherited from Burger::Display | |
static void | InitGlobals (void) |
Initialize video globals. | |
Static Protected Attributes inherited from Burger::Display | |
static Globals_t | g_Globals |
Global values initialized when the first Display class is created. | |
Burger::DisplayDIB::DisplayDIB | ( | Burger::GameApp * | pGameApp | ) |
Default constructor.
Initializes all of the internal variables
|
protectedvirtual |
Initialize a windowed video context.
Given a width, height and depth (8 or 16), create a DIB context and resize the application window to match.
Reimplemented in Burger::DisplayDIBSoftware8.
|
protectedvirtual |
Update the window assuming the entire buffer must be redrawn.
Reimplemented in Burger::DisplayDIBSoftware8.
|
protectedvirtual |
Shut down a windowed video context.
If a video context was set up, release it.
Reimplemented in Burger::DisplayDIBSoftware8.
|
protected |
Pointer to the BitMap's device context.
|
protected |
Pointer to the window's device context.