Skip to content

Commit

Permalink
fix(Rendering): pixel space callback issues
Browse files Browse the repository at this point in the history
Recent changes broke this class.
  • Loading branch information
martinken committed Nov 29, 2017
1 parent a4c1ba7 commit b0b4d0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function vtkOpenGLPixelSpaceCallbackMapper(publicAPI, model) {

publicAPI.opaquePass = (prepass, renderPass) => {
model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
model.openGLRenderWindow = model.openGLRenderer.getParent();
const aspectRatio = model.openGLRenderer.getAspectRatio();
const camera = model.openGLRenderer ? model.openGLRenderer.getRenderable().getActiveCamera() : null;
const tsize = model.openGLRenderer.getTiledSizeAndOrigin();
Expand All @@ -24,7 +25,7 @@ function vtkOpenGLPixelSpaceCallbackMapper(publicAPI, model) {
const width = Math.floor(zbt.getWidth());
const height = Math.floor(zbt.getHeight());

const gl = zbt.getContext();
const gl = model.openGLRenderWindow.getContext();
zbt.bind();

// Here we need to use vtkFramebuffer to save current settings (bindings/buffers)
Expand All @@ -51,7 +52,6 @@ function vtkOpenGLPixelSpaceCallbackMapper(publicAPI, model) {
fb.restorePreviousBindingsAndBuffers();
}

zbt.unBind();
gl.deleteFramebuffer(framebuffer);
}

Expand Down

0 comments on commit b0b4d0f

Please sign in to comment.