mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-14 23:39:00 -05:00
OpenGL State Caching.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <ghoul/opengl/framebufferobject.h>
|
||||
#include <ghoul/opengl/openglstatecache.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
|
||||
namespace {
|
||||
@@ -111,13 +112,16 @@ void ScreenSpaceFramebuffer::render() {
|
||||
|
||||
if (!_renderFunctions.empty()) {
|
||||
GLint viewport[4];
|
||||
glGetIntegerv(GL_VIEWPORT, viewport);
|
||||
//glGetIntegerv(GL_VIEWPORT, viewport);
|
||||
global::renderEngine.openglStateCache().viewPort(viewport);
|
||||
glViewport(
|
||||
static_cast<GLint>(-size.x * xratio),
|
||||
static_cast<GLint>(-size.y * yratio),
|
||||
static_cast<GLsizei>(resolution.x * xratio),
|
||||
static_cast<GLsizei>(resolution.y * yratio)
|
||||
);
|
||||
global::renderEngine.openglStateCache().setViewPortState(viewport);
|
||||
|
||||
GLint defaultFBO = _framebuffer->getActiveObject();
|
||||
_framebuffer->activate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user