Base class for instantiating a video display and the API to drive it. More...
Classes | |
struct | Globals_t |
Values to describe the default settings of the display. More... | |
struct | OpenGLVertexBufferObjectDescription_t |
Description of an OpenGL vertex buffer object. More... | |
struct | OpenGLVertexInputs_t |
Description of an OpenGL vertex input list. More... | |
class | VideoCardDescription |
Description of a video card's available video modes. More... | |
struct | VideoMode_t |
Description of a video card's video mode. More... | |
Public Member Functions | |
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. | |
Static Public Member Functions | |
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 | |
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. | |
Protected Member Functions | |
void | InitDefaults (GameApp *pGameApp) |
Initialize shared variables. | |
void | SetWidthHeight (uint_t uWidth, uint_t uHeight) |
Set the width and height of the screen. | |
Static Protected Member Functions | |
static void | InitGlobals (void) |
Initialize video globals. | |
Protected Attributes | |
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. | |
Static Protected Attributes | |
static Globals_t | g_Globals |
Global values initialized when the first Display class is created. | |
Private Member Functions | |
Display (const Display &)=delete | |
Display & | operator= (const Display &)=delete |
Display (Display &&)=delete | |
Display & | operator= (Display &&)=delete |
Base class for instantiating a video display and the API to drive it.
This class manages video displays, resources and APIs to render images.
Since palettes are tied to a video display, this class will manage palettes for palette display contexts. If the display is in true color, palette functions will only update internal buffers but will not affect actual rendering.
Classes for specific rendering APIs derive from this base class.
Callback function prototype for palette fading functions.
void( *) Burger::Display::ReleaseProc(void *pThis) |
Callback function for releasing resources on shutdown.
void( *) Burger::Display::RenderProc(void *pThis) |
Callback function for rendering the scene.
Callback function prototype for window resizing.
anonymous enum |
Enumerator | |
---|---|
INWINDOW | The display is in a desktop window, best for debugging. |
FULLSCREEN | Set if full screen is desired. |
ALLOWFULLSCREENTOGGLE | Set if Alt-Enter is allowed to switch from full screen to windowed mode. |
ALLOWRESIZING | On desktop platforms, allow the window to be resized. |
MAINTAIN_ASPECT_RATIO | If Resizing is allowed, maintain the aspect ratio. |
STENCILENABLE | Enable stencil mode. |
FULLPALETTEALLOWED | Set if all 256 colors of the palette can be used. |
STEREO | Set if 3D Glasses support is enabled. |
MULTITHREADED | Hint that rendering is performed on multiple threads. |
GAMMAENABLE | Enable gamma support. |
DITHERENABLE | Enable dithering. |
INTERLACEENABLE | Enable interlacing. |
LANDSCAPE | Landscape mode. |
PORTRAIT | Portrait mode. |
INVERTED | Inverted. |
LANDSCAPEINVERTED | Inverted landscape mode. |
PORTRAITINVERTED | Inverted portrait mode. |
PALMODE | PAL interlace mode. |
DEFAULTFLAGS | Default window flags (Debug is in a window, release is full screen) |
Settings for Clear(uint_t)
Bitfield for which buffers to clear upon the start of rendering a frame buffer
Enumerator | |
---|---|
CLEAR_COLOR | Used by Clear(uint_t) to clear the color buffer. |
CLEAR_DEPTH | Used by Clear(uint_t) to clear the depth buffer. |
CLEAR_STENCIL | Used by Clear(uint_t) to clear the stencil buffer. |
Settings for SetCullMode(eCullMode)
Enumeration to set the polygon culling mode.
Enumerator | |
---|---|
CULL_NONE | Don't cull any polygons. |
CULL_CLOCKWISE | Don't render clockwise oriented polygons. |
CULL_COUNTERCLOCKWISE | Don't render counter clockwise oriented polygons. |
Settings for SetDepthTest(eDepthFunction)
Enumeration to set the depth test type.
Settings for SetBlendFunction(eDestinationBlendFactor)
Enumeration to set the destination pixel blending mode.
Describe how to render a vertex array.
Enumeration to determine how to render an array of vertices
Settings for SetBlendFunction(eSourceBlendFactor)
Enumeration to set the source pixel blending mode.
|
privatedelete |
|
privatedelete |
Burger::Display::Display | ( | GameApp * | pGameApp | ) |
Default constructor.
Initializes all of the shared variables and hooks up the Display and the Renderer to the GameApp.
Variables are initialized, but the display is not activated. Call Init(uint_t,uint_t,uint_t,uint_t) to activate the display.
pGameApp | Pointer to the game application |
|
virtual |
Default destructor.
Shut down OpenGL.
Shuts down the video context and issues a shutdown to the renderer
Release all resources allocated by OpenGL
void Burger::Display::BeginScene | ( | void | ) |
Prepare the display for rendering.
This function will call the Renderer::BeginScene() function after any operating system calls are issued so the renderer can prepare for drawing.
This must be paired with a subsequent call to Burger::Display::EndScene()
void Burger::Display::Bind | ( | Effect * | pEffect | ) |
|
virtual |
Check if the window has changed monitors.
Reimplemented in Burger::DisplayDirectX9.
|
virtual |
Resize the back buffer if the window size changed.
Reimplemented in Burger::DisplayDirectX9.
void Burger::Display::Clear | ( | uint_t | uMask | ) |
D3DPixelShader *BURGER_API Burger::Display::CreatePixelShader | ( | const void * | pPixelShaderBinary | ) | const |
Burger::Texture *BURGER_API Burger::Display::CreateTexture | ( | Texture::eWrapping | uWrapping, |
Texture::eFilter | uFilter ) |
Create a texture object with wrapping and filters preset.
Create a texture object and set the wrapping and filter settings.
Burger::Texture *BURGER_API Burger::Display::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.
Create a texture object and set the wrapping and filter settings and create a buffer to hold the pixel map information.
uWidth | Width of the texture in pixels |
uHeight | Height of the texture in pixels |
uPixelType | Type of pixel data contained in the bitmap |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTextureBMP | ( | const char * | pFilename, |
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a BMP file.
pFilename | Pointer to a "C" string of a Burgerlib path of the texture file |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTextureBMP | ( | Filename * | pFilename, |
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a BMP file.
pFilename | Pointer to a Burgerlib Filename object with the filename |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTextureBMP | ( | RezFile * | pRezFile, |
uint_t | uRezNum, | ||
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a BMP file.
pRezFile | Pointer to a Burgerlib RezFile |
uRezNum | Chuck ID of the data containing the image file |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTextureGIF | ( | const char * | pFilename, |
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a GIF file.
pFilename | Pointer to a "C" string of a Burgerlib path of the texture file |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTextureGIF | ( | Filename * | pFilename, |
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a GIF file.
pFilename | Pointer to a Burgerlib Filename object with the filename |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTextureGIF | ( | RezFile * | pRezFile, |
uint_t | uRezNum, | ||
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a GIF file.
pRezFile | Pointer to a Burgerlib RezFile |
uRezNum | Chuck ID of the data containing the image file |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture * Burger::Display::CreateTextureObject | ( | void | ) |
Burger::Texture *BURGER_API Burger::Display::CreateTexturePNG | ( | const char * | pFilename, |
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a PNG file.
pFilename | Pointer to a "C" string of a Burgerlib path of the texture file |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTexturePNG | ( | Filename * | pFilename, |
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a PNG file.
pFilename | Pointer to a Burgerlib Filename object with the filename |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTexturePNG | ( | RezFile * | pRezFile, |
uint_t | uRezNum, | ||
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a PNG file.
pRezFile | Pointer to a Burgerlib RezFile |
uRezNum | Chuck ID of the data containing the image file |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTextureTGA | ( | const char * | pFilename, |
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a TGA file.
pFilename | Pointer to a "C" string of a Burgerlib path of the texture file |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTextureTGA | ( | Filename * | pFilename, |
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a TGA file.
pFilename | Pointer to a Burgerlib Filename object with the filename |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::Texture *BURGER_API Burger::Display::CreateTextureTGA | ( | RezFile * | pRezFile, |
uint_t | uRezNum, | ||
Texture::eWrapping | uWrapping, | ||
Texture::eFilter | uFilter ) |
Create a texture object with wrapping, filters and a texture source.
Create a texture object and set the wrapping and filter settings and set it up to obtain the bitmap from a TGA file.
pRezFile | Pointer to a Burgerlib RezFile |
uRezNum | Chuck ID of the data containing the image file |
uWrapping | Texture wrapping constant |
uFilter | Texture filter constant |
Burger::VertexBuffer *BURGER_API Burger::Display::CreateVertexBuffer | ( | const VertexBuffer::VertexAoS_t * | pDescription | ) |
Create a vertex buffer object with from a vertex description.
Given an Array of Structures description, create a vertex buffer that is initialized with the data
pDescription | Pointer to a description |
Burger::VertexBuffer * Burger::Display::CreateVertexBufferObject | ( | void | ) |
D3DVertexShader *BURGER_API Burger::Display::CreateVertexShader | ( | const void * | pVertexShaderBinary | ) | const |
void Burger::Display::DrawElements | ( | ePrimitiveType | uPrimitiveType, |
VertexBuffer * | pVertexBuffer ) |
void Burger::Display::DrawPrimitive | ( | ePrimitiveType | uPrimitiveType, |
VertexBuffer * | pVertexBuffer ) |
void Burger::Display::EndScene | ( | void | ) |
Render the scene to the display.
Alert the operating system that all rendering calls are complete and the hardware is permitted to begin rendering the scene.
The renderer is issued a call to Renderer::EndScene() before the operating system so all rendering calls can be completed before the scene is sent to the GPU or other rendering sub-system.
void BURGER_API Burger::Display::FadeTo | ( | const uint8_t * | pPalette, |
FadeProc | pProc = nullptr, | ||
void * | pData = nullptr ) |
Fade the hardware palette to a palette.
Given an arbitrary palette, and a preset palette speed variable, fade from the currently shown palette to the new arbitrary palette using smooth steps.
If the requested palette is the same as Display::m_Palette, this routine does nothing.
Every time the hardware palette is written to, the function pProc() is called if the user has set it to a valid function pointer. It is passed a 0 on startup and the value increments until it reaches 16 when the palette is finished. Only parameter 0 and 16 are guaranteed to be called. All other values will only be passed once or skipped due to low machine speed.
void BURGER_API Burger::Display::FadeTo | ( | RezFile * | pRez, |
uint_t | uResID, | ||
FadeProc | pProc = nullptr, | ||
void * | pData = nullptr ) |
Fade the hardware palette to a palette.
All color entries in the hardware palette are set to the new palette slowly over time.
void BURGER_API Burger::Display::FadeTo | ( | void ** | pHandle, |
FadeProc | pProc = nullptr, | ||
void * | pData = nullptr ) |
Fade the hardware palette to a palette.
All color entries in the hardware palette are set to the new palette slowly over time.
The handle is returned unlocked. Nothing is performed if the handle is invalid or purged.
void BURGER_API Burger::Display::FadeToBlack | ( | FadeProc | pProc = nullptr, |
void * | pData = nullptr ) |
void BURGER_API Burger::Display::FadeToWhite | ( | FadeProc | pProc = nullptr, |
void * | pData = nullptr ) |
|
staticnoexcept |
Calculate the screen aspect ratio.
Check for an exact aspect ratio match if bExactOnly
is TRUE. Otherwise, find the aspect ratio enumeration that's the closest match.
If no match is found, return kAspectRatioUnknown
|
overridevirtualnoexcept |
Get the description to the class.
This virtual function will pull the pointer to the StaticRTTI instance that has the name of the class. Due to it being virtual, it will be the name of the most derived class.
Reimplemented from Burger::Base.
Reimplemented in Burger::DisplayDirectX11, Burger::DisplayDirectX9, Burger::DisplayOpenGL, and Burger::DisplayOpenGLSoftware8.
Burger::Display::eAspectRatio BURGER_API Burger::Display::GetAspectRatio | ( | void | ) | const |
Get the enumeration of the screen aspect ratio.
Convert the aspect ratio values into the closest enumeration of a standard aspect ratio.
|
inlinenoexcept |
Get the aspect ratio in the format of width/height.
|
inlinenoexcept |
Get the aspect ratio in the format of height/width.
|
inlinenoexcept |
Get the hardware border color.
On some platforms, such as MSDOS VGA/MCGA or the Commodore Amiga, the display's border color can be set. This function will return that color.
|
inlinenoexcept |
Color buffer index.
When an OpenGL context is created, a color buffer is declared and initialized. This index allows user code to access the color buffer through this index
|
inlinenoexcept |
|
inlinestaticnoexcept |
Get the pixel depth of the default monitor.
This is initialized with the pixel depth of the user's desktop from the primary display.
|
inlinestaticnoexcept |
Get the height of the default monitor.
This is initialized with the size of the user's desktop height from the primary display.
|
inlinestaticnoexcept |
Get the refresh rate of the default monitor.
This is initialized with the refresh rate of the user's desktop from the primary display.
|
inlinestaticnoexcept |
Get the number of active monitors.
This is initialized with the number of monitors used for the user's desktop.
|
inlinestaticnoexcept |
Get the height of the default monitor.
This is initialized with the size of the user's entire desktop height. It is a union of all active monitors.
|
inlinestaticnoexcept |
Get the width of the default monitor.
This is initialized with the size of the user's entire desktop width. It is a union of all active monitors.
|
inlinestaticnoexcept |
Get the width of the default monitor.
This is initialized with the size of the user's desktop width from the primary display.
|
inlinenoexcept |
Get the depth in bits of the display buffer.
The display buffer could be 8 for 8 bit palette, 15 for 5:5:5 RGB, 16 for 5:6:5 RGB or 24 or 32 for hardware rendering
|
inlinenoexcept |
Depth buffer index.
When an OpenGL context is created, a depth buffer is declared and initialized. This index allows user code to access the depth buffer through this index
|
inlinenoexcept |
Get the height in pixels of the display hardware.
This differs from GetHeight() in that this is the actual display hardware's resolution, which can differ from the resolution of the draw buffer.
|
inlinenoexcept |
Get the width in pixels of the display hardware.
This differs from GetWidth() in that this is the actual display hardware's resolution, which can differ from the resolution of the draw buffer.
|
inlinenoexcept |
Return the timer constant in Burger::Tick.
When calling the palette fade functions, it will perform the fade evenly until this amount of time has elapsed. This is not a "per frame" time. It's a total time. If the desired time is one second from start to finish, set this value to Tick::kTicksPerSecond
|
inlinenoexcept |
Get the flags associated with this Display class instance.
|
inlinenoexcept |
Front buffer index.
When an OpenGL context is created, a front buffer is declared and initialized. This index allows user code to access the front buffer through this index
This function returns zero on all platforms except iOS, where it returns the created front buffer
|
inlinenoexcept |
Get the window pointer.
Get the secondary full screen application window.
|
inlinenoexcept |
Get the parent application pointer.
|
inlinenoexcept |
The currently active OpenGL context.
|
inlinenoexcept |
Get the height in pixels of the display buffer.
|
inlinenoexcept |
Get the height in pixels of the display buffer.
|
inlinenoexcept |
Get the window's _CGLContextObject.
Get the current CGLContextObject being used by the primary application window.
|
inlinenoexcept |
Get the window's NSOpenGLView.
Get the current NSOpenGLView being used by the primary application window.
|
inlinenoexcept |
Get the current palette.
When video is set to an 8 bit mode, a 256 entry color palette is needed for the video display to properly show the graphics. A copy of the palette is maintained in the class that matches what the hardware is currently displaying. For some displays, some colors are considered read only. When calling SetPalette(uint_t,uint_t, const uint8_t *) it's not guaranteed that all colors will be updated due to system reserved colors (For windowed modes). The palette will have the reserved colors in it if this is the case.
|
inlinenoexcept |
Return non-zero if palette updates are synced to vertical blank.
|
inlinenoexcept |
Purge resource callback.
Return the function pointer for the callback when the renderer needs to purge all resources
|
inlinenoexcept |
Return pointer to callback void *.
Return the pointer that's passed to the callback that's used when the renderer
|
inlinenoexcept |
Set the window updat function.
Return the function pointer for the callback when the window needs to be redrawn
|
inlinenoexcept |
Get the redraw callback function.
Return the pointer that's passed to the callback that's used when the window is redrawn
|
inlinenoexcept |
Return the function pointer for the callback when the window's size is changed.
|
inlinenoexcept |
Return the window resize function.
Return the pointer that's passed to the callback that's used when the window's size is changed
|
inlinestaticnoexcept |
Get the scale factor for the retina display.
Some iOS devices have displays that are higher resolution than the "Point" system they present as. Older systems use a 1:1 ratio for points to pixels where more recent devices are 2:1 or higher. This value represents the scale from Points to Pixels
|
static |
Get a list of available video modes.
pOutput | Pointer to array of VideoCardDescription entries |
|
inlinenoexcept |
Get the window's NSView.
Get the current NSView being used by the primary application window.
|
inlinenoexcept |
Get the width in pixels of the display buffer.
|
inlinenoexcept |
Get the width in pixels of the display buffer.
|
inlinenoexcept |
Get the window's NSWindowController.
Get the current NSWindowController being used by the primary application window.
|
inlinenoexcept |
Return the pointer to a WINDOWPLACEMENT.
uint_t BURGER_API Burger::Display::HandleMinMax | ( | HWND__ * | pWindow, |
uintptr_t | lParam ) |
Handler for WM_GETMINMAXINFO events.
To handle window resizing, this function is called from the Burgerlib windows callback when WM_GETMINMAXINFO messages are passed. This function determines if resizing should be disabled or limited to specific sizes or aspect ratios
pWindow | HWND of the window the callback was handling |
lParam | lParam Value passed from Windows to the callback which is a pointer to a MINMAXINFO structure |
uint_t Burger::Display::Init | ( | uint_t | uWidth, |
uint_t | uHeight, | ||
uint_t | uDepth = 32, | ||
uint_t | uFlags = DEFAULTFLAGS ) |
Initialize the display.
Set up the video display hardware to the specified mode and depth. This calls derived functions and it's the responsibility of the underlying class to use the appropriate API such as OpenGL, DirectX or something else to perform the display operations and then call the base class to complete the setup
uWidth | Width of the requested display in pixels |
uHeight | Height of the requested display in pixels |
uDepth | Bit depth of the requested display in bits |
uFlags | Helper flags for hinting at the preferred display |
|
protected |
Initialize shared variables.
To ease the porting of the Display class to other platforms, the initialization of variables that are common to all platforms is performed in this function and then platform specific variables will be initialized in platform specific code.
|
staticprotected |
Initialize video globals.
Before an application is allowed to change the display mode, this function will query the system what are the current display mode so these value can be used as defaults for changing a display mode or for the application can be aware of what the user has already set the platform to display with.
void BURGER_API Burger::Display::InitState | ( | void | ) |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
void BURGER_API Burger::Display::Pause | ( | uint_t | bPauseRendering | ) |
Pause or resume rendering.
Set or clear the flag to pause rendering. This is required to keep background tasks from attempting to use the display device for rendering while it's in a transitory state.
void Burger::Display::SetBlend | ( | uint_t | bEnable | ) |
void Burger::Display::SetBlendFunction | ( | eSourceBlendFactor | uSourceFactor, |
eDestinationBlendFactor | uDestFactor ) |
void BURGER_API Burger::Display::SetBorderColor | ( | uint_t | uColor | ) |
Update the display border color.
On some platforms, such as MSDOS VGA/MCGA or the Commodore Amiga, the display's border color can be set. This function will set that color. On all other platforms, the function only logs the color change, otherwise it does nothing.
uColor | Border color that is specific to the hardware being updated. |
void Burger::Display::SetClearColor | ( | float | fRed, |
float | fGreen, | ||
float | fBlue, | ||
float | fAlpha ) |
void Burger::Display::SetClearDepth | ( | float | fDepth | ) |
void Burger::Display::SetCullMode | ( | eCullMode | uCullMode | ) |
void Burger::Display::SetDepthTest | ( | eDepthFunction | uDepthFunction | ) |
|
inlinenoexcept |
Set the timer constant in Burger::Tick.
When calling the palette fade functions, it will perform the fade evenly until this amount of time has elapsed. This is not a "per frame" time. It's a total time. If the desired time is one second from start to finish, set this value to Tick::kTicksPerSecond. Setting this value to zero will disable the fade feature and will have palettes update immediately
uPaletteFadeSpeed | New time delay in ticks. |
|
inlinenoexcept |
Enable a full screen window and disable the primary game window.
Hide the game window and attach all the views to the supplied window that's been set to occupy the entire screen.
pFullScreenWindow | Pointer to the window to use as a full screen window |
void Burger::Display::SetLighting | ( | uint_t | bEnable | ) |
void BURGER_API Burger::Display::SetPalette | ( | const RGBAWord8_t * | pPalette | ) |
Update the color palette.
On 8 bit rendering surfaces, update the color palette for the current hardware or rendering context. On all other rendering modes, it will update the internal color buffer.
The palette is an array of RGBAWord8_t.
pPalette | Base pointer to the array of 256 RGBAWord8_t colors to use in the update |
void BURGER_API Burger::Display::SetPalette | ( | const uint8_t * | pPalette | ) |
Update the color palette.
On 8 bit rendering surfaces, update the color palette for the current hardware or rendering context. On all other rendering modes, it will update the internal color buffer.
The palette is an array of 3 byte triplets of Red,Green, and Blue.
pPalette | Base pointer to the colors to use in the update in the size of 256*3 (768) |
void BURGER_API Burger::Display::SetPalette | ( | RezFile * | pRez, |
uint_t | uResID ) |
Update the color palette using a resource.
On 8 bit rendering surfaces, update the color palette for the current hardware or rendering context. On all other rendering modes, it will update the internal color buffer.
The palette is an array of 3 byte triplets of Red,Green, and Blue.
pRez | Reference to the resource file |
uResID | Resource entry the contains the 768 byte palette |
void BURGER_API Burger::Display::SetPalette | ( | uint_t | uStart, |
uint_t | uCount, | ||
const RGBAWord8_t * | pPalette ) |
Update the color palette.
On 8 bit rendering surfaces, update the color palette for the current hardware or rendering context. On all other rendering modes, it will update the internal color buffer.
The palette is an array of RGBAWord8_t entries.
uStart | First color entry to update (0-255) |
uCount | Number of colors to update (256-uStart) |
pPalette | Base pointer to an array of RGBAWord8_t colors to use in the update in the size of uCount |
void BURGER_API Burger::Display::SetPalette | ( | uint_t | uStart, |
uint_t | uCount, | ||
const uint8_t * | pPalette ) |
Update the color palette.
On 8 bit rendering surfaces, update the color palette for the current hardware or rendering context. On all other rendering modes, it will update the internal color buffer.
The palette is an array of 3 byte triplets of Red,Green, and Blue.
uStart | First color entry to update (0-255) |
uCount | Number of colors to update (256-uStart) |
pPalette | Base pointer to the colors to use in the update in the size of uCount*3 |
void BURGER_API Burger::Display::SetPalette | ( | uint_t | uStart, |
uint_t | uCount, | ||
RezFile * | pRez, | ||
uint_t | uResID ) |
Update a partial color palette using a resource.
On 8 bit rendering surfaces, update the color palette for the current hardware or rendering context. On all other rendering modes, it will update the internal color buffer.
The palette is an array of 3 byte triplets of Red,Green, and Blue.
uStart | First color entry to update (0-255) |
uCount | Number of colors to update (256-uStart) |
pRez | Reference to the resource file |
uResID | Resource entry the contains the palette that's uCount*3 bytes in length |
void BURGER_API Burger::Display::SetPalette | ( | void ** | pHandle | ) |
Update the color palette using a memory handle.
On 8 bit rendering surfaces, update the color palette for the current hardware or rendering context. On all other rendering modes, it will update the internal color buffer.
The palette is an array of 3 byte triplets of Red,Green, and Blue.
pHandle | Base handle to the colors to use in the update in the size of 256*3 (768) |
void BURGER_API Burger::Display::SetPaletteBlack | ( | void | ) |
Set the screen palette to all black.
Set all 8 bit palette color entries to zero (Black)
|
inlinenoexcept |
void BURGER_API Burger::Display::SetPaletteWhite | ( | void | ) |
Set the screen palette to all white.
Set all 8 bit palette color entries to 255 (White)
|
inlinenoexcept |
Set the purge callback.
Set the function pointer for the callback when the renderer needs to purge all resources
pRelease | Pointer to the function or NULL to disable |
pReleaseData | Pointer that is passed as is to the function if it's called. |
|
inlinenoexcept |
Set window update function.
Set the function pointer for the callback when the window needs to be redrawn
pRender | Pointer to the function or NULL to disable |
pRenderData | Pointer that is passed as is to the function if it's called. |
|
inlinenoexcept |
Set window resize callback.
Set the function pointer for the callback when the window's size is changed
pResize | Pointer to the function or NULL to disable |
pResizeData | Pointer that is passed as is to the function if it's called. |
void Burger::Display::SetScissor | ( | uint_t | bEnable | ) |
|
protected |
Set the width and height of the screen.
Sets the width and height in pixels of the display and updates all other variables that depend on these values
uWidth | New width of the screen in pixels |
uHeight | New height of the screen in pixels |
void BURGER_API Burger::Display::SetWindowTitle | ( | const char * | pTitle | ) |
Set the display window title.
On desktop platforms such as Windows or MacOS, the game could be running in a desktop window. The window can have a title string, and it can be set using this function.
On consoles and handhelds, this function does nothing.
pTitle | UTF-8 string to display for the title bar |
void Burger::Display::SetZWrite | ( | uint_t | bEnable | ) |
void Burger::Display::Shutdown | ( | void | ) |
Shut down the current video display context.
Release all resources and restore the video display to the system defaults. This is an internal function and is meant to be called as part of a call to Display::Shutdown() so the renderer is shut down first before the display
This code does nothing. It's a placeholder for classes that have no need for a shutdown call
|
staticprotected |
Global values initialized when the first Display class is created.
|
static |
The global description of the class.
This record contains the name of this class and a reference to the parent (If any)
|
protected |
Padding.
|
protected |
TRUE if the palette buffer was changed
|
protected |
TRUE if palette updates sync to video
|
protected |
If TRUE, rendering is paused.
|
protected |
(Xbox 360 Only) TRUE if wide screen display is active
|
protected |
Width/Height.
|
protected |
Height/Width.
|
protected |
(Xbox 360 Only) ZValue to write for screen clear
|
protected |
Height of the rendering target as a float.
|
protected |
Width of the rendering target as a float.
|
protected |
Rendering pausing reference count.
|
protected |
Palette of 256 RGB values.
|
protected |
Bound textures for the current context.
|
protected |
(Xbox 360 Only) Direct 3D device
|
protected |
(iOS Only) OpenGL Context
|
protected |
(MacOSX Only) Pointer to the main full screen window
|
protected |
Pointer to the game application instance.
|
protected |
(MacOSX Only) Pointer to the OpenGL context
|
protected |
(MacOSX Only) Pointer to the OpenGL view
|
protected |
Callback if the operating system requests a scene draw.
|
protected |
pThis pointer for m_pRender calls
|
protected |
Callback if the operating system requests a scene draw.
|
protected |
pThis pointer for m_pRender calls
|
protected |
Pointer to a renderer.
|
protected |
Callback if the screen changed sizes.
|
protected |
pThis pointer for m_pResize calls
|
protected |
(MacOSX Only) Pointer to the main view
|
protected |
(MacOSX Only) Pointer to the window controller
|
protected |
Hardware border color (MSDOS / Amiga only)
|
protected |
(Xbox 360 Only) 32 bit RGBA color for screen clear
|
protected |
(iOS Only) Color render buffer GL name
|
protected |
Depth in bits of the display buffer.
|
protected |
(iOS Only) Depth buffer for rendering
|
protected |
Depth of the display hardware (Can differ from m_uDepth for pixel depth change)
|
protected |
Height of the display hardware (Can differ from m_uHeight for pixel stretching)
|
protected |
Width of the display hardware (Can differ from m_uWidth for pixel stretching)
|
protected |
Flags for describing available features.
|
protected |
(iOS Only) Main render buffer GL name
|
protected |
Height in pixels of the display buffer.
|
protected |
Speed in 1/60ths of a second for a palette fade.
|
protected |
Width in pixels of the display buffer.
|
protected |
WINDOWPLACEMENT record.