You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#ifndef LIBRARY_LOADER_GL_H
|
|
#define LIBRARY_LOADER_GL_H
|
|
|
|
#include "gl/gl.h"
|
|
#include <dlfcn.h>
|
|
|
|
class gl_loader {
|
|
public:
|
|
gl_loader();
|
|
~gl_loader();
|
|
|
|
bool Load(void *handle = nullptr, bool egl_only = false);
|
|
bool IsLoaded() { return loaded_; }
|
|
|
|
decltype(&::glXGetProcAddress) glXGetProcAddress;
|
|
decltype(&::glXGetProcAddressARB) glXGetProcAddressARB;
|
|
decltype(&::glXCreateContext) glXCreateContext;
|
|
decltype(&::glXDestroyContext) glXDestroyContext;
|
|
decltype(&::glXSwapBuffers) glXSwapBuffers;
|
|
decltype(&::glXSwapIntervalEXT) glXSwapIntervalEXT;
|
|
decltype(&::glXSwapIntervalSGI) glXSwapIntervalSGI;
|
|
decltype(&::glXSwapIntervalMESA) glXSwapIntervalMESA;
|
|
decltype(&::glXGetSwapIntervalMESA) glXGetSwapIntervalMESA;
|
|
decltype(&::glXMakeCurrent) glXMakeCurrent;
|
|
decltype(&::glXGetCurrentContext) glXGetCurrentContext;
|
|
|
|
decltype(&::eglSwapBuffers) eglSwapBuffers;
|
|
|
|
private:
|
|
void CleanUp(bool unload);
|
|
|
|
bool loaded_;
|
|
|
|
// Disallow copy constructor and assignment operator.
|
|
gl_loader(const gl_loader&);
|
|
void operator=(const gl_loader&);
|
|
};
|
|
|
|
#endif // LIBRARY_LOADER_GL_H
|