Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::DisplayDIBSoftware8 Class Reference

DIB startup and teardown class. More...

Inheritance diagram for Burger::DisplayDIBSoftware8:
Collaboration diagram for Burger::DisplayDIBSoftware8:

Public Member Functions

 DisplayDIBSoftware8 (GameApp *pGameApp)
 Default constructor.
 
- Public Member Functions inherited from Burger::DisplayDIB
 DisplayDIB (GameApp *pGameApp)
 Default constructor.
 
- Public Member Functions inherited from Burger::Display
const Burger::StaticRTTIget_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.
 
TextureCreateTextureObject (void)
 
VertexBufferCreateVertexBufferObject (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.
 
TextureGetBoundTexture (uint_t uIndex=0) const noexcept
 
TextureCreateTexture (Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping and filters preset.
 
TextureCreateTexture (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.
 
TextureCreateTexturePNG (const char *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTexturePNG (Filename *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTexturePNG (RezFile *pRezFile, uint_t uRezNum, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTextureGIF (const char *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTextureGIF (Filename *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTextureGIF (RezFile *pRezFile, uint_t uRezNum, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTextureTGA (const char *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTextureTGA (Filename *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTextureTGA (RezFile *pRezFile, uint_t uRezNum, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTextureBMP (const char *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTextureBMP (Filename *pFilename, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
TextureCreateTextureBMP (RezFile *pRezFile, uint_t uRezNum, Texture::eWrapping uWrapping, Texture::eFilter uFilter)
 Create a texture object with wrapping, filters and a texture source.
 
VertexBufferCreateVertexBuffer (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.
 
GameAppGetGameApp (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::DisplayDIB
- 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.
 

Private Member Functions

 DisplayDIBSoftware8 (const DisplayDIBSoftware8 &)=delete
 
DisplayDIBSoftware8operator= (const DisplayDIBSoftware8 &)=delete
 
 DisplayDIBSoftware8 (DisplayDIBSoftware8 &&)=delete
 
DisplayDIBSoftware8operator= (DisplayDIBSoftware8 &&)=delete
 

Private Attributes

void * m_pBitMap
 Pointer the the HBITMAP's bitmap.
 
HPALETTE__ * m_pHPalette
 Pointer to the HPALETTE for this window.
 
HBITMAP__ * m_pHBitMap
 Pointer to the frame HBITMAP.
 
RendererSoftware8 m_Renderer
 Software renderer context.
 

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.
 
- Protected Attributes inherited from Burger::DisplayDIB
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
GameAppm_pGameApp
 Pointer to the game application instance.
 
Rendererm_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
 
Texturem_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 inherited from Burger::Display
static Globals_t g_Globals
 Global values initialized when the first Display class is created.
 

Detailed Description

DIB startup and teardown class.


For software renderers in a window, a DIB context is created and the software buffer exists in the DIB which is then updated to the window using the BitBlt() function.

The window will have a Minimize and a Close box.

Note
This is only available on Windows

Constructor & Destructor Documentation

◆ DisplayDIBSoftware8() [1/3]

Burger::DisplayDIBSoftware8::DisplayDIBSoftware8 ( Burger::GameApp * pGameApp)

Default constructor.


Initializes all of the internal variables

◆ DisplayDIBSoftware8() [2/3]

Burger::DisplayDIBSoftware8::DisplayDIBSoftware8 ( const DisplayDIBSoftware8 & )
privatedelete

◆ DisplayDIBSoftware8() [3/3]

Burger::DisplayDIBSoftware8::DisplayDIBSoftware8 ( DisplayDIBSoftware8 && )
privatedelete

Member Function Documentation

◆ InitContext()

uint_t Burger::DisplayDIBSoftware8::InitContext ( void )
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.

Returns
Zero if no error, non-zero error code if not successful.
See also
Shutdown()

Reimplemented from Burger::DisplayDIB.

◆ operator=() [1/2]

DisplayDIBSoftware8 & Burger::DisplayDIBSoftware8::operator= ( const DisplayDIBSoftware8 & )
privatedelete

◆ operator=() [2/2]

DisplayDIBSoftware8 & Burger::DisplayDIBSoftware8::operator= ( DisplayDIBSoftware8 && )
privatedelete

◆ PostEndScene()

void Burger::DisplayDIBSoftware8::PostEndScene ( void )
protectedvirtual

Update the window assuming the entire buffer must be redrawn.


See also
Update()

Reimplemented from Burger::DisplayDIB.

◆ PostShutdown()

void Burger::DisplayDIBSoftware8::PostShutdown ( void )
protectedvirtual

Shut down a windowed video context.


If a video context was set up, release it.

See also
Init()

Reimplemented from Burger::DisplayDIB.

Member Data Documentation

◆ m_pBitMap

void* Burger::DisplayDIBSoftware8::m_pBitMap
private

Pointer the the HBITMAP's bitmap.

◆ m_pHBitMap

HBITMAP__* Burger::DisplayDIBSoftware8::m_pHBitMap
private

Pointer to the frame HBITMAP.

◆ m_pHPalette

HPALETTE__* Burger::DisplayDIBSoftware8::m_pHPalette
private

Pointer to the HPALETTE for this window.

◆ m_Renderer

RendererSoftware8 Burger::DisplayDIBSoftware8::m_Renderer
private

Software renderer context.