All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
CStdGLCtx Class Reference

#include <C4DrawGL.h>

Collaboration diagram for CStdGLCtx:

Public Member Functions

 CStdGLCtx ()
virtual ~CStdGLCtx ()
virtual void Clear (bool multisample_change=false)
virtual bool Init (C4Window *pWindow, C4AbstractApp *pApp)
virtual bool Select (bool verbose=false)
virtual void Deselect ()
virtual bool PageFlip ()

Protected Member Functions

void SelectCommon ()

Protected Attributes

std::list< CStdGLCtx * >::iterator this_context
std::vector< GLuint > hVAOs
std::vector< unsigned int > VAOsToBeDeleted

Static Protected Attributes

static std::list< CStdGLCtx * > contexts


class CStdGL
class C4Surface

Detailed Description

Definition at line 103 of file C4DrawGL.h.

Constructor & Destructor Documentation

CStdGLCtx::CStdGLCtx ( )
virtual CStdGLCtx::~CStdGLCtx ( )

Definition at line 110 of file C4DrawGL.h.

References Clear().

110 { Clear(); } // dtor
virtual void Clear(bool multisample_change=false)

Here is the call graph for this function:

Member Function Documentation

virtual void CStdGLCtx::Clear ( bool  multisample_change = false)

Referenced by ~CStdGLCtx().

Here is the caller graph for this function:

virtual void CStdGLCtx::Deselect ( )

Referenced by CStdGL::Clear().

Here is the caller graph for this function:

virtual bool CStdGLCtx::Init ( C4Window pWindow,
C4AbstractApp pApp 

Referenced by CStdGL::CreateContext().

Here is the caller graph for this function:

virtual bool CStdGLCtx::PageFlip ( )

Referenced by C4Surface::PageFlip().

Here is the caller graph for this function:

virtual bool CStdGLCtx::Select ( bool  verbose = false)

Referenced by CStdGL::EnsureMainContextSelected(), CStdGL::PrepareRendering(), CStdGL::RestoreDeviceObjects(), and C4TexRef::Unlock().

Here is the caller graph for this function:

void CStdGLCtx::SelectCommon ( )

Definition at line 33 of file C4DrawGLCtx.cpp.

References hVAOs, CStdGL::pCurrCtx, pGL, and VAOsToBeDeleted.

34 {
35  pGL->pCurrCtx = this;
36  // set some default states
37  glDisable(GL_DEPTH_TEST);
38  glDepthFunc(GL_LESS);
39  glDisable(GL_CULL_FACE);
40  glEnable(GL_BLEND);
41  // Delete pending VAOs
42  std::vector<GLuint> toBeDeleted;
43  if (!VAOsToBeDeleted.empty())
44  {
45  for (unsigned int i = 0; i < VAOsToBeDeleted.size(); ++i)
46  {
47  if (VAOsToBeDeleted[i] < hVAOs.size() && hVAOs[VAOsToBeDeleted[i]] != 0)
48  {
49  toBeDeleted.push_back(hVAOs[VAOsToBeDeleted[i]]);
50  hVAOs[VAOsToBeDeleted[i]] = 0;
51  }
52  }
54  glDeleteVertexArrays(toBeDeleted.size(), &toBeDeleted[0]);
55  VAOsToBeDeleted.clear();
56  }
57 }
CStdGLCtx * pCurrCtx
Definition: C4DrawGL.h:179
std::vector< unsigned int > VAOsToBeDeleted
Definition: C4DrawGL.h:141
CStdGL * pGL
Definition: C4DrawGL.cpp:914
std::vector< GLuint > hVAOs
Definition: C4DrawGL.h:139

Friends And Related Function Documentation

friend class C4Surface

Definition at line 144 of file C4DrawGL.h.

friend class CStdGL

Definition at line 143 of file C4DrawGL.h.

Member Data Documentation

std::list< CStdGLCtx * > CStdGLCtx::contexts

Definition at line 135 of file C4DrawGL.h.

Referenced by CStdGL::FreeVAOID().

std::vector<GLuint> CStdGLCtx::hVAOs

Definition at line 139 of file C4DrawGL.h.

Referenced by CStdGL::FreeVAOID(), CStdGL::GetVAO(), and SelectCommon().

C4Window* CStdGLCtx::pWindow

Definition at line 127 of file C4DrawGL.h.

std::list<CStdGLCtx*>::iterator CStdGLCtx::this_context

Definition at line 136 of file C4DrawGL.h.

std::vector<unsigned int> CStdGLCtx::VAOsToBeDeleted

Definition at line 141 of file C4DrawGL.h.

Referenced by CStdGL::FreeVAOID(), and SelectCommon().

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