DDraceNetwork Docs
CGraphicsBackend_SDL_GL Class Reference

#include <backend_sdl.h>

Inheritance diagram for CGraphicsBackend_SDL_GL:
[legend]
Collaboration diagram for CGraphicsBackend_SDL_GL:
[legend]

Public Member Functions

 CGraphicsBackend_SDL_GL (TTranslateFunc &&TranslateFunc)
 
int Init (const char *pName, int *pScreen, int *pWidth, int *pHeight, int *pRefreshRate, int *pFsaaSamples, int Flags, int *pDesktopWidth, int *pDesktopHeight, int *pCurrentWidth, int *pCurrentHeight, class IStorage *pStorage) override
 
int Shutdown () override
 
uint64_t TextureMemoryUsage () const override
 
uint64_t BufferMemoryUsage () const override
 
uint64_t StreamedMemoryUsage () const override
 
uint64_t StagingMemoryUsage () const override
 
const TTwGraphicsGpuListGetGpus () const override
 
int GetNumScreens () const override
 
const char * GetScreenName (int Screen) const override
 
void GetVideoModes (CVideoMode *pModes, int MaxModes, int *pNumModes, int HiDPIScale, int MaxWindowWidth, int MaxWindowHeight, int ScreenId) override
 
void GetCurrentVideoMode (CVideoMode &CurMode, int HiDPIScale, int MaxWindowWidth, int MaxWindowHeight, int ScreenId) override
 
void Minimize () override
 
void Maximize () override
 
void SetWindowParams (int FullscreenMode, bool IsBorderless) override
 
bool SetWindowScreen (int Index) override
 
bool UpdateDisplayMode (int Index) override
 
int GetWindowScreen () override
 
int WindowActive () override
 
int WindowOpen () override
 
void SetWindowGrab (bool Grab) override
 
bool ResizeWindow (int w, int h, int RefreshRate) override
 
void GetViewportSize (int &w, int &h) override
 
void NotifyWindow () override
 
void WindowDestroyNtf (uint32_t WindowId) override
 
void WindowCreateNtf (uint32_t WindowId) override
 
bool GetDriverVersion (EGraphicsDriverAgeType DriverAgeType, int &Major, int &Minor, int &Patch, const char *&pName, EBackendType BackendType) override
 
bool IsConfigModernAPI () override
 
bool UseTrianglesAsQuad () override
 
bool HasTileBuffering () override
 
bool HasQuadBuffering () override
 
bool HasTextBuffering () override
 
bool HasQuadContainerBuffering () override
 
bool Uses2DTextureArrays () override
 
bool HasTextureArraysSupport () override
 
const char * GetErrorString () override
 
const char * GetVendorString () override
 
const char * GetVersionString () override
 
const char * GetRendererString () override
 
TGLBackendReadPresentedImageDataGetReadPresentedImageDataFuncUnsafe () override
 
bool ShowMessageBox (unsigned Type, const char *pTitle, const char *pMsg) override
 
- Public Member Functions inherited from CGraphicsBackend_Threaded
 CGraphicsBackend_Threaded (TTranslateFunc &&TranslateFunc)
 
void RunBuffer (CCommandBuffer *pBuffer) override
 
void RunBufferSingleThreadedUnsafe (CCommandBuffer *pBuffer) override
 
bool IsIdle () const override
 
void WaitForIdle () override
 
void ProcessError (const SGfxErrorContainer &Error)
 
bool GetWarning (std::vector< std::string > &WarningStrings) override
 
- Public Member Functions inherited from IGraphicsBackend
virtual ~IGraphicsBackend ()=default
 
virtual int Init (const char *pName, int *pScreen, int *pWidth, int *pHeight, int *pRefreshRate, int *pFsaaSamples, int Flags, int *pDesktopWidth, int *pDesktopHeight, int *pCurrentWidth, int *pCurrentHeight, class IStorage *pStorage)=0
 
virtual int Shutdown ()=0
 
