2019-09-01 20:53:16 +02:00
|
|
|
#ifndef __INCLUDED_OPENGLX_HOOK_H__
|
|
|
|
#define __INCLUDED_OPENGLX_HOOK_H__
|
|
|
|
|
|
|
|
#include "../Base_Hook.h"
|
|
|
|
|
|
|
|
#ifdef __LINUX__
|
2020-01-19 12:55:14 -05:00
|
|
|
#ifdef EMU_OVERLAY
|
2019-09-01 20:53:16 +02:00
|
|
|
#include <GL/glew.h>
|
|
|
|
#include <GL/glx.h>
|
|
|
|
|
|
|
|
class OpenGLX_Hook : public Base_Hook
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr const char *DLL_NAME = "libGLX.so";
|
|
|
|
|
|
|
|
private:
|
|
|
|
static OpenGLX_Hook* _inst;
|
|
|
|
|
|
|
|
// Variables
|
|
|
|
bool hooked;
|
|
|
|
bool initialized;
|
2019-09-03 17:25:09 +02:00
|
|
|
Display *display;
|
|
|
|
GLXContext context;
|
2019-09-01 20:53:16 +02:00
|
|
|
|
|
|
|
// Functions
|
|
|
|
OpenGLX_Hook();
|
|
|
|
|
|
|
|
void resetRenderState();
|
2019-09-03 10:32:32 +02:00
|
|
|
void prepareForOverlay(Display* display, GLXDrawable drawable);
|
2019-09-01 20:53:16 +02:00
|
|
|
|
|
|
|
// Hook to render functions
|
2019-09-03 10:32:32 +02:00
|
|
|
|
2019-09-01 20:53:16 +02:00
|
|
|
|
|
|
|
decltype(glXSwapBuffers)* _glXSwapBuffers;
|
|
|
|
|
|
|
|
public:
|
2019-09-03 10:32:32 +02:00
|
|
|
static void MyglXSwapBuffers(Display* display, GLXDrawable drawable);
|
|
|
|
|
2019-09-01 20:53:16 +02:00
|
|
|
virtual ~OpenGLX_Hook();
|
|
|
|
|
|
|
|
bool start_hook();
|
|
|
|
static OpenGLX_Hook* Inst();
|
|
|
|
virtual const char* get_lib_name() const;
|
|
|
|
void loadFunctions(decltype(glXSwapBuffers)* pfnglXSwapBuffers);
|
|
|
|
};
|
|
|
|
|
2020-01-19 12:55:14 -05:00
|
|
|
#endif//EMU_OVERLAY
|
2019-09-01 20:53:16 +02:00
|
|
|
#endif//__LINUX__
|
|
|
|
#endif//__INCLUDED_OPENGLX_HOOK_H__
|