The OpenGL wrapper now handles context change
Fixed some bugs Thanks to Raakz Former-commit-id: f156ba7aa3307cccd83c9c02987dadad02cd8185
This commit is contained in:
@@ -32,13 +32,13 @@ class NAZARA_API NzContext : public NzResource
|
||||
|
||||
const NzContextParameters& GetParameters() const;
|
||||
bool IsActive() const;
|
||||
bool SetActive(bool active) const;
|
||||
bool SetActive(bool active);
|
||||
void SwapBuffers();
|
||||
|
||||
static bool EnsureContext();
|
||||
static const NzContext* GetCurrent();
|
||||
static const NzContext* GetReference();
|
||||
static const NzContext* GetThreadContext();
|
||||
static NzContext* GetCurrent();
|
||||
static NzContext* GetReference();
|
||||
static NzContext* GetThreadContext();
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
|
||||
|
||||
@@ -44,10 +44,13 @@ enum nzOpenGLExtension
|
||||
nzOpenGLExtension_Max = nzOpenGLExtension_VertexArrayObjects
|
||||
};
|
||||
|
||||
class NzContext;
|
||||
using NzOpenGLFunc = void (*)();
|
||||
|
||||
class NAZARA_API NzOpenGL
|
||||
{
|
||||
friend NzContext;
|
||||
|
||||
public:
|
||||
enum FormatType
|
||||
{
|
||||
@@ -120,6 +123,10 @@ class NAZARA_API NzOpenGL
|
||||
static GLenum TextureTarget[nzImageType_Max+1];
|
||||
static GLenum TextureTargetBinding[nzImageType_Max+1];
|
||||
static GLenum TextureTargetProxy[nzImageType_Max+1];
|
||||
|
||||
private:
|
||||
static void OnContextDestruction(NzContext* context);
|
||||
static void OnContextChange(NzContext* newContext);
|
||||
};
|
||||
|
||||
NAZARA_API extern PFNGLACTIVETEXTUREPROC glActiveTexture;
|
||||
|
||||
Reference in New Issue
Block a user