45 lines
645 B
C++
45 lines
645 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 swapBuffers();
|
|
|
|
private :
|
|
bool createGLContext();
|
|
|
|
private :
|
|
|
|
::Window m_win;
|
|
|
|
::GLXContext m_ctx;
|
|
};
|
|
|
|
} // namespace sp
|
|
|
|
#endif /* PLATFORM_UNIX_GLXCONTEXT_H */
|