virtual uint64_t TextureMemoryUsage () const =0
 
virtual uint64_t BufferMemoryUsage () const =0
 
virtual uint64_t StreamedMemoryUsage () const =0
 
virtual uint64_t StagingMemoryUsage () const =0
 
virtual const TTwGraphicsGpuListGetGpus () const =0
 
virtual void GetVideoModes (CVideoMode *pModes, int MaxModes, int *pNumModes, int HiDPIScale, int MaxWindowWidth, int MaxWindowHeight, int Screen)=0
 
virtual void GetCurrentVideoMode (CVideoMode &CurMode, int HiDPIScale, int MaxWindowWidth, int MaxWindowHeight, int Screen)=0
 
virtual int GetNumScreens () const =0
 
virtual const char * GetScreenName (int Screen) const =0
 
virtual void Minimize ()=0
 
virtual void Maximize ()=0
 
virtual void SetWindowParams (int FullscreenMode, bool IsBorderless)=0
 
virtual bool SetWindowScreen (int Index)=0
 
virtual bool UpdateDisplayMode (int Index)=0
 
virtual int GetWindowScreen ()=0
 
virtual int WindowActive ()=0
 
virtual int WindowOpen ()=0
 
virtual void SetWindowGrab (bool Grab)=0
 
virtual bool ResizeWindow (int w, int h, int RefreshRate)=0
 
virtual void GetViewportSize (int &w, int &h)=0
 
virtual void NotifyWindow ()=0
 
virtual void WindowDestroyNtf (uint32_t WindowId)=0
 
virtual void WindowCreateNtf (uint32_t WindowId)=0
 
virtual void RunBuffer (CCommandBuffer *pBuffer)=0
 
virtual void RunBufferSingleThreadedUnsafe (CCommandBuffer *pBuffer)=0
 
virtual bool IsIdle () const =0
 
virtual void WaitForIdle ()=0
 
virtual bool GetDriverVersion (EGraphicsDriverAgeType DriverAgeType, int &Major, int &Minor, int &Patch, const char *&pName, EBackendType BackendType)=0
 
virtual bool IsConfigModernAPI ()
 
virtual bool UseTrianglesAsQuad ()
 
virtual bool HasTileBuffering ()
 
virtual bool HasQuadBuffering ()
 
virtual bool HasTextBuffering ()
 
virtual bool HasQuadContainerBuffering ()
 
virtual bool Uses2DTextureArrays ()
 
virtual bool HasTextureArraysSupport ()
 
virtual const char * GetErrorString ()
 
virtual const char * GetVendorString ()=0
 
virtual const char * GetVersionString ()=0
 
virtual const char * GetRendererString ()=0
 
virtual TGLBackendReadPresentedImageDataGetReadPresentedImageDataFuncUnsafe ()=0
 
virtual bool GetWarning (std::vector< std::string > &WarningStrings)=0
 
virtual bool ShowMessageBox (unsigned Type, const char *pTitle, const char *pMsg)=0
 

Static Public Member Functions

static bool IsModernAPI (EBackendType BackendType)
 

Static Private Member Functions

static EBackendType DetectBackend ()
 
static void ClampDriverVersion (EBackendType BackendType)
 

Private Attributes

SDL_Window * m_pWindow = nullptr
 
SDL_GLContext m_GLContext = nullptr
 
ICommandProcessorm_pProcessor = nullptr
 
std::atomic< uint64_t > m_TextureMemoryUsage {0}
 
std::atomic< uint64_t > m_BufferMemoryUsage {0}
 
std::atomic< uint64_t > m_StreamMemoryUsage {0}
 
std::atomic< uint64_t > m_StagingMemoryUsage {0}
 
TTwGraphicsGpuList m_GpuList
 
TGLBackendReadPresentedImageData m_ReadPresentedImageDataFunc
 
int m_NumScreens
 
SBackendCapabilites m_Capabilites
 
char m_aVendorString [gs_GpuInfoStringSize] = {}
 
char m_aVersionString [gs_GpuInfoStringSize] = {}
 
char m_aRendererString [gs_GpuInfoStringSize] = {}
 
EBackendType m_BackendType = BACKEND_TYPE_AUTO
 
char m_aErrorString [256]
 

Additional Inherited Members

- Public Types inherited from IGraphicsBackend
enum  {
  INITFLAG_FULLSCREEN = 1 << 0 , INITFLAG_VSYNC = 1 << 1 , INITFLAG_RESIZABLE = 1 << 2 , INITFLAG_BORDERLESS = 1 << 3 ,
  INITFLAG_HIGHDPI = 1 << 4 , INITFLAG_DESKTOP_FULLSCREEN = 1 << 5
}
 
- Protected Member Functions inherited from CGraphicsBackend_Threaded
void StartProcessor (ICommandProcessor *pProcessor)
 
void StopProcessor ()
 
bool HasWarning ()
 

Constructor & Destructor Documentation

◆ CGraphicsBackend_SDL_GL()

CGraphicsBackend_SDL_GL::CGraphicsBackend_SDL_GL ( TTranslateFunc &&  TranslateFunc)

Member Function Documentation

◆ BufferMemoryUsage()

uint64_t CGraphicsBackend_SDL_GL::BufferMemoryUsage ( ) const
overridevirtual

Implements IGraphicsBackend.

◆ ClampDriverVersion()

void CGraphicsBackend_SDL_GL::ClampDriverVersion ( EBackendType  BackendType)
staticprivate

◆ DetectBackend()

EBackendType CGraphicsBackend_SDL_GL::DetectBackend ( )
staticprivate

◆ GetCurrentVideoMode()

void CGraphicsBackend_SDL_GL::GetCurrentVideoMode ( CVideoMode CurMode,
int  HiDPIScale,
int  MaxWindowWidth,
int  MaxWindowHeight,
int  ScreenId 
)
overridevirtual

Implements IGraphicsBackend.

◆ GetDriverVersion()

bool CGraphicsBackend_SDL_GL::GetDriverVersion ( EGraphicsDriverAgeType  DriverAgeType,
int &  Major,
int &  Minor,
int &  Patch,
const char *&  pName,
EBackendType  BackendType 
)
overridevirtual

Implements IGraphicsBackend.

◆ GetErrorString()

const char * CGraphicsBackend_SDL_GL::GetErrorString ( )
inlineoverridevirtual

Reimplemented from IGraphicsBackend.

◆ GetGpus()

const TTwGraphicsGpuList & CGraphicsBackend_SDL_GL::GetGpus ( ) const
overridevirtual

Implements IGraphicsBackend.

◆ GetNumScreens()

int CGraphicsBackend_SDL_GL::GetNumScreens ( ) const
inlineoverridevirtual

Implements IGraphicsBackend.

◆ GetReadPresentedImageDataFuncUnsafe()

TGLBackendReadPresentedImageData & CGraphicsBackend_SDL_GL::GetReadPresentedImageDataFuncUnsafe ( )
overridevirtual

Implements IGraphicsBackend.

◆ GetRendererString()

const char * CGraphicsBackend_SDL_GL::GetRendererString ( )
inlineoverridevirtual

Implements IGraphicsBackend.

◆ GetScreenName()

const char * CGraphicsBackend_SDL_GL::GetScreenName ( int  Screen) const
overridevirtual

Implements IGraphicsBackend.

◆ GetVendorString()

const char * CGraphicsBackend_SDL_GL::GetVendorString ( )
inlineoverridevirtual

Implements IGraphicsBackend.

◆ GetVersionString()

const char * CGraphicsBackend_SDL_GL::GetVersionString ( )
inlineoverridevirtual

Implements IGraphicsBackend.

◆ GetVideoModes()

void CGraphicsBackend_SDL_GL::GetVideoModes ( CVideoMode pModes,
int  MaxModes,
int *  pNumModes,
int  HiDPIScale,
int  MaxWindowWidth,
int  MaxWindowHeight,
int  ScreenId 
)
overridevirtual

Implements IGraphicsBackend.

◆ GetViewportSize()

void CGraphicsBackend_SDL_GL::GetViewportSize ( int &  w,
int &  h 
)
overridevirtual

Implements IGraphicsBackend.

◆ GetWindowScreen()

int CGraphicsBackend_SDL_GL::GetWindowScreen ( )
overridevirtual

Implements IGraphicsBackend.

◆ HasQuadBuffering()

bool CGraphicsBackend_SDL_GL::HasQuadBuffering ( )
inlineoverridevirtual

Reimplemented from IGraphicsBackend.

◆ HasQuadContainerBuffering()

bool CGraphicsBackend_SDL_GL::HasQuadContainerBuffering ( )
inlineoverridevirtual

Reimplemented from IGraphicsBackend.

◆ HasTextBuffering()

bool CGraphicsBackend_SDL_GL::HasTextBuffering ( )
inlineoverridevirtual

Reimplemented from IGraphicsBackend.

◆ HasTextureArraysSupport()

bool CGraphicsBackend_SDL_GL::HasTextureArraysSupport ( )
inlineoverridevirtual

Reimplemented from IGraphicsBackend.

◆ HasTileBuffering()

bool CGraphicsBackend_SDL_GL::HasTileBuffering ( )
inlineoverridevirtual

Reimplemented from IGraphicsBackend.

◆ Init()

int CGraphicsBackend_SDL_GL::Init ( const char *  pName,
int *  pScreen,
int *  pWidth,
int *  pHeight,
int *  pRefreshRate,
int *  pFsaaSamples,
int  Flags,
int *  pDesktopWidth,
int *  pDesktopHeight,
int *  pCurrentWidth,
int *  pCurrentHeight,
class IStorage pStorage 
)
overridevirtual

Implements IGraphicsBackend.

◆ IsConfigModernAPI()

bool CGraphicsBackend_SDL_GL::IsConfigModernAPI ( )
inlineoverridevirtual

Reimplemented from IGraphicsBackend.

◆ IsModernAPI()

bool CGraphicsBackend_SDL_GL::IsModernAPI ( EBackendType  BackendType)
static

◆ Maximize()

void CGraphicsBackend_SDL_GL::Maximize ( )
overridevirtual

Implements IGraphicsBackend.

◆ Minimize()

void CGraphicsBackend_SDL_GL::Minimize ( )
overridevirtual

Implements IGraphicsBackend.

◆ NotifyWindow()

void CGraphicsBackend_SDL_GL::NotifyWindow ( )
overridevirtual

Implements IGraphicsBackend.

◆ ResizeWindow()

bool CGraphicsBackend_SDL_GL::ResizeWindow ( int  w,
int  h,
int  RefreshRate 
)
overridevirtual

Implements IGraphicsBackend.

◆ SetWindowGrab()

void CGraphicsBackend_SDL_GL::SetWindowGrab ( bool  Grab)
overridevirtual

Implements IGraphicsBackend.

◆ SetWindowParams()

void CGraphicsBackend_SDL_GL::SetWindowParams ( int  FullscreenMode,
bool  IsBorderless 
)
overridevirtual

Implements IGraphicsBackend.

◆ SetWindowScreen()

bool CGraphicsBackend_SDL_GL::SetWindowScreen ( int  Index)
overridevirtual

Implements IGraphicsBackend.

◆ ShowMessageBox()

bool CGraphicsBackend_SDL_GL::ShowMessageBox ( unsigned  Type,
const char *  pTitle,
const char *  pMsg 
)
overridevirtual

Implements IGraphicsBackend.

◆ Shutdown()

int CGraphicsBackend_SDL_GL::Shutdown ( )
overridevirtual

Implements IGraphicsBackend.

◆ StagingMemoryUsage()

uint64_t CGraphicsBackend_SDL_GL::StagingMemoryUsage ( ) const
overridevirtual

Implements IGraphicsBackend.

◆ StreamedMemoryUsage()

uint64_t CGraphicsBackend_SDL_GL::StreamedMemoryUsage ( ) const
overridevirtual

Implements IGraphicsBackend.

◆ TextureMemoryUsage()

uint64_t CGraphicsBackend_SDL_GL::TextureMemoryUsage ( ) const
overridevirtual

Implements IGraphicsBackend.

◆ UpdateDisplayMode()

bool CGraphicsBackend_SDL_GL::UpdateDisplayMode ( int  Index)
overridevirtual

Implements IGraphicsBackend.

◆ Uses2DTextureArrays()

bool CGraphicsBackend_SDL_GL::Uses2DTextureArrays ( )
inlineoverridevirtual

Reimplemented from IGraphicsBackend.

◆ UseTrianglesAsQuad()

bool CGraphicsBackend_SDL_GL::UseTrianglesAsQuad ( )
inlineoverridevirtual

Reimplemented from IGraphicsBackend.

◆ WindowActive()

int CGraphicsBackend_SDL_GL::WindowActive ( )
overridevirtual

Implements IGraphicsBackend.

◆ WindowCreateNtf()

void CGraphicsBackend_SDL_GL::WindowCreateNtf ( uint32_t  WindowId)
overridevirtual

Implements IGraphicsBackend.

◆ WindowDestroyNtf()

void CGraphicsBackend_SDL_GL::WindowDestroyNtf ( uint32_t  WindowId)
overridevirtual

Implements IGraphicsBackend.

◆ WindowOpen()

int CGraphicsBackend_SDL_GL::WindowOpen ( )
overridevirtual

Implements IGraphicsBackend.

Member Data Documentation

◆ m_aErrorString

char CGraphicsBackend_SDL_GL::m_aErrorString[256]
private

◆ m_aRendererString

char CGraphicsBackend_SDL_GL::m_aRendererString[gs_GpuInfoStringSize] = {}
private

◆ m_aVendorString

char CGraphicsBackend_SDL_GL::m_aVendorString[gs_GpuInfoStringSize] = {}
private

◆ m_aVersionString

char CGraphicsBackend_SDL_GL::m_aVersionString[gs_GpuInfoStringSize] = {}
private

◆ m_BackendType

EBackendType CGraphicsBackend_SDL_GL::m_BackendType = BACKEND_TYPE_AUTO
private

◆ m_BufferMemoryUsage

std::atomic<uint64_t> CGraphicsBackend_SDL_GL::m_BufferMemoryUsage {0}
private

◆ m_Capabilites

SBackendCapabilites CGraphicsBackend_SDL_GL::m_Capabilites
private

◆ m_GLContext

SDL_GLContext CGraphicsBackend_SDL_GL::m_GLContext = nullptr
private

◆ m_GpuList

TTwGraphicsGpuList CGraphicsBackend_SDL_GL::m_GpuList
private

◆ m_NumScreens

int CGraphicsBackend_SDL_GL::m_NumScreens
private

◆ m_pProcessor

ICommandProcessor* CGraphicsBackend_SDL_GL::m_pProcessor = nullptr
private

◆ m_pWindow

SDL_Window* CGraphicsBackend_SDL_GL::m_pWindow = nullptr
private

◆ m_ReadPresentedImageDataFunc

TGLBackendReadPresentedImageData CGraphicsBackend_SDL_GL::m_ReadPresentedImageDataFunc
private

◆ m_StagingMemoryUsage

std::atomic<uint64_t> CGraphicsBackend_SDL_GL::m_StagingMemoryUsage {0}
private

◆ m_StreamMemoryUsage

std::atomic<uint64_t> CGraphicsBackend_SDL_GL::m_StreamMemoryUsage {0}
private

◆ m_TextureMemoryUsage

std::atomic<uint64_t> CGraphicsBackend_SDL_GL::m_TextureMemoryUsage {0}
private

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