load glDiscardFramebufferEXT with a library function if needed

This commit is contained in:
Konstantin Käfer
2014-06-17 05:52:24 -07:00
parent 4899d72da6
commit 68c621b2a6
3 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,10 @@
#include "glfw_view.hpp"
GLFWView::GLFWView(bool fullscreen) : fullscreen(fullscreen) {}
GLFWView::GLFWView(bool fullscreen) : fullscreen(fullscreen) {
#ifdef NVIDIA
glDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC)glfwGetProcAddress("glDiscardFramebufferEXT");
#endif
}
GLFWView::~GLFWView() { glfwTerminate(); }

View File

@@ -6,7 +6,10 @@
#ifdef NVIDIA
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
// #include <EGL/egl.h>
extern PFNGLDISCARDFRAMEBUFFEREXTPROC glDiscardFramebufferEXT;
#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
#elif __APPLE__
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE

View File

@@ -2,6 +2,10 @@
#include <iostream>
#ifdef NVIDIA
PFNGLDISCARDFRAMEBUFFEREXTPROC glDiscardFramebufferEXT;
#endif
void _CHECK_GL_ERROR(const char *cmd, const char *file, int line) {
std::cout << cmd << ";" << std::endl;