stuff-from-scratch/src/windows/ui_interfaces/x11/GlxInterface.h
2021-04-17 13:57:14 +01:00

33 lines
614 B
C++

#pragma once
#include <GL/glx.h>
#include <xcb/xcb.h>
#include <memory>
class GlxInterface
{
public:
GlxInterface();
static std::unique_ptr<GlxInterface> Create();
void SetupContext(Display* display, int default_screen);
bool SetupWindow(Display* display, xcb_window_t window);
void DestroyWindow(Display* display);
void DestroyContext(Display* display);
void SwapBuffers(Display* display);
void Draw();
private:
GLXContext mContext;
GLXDrawable mDrawable;
GLXWindow mWindow;
GLXFBConfig mConfig;
};
using GlxInterfacePtr = std::unique_ptr<GlxInterface>;