stuff-from-scratch/src/windows/ui_interfaces/x11/XcbGlWindowInterface.h
2022-11-14 15:31:38 +00:00

30 lines
573 B
C++

#pragma once
#include <GL/glx.h>
#include <xcb/xcb.h>
#include <memory>
class XcbGlInterface;
class XcbGlWindowInterface
{
public:
XcbGlWindowInterface(XcbGlInterface* glInterface);
~XcbGlWindowInterface();
bool initialize(xcb_window_t window);
void afterPaint();
void resizeViewPort(unsigned width, unsigned height);
private:
void destroyWindow();
void swapBuffers();
XcbGlInterface* mGlInterface{nullptr};
GLXDrawable mDrawable;
GLXWindow mWindow;
};
using XcbGlWindowInterfacePtr = std::unique_ptr<XcbGlWindowInterface>;