1
0
Fork 0
spectre/source/Platform/Unix/GLXContext.h
Henrik Hautakoski 090646b61a Platform/Unix: Rename X11SharedDisplay to Xlib, and remove Display member variable from all classes.
We now initialize/destroy the display in Xlib::init/shutdown that is called in UnixApplication::init/shutdown and
therefore is valid through the whole lifetime. So no need for classes to keep references.
2020-12-26 15:37:56 +01:00

49 lines
740 B
C++

#ifndef PLATFORM_UNIX_GLXCONTEXT_H
#define PLATFORM_UNIX_GLXCONTEXT_H
// X11 OpenGL Context (glx)
#include "glad_glx.h"
#include <Spectre/Display/GLContext.h>
namespace sp {
class GLXContext : public GLContext
{
public :
GLXContext();
~GLXContext();
// Create a context associated with a display.
bool create(const PlatformDisplay* display);
void destroy();
bool activate();
bool deactivate();
bool isActive() const;
bool setSwapInterval(int interval);
void setSize(unsigned int width, unsigned int height);
void setSize(const Vector2u size);
void swapBuffers();
private :
bool createGLContext();
private :
::Window m_win;
::GLXContext m_ctx;
};
} // namespace sp
#endif /* PLATFORM_UNIX_GLXCONTEXT_H */