2013-04-18 03:29:41 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Common/MathUtil.h"
|
|
|
|
#include "DolphinWX/GLInterface/GLInterface.h"
|
|
|
|
#include "VideoBackends/OGL/GLExtensions/GLExtensions.h"
|
|
|
|
#include "VideoCommon/VideoConfig.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2008-12-10 23:23:05 +00:00
|
|
|
#ifndef _WIN32
|
2009-03-22 11:21:44 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <sys/types.h>
|
2009-03-08 19:19:51 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
#endif
|
2012-12-17 20:54:20 +00:00
|
|
|
void InitInterface();
|
2009-03-08 19:19:51 +00:00
|
|
|
|
2012-12-17 20:54:20 +00:00
|
|
|
// Helpers
|
|
|
|
GLuint OpenGL_CompileProgram(const char *vertexShader, const char *fragmentShader);
|
2009-03-08 19:19:51 +00:00
|
|
|
|
2009-03-22 11:21:44 +00:00
|
|
|
// Error reporting - use the convenient macros.
|
|
|
|
GLuint OpenGL_ReportGLError(const char *function, const char *file, int line);
|
|
|
|
bool OpenGL_ReportFBOError(const char *function, const char *file, int line);
|
|
|
|
|
2010-08-03 10:48:49 +00:00
|
|
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
2010-08-04 14:00:59 +00:00
|
|
|
#define GL_REPORT_ERROR() OpenGL_ReportGLError(__FUNCTION__, __FILE__, __LINE__)
|
|
|
|
#define GL_REPORT_ERRORD() OpenGL_ReportGLError(__FUNCTION__, __FILE__, __LINE__)
|
|
|
|
#define GL_REPORT_FBO_ERROR() OpenGL_ReportFBOError(__FUNCTION__, __FILE__, __LINE__)
|
2009-03-22 11:21:44 +00:00
|
|
|
#else
|
2013-03-16 23:52:49 +00:00
|
|
|
__forceinline GLenum GL_REPORT_ERROR() { return GL_NO_ERROR; }
|
2010-08-04 14:00:59 +00:00
|
|
|
#define GL_REPORT_ERRORD() (void)GL_NO_ERROR
|
|
|
|
#define GL_REPORT_FBO_ERROR() (void)true
|
2008-12-08 04:46:09 +00:00
|
|
|
#endif
|
2009-03-22 11:21:44 +00:00
|
|
|
|
2013-02-07 11:47:41 +00:00
|
|
|
// this should be removed in future, but as long as glsl is unstable, we should really read this messages
|
2013-10-29 05:23:17 +00:00
|
|
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
2013-03-07 19:26:56 +00:00
|
|
|
#define DEBUG_GLSL 1
|
|
|
|
#else
|
|
|
|
#define DEBUG_GLSL 0
|
|
|
|
#endif
|