rpcsx/rpcs3/Emu/GS/GL/OpenGL.cpp
Peter Tissen 21da317453 Logging system rework
* use one central unified log with channels/priorities ad-hoc listener registration and de-registration
* disable buffering by default
* add multi-threaded ringbuffer implementation
* use buffered listener for the gui (using the ringbuffer)
2014-06-26 17:34:28 +02:00

60 lines
1.2 KiB
C++

#include "stdafx.h"
#include "Utilities/Log.h"
#include "OpenGL.h"
void InitProcTable()
{
#ifdef _WIN32
#define OPENGL_PROC(p, n) OPENGL_PROC2(p, n, gl##n)
#define OPENGL_PROC2(p, n, tn) /*if(!gl##n)*/ if(!(gl##n = (p)wglGetProcAddress(#tn))) LOG_ERROR(RSX, "OpenGL: initialization of " #tn " failed.")
#include "GLProcTable.h"
#undef OPENGL_PROC
#undef OPENGL_PROC2
#endif
#ifdef __UNIX__
glewExperimental = true;
glewInit();
#endif
}
#ifdef _WIN32
#define OPENGL_PROC(p, n) p gl##n = nullptr
#define OPENGL_PROC2(p, n, tn) OPENGL_PROC(p, n)
#include "GLProcTable.h"
#undef OPENGL_PROC
#undef OPENGL_PROC2
#endif
OpenGL::OpenGL()
{
Close();
Init();
}
OpenGL::~OpenGL()
{
Close();
}
void OpenGL::Init()
{
#ifdef _WIN32
#define OPENGL_PROC(p, n) OPENGL_PROC2(p, n, gl##n)
#define OPENGL_PROC2(p, n, tn) if(!(n = (p)wglGetProcAddress(#tn))) LOG_ERROR(RSX, "OpenGL: initialization of " #tn " failed.")
#include "GLProcTable.h"
#undef OPENGL_PROC
#undef OPENGL_PROC2
#endif
}
void OpenGL::Close()
{
#ifdef _WIN32
#define OPENGL_PROC(p, n) n = nullptr
#define OPENGL_PROC2(p, n, tn) OPENGL_PROC(p, n)
#include "GLProcTable.h"
#undef OPENGL_PROC
#undef OPENGL_PROC2
#endif
}