Skip to content

Commit

Permalink
fix(imageMapper): make pwf and main textures resizable
Browse files Browse the repository at this point in the history
Using immutable textures caused warning when calling create2DFromRaw on the textures
  • Loading branch information
bruyeret authored and finetjul committed Oct 20, 2023
1 parent 8c29b16 commit bc77fa8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Sources/Rendering/OpenGL/ImageMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,9 @@ function vtkOpenGLImageMapper(publicAPI, model) {
const cSize = cWidth * textureHeight * 3;
const cTable = new Uint8Array(cSize);
if (!model.colorTexture) {
model.colorTexture = vtkOpenGLTexture.newInstance();
model.colorTexture = vtkOpenGLTexture.newInstance({
resizable: true,
});
model.colorTexture.setOpenGLRenderWindow(model._openGLRenderWindow);
}
// set interpolation on the texture based on property setting
Expand Down Expand Up @@ -859,7 +861,9 @@ function vtkOpenGLImageMapper(publicAPI, model) {
const pwfSize = pwfWidth * textureHeight;
const pwfTable = new Uint8Array(pwfSize);
if (!model.pwfTexture) {
model.pwfTexture = vtkOpenGLTexture.newInstance();
model.pwfTexture = vtkOpenGLTexture.newInstance({
resizable: true,
});
model.pwfTexture.setOpenGLRenderWindow(model._openGLRenderWindow);
}
// set interpolation on the texture based on property setting
Expand Down Expand Up @@ -967,7 +971,9 @@ function vtkOpenGLImageMapper(publicAPI, model) {
// Build the VBOs
const dims = image.getDimensions();
if (!model.openGLTexture) {
model.openGLTexture = vtkOpenGLTexture.newInstance();
model.openGLTexture = vtkOpenGLTexture.newInstance({
resizable: true,
});
model.openGLTexture.setOpenGLRenderWindow(model._openGLRenderWindow);
}
if (iType === InterpolationType.NEAREST) {
Expand Down

0 comments on commit bc77fa8

Please sign in to comment.