Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- **TypeScript declarations**: expanded coverage and corrected types may expose build errors. Remove conflicting local declaration shims and fix code rejected by the new types.
- **TypeScript libraries**: typed-array factories now declare BigInt support. Add `ES2020.BigInt` if your `lib` list does not include `ES2020` or later. Your `target` can stay unchanged.
- **Accessor types**: `setXFrom` methods and setters that return no value now declare `void`. Getter types include `null` or `undefined` where applicable.
- **vtkOpenGLFramebuffer**: replace `getColorTexture()` with `getColorBuffers()[0]`.

## From 36.x to 37

Expand Down
2 changes: 1 addition & 1 deletion Sources/Rendering/OpenGL/Convolution2DPass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function vtkConvolution2DPass(publicAPI, model) {
gl.scissor(0, 0, size[0], size[1]);

// activate texture
const tex = model.framebuffer.getColorTexture();
const tex = model.framebuffer.getColorBuffersByReference()[0];
tex.activate();
model.convolutionShader.setUniformi('u_image', tex.getTextureUnit());
model.convolutionShader.setUniform2f(
Expand Down
2 changes: 1 addition & 1 deletion Sources/Rendering/OpenGL/ForwardPass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function vtkForwardPass(publicAPI, model) {

publicAPI.getZBufferTexture = () => {
if (model.framebuffer) {
return model.framebuffer.getColorTexture();
return model.framebuffer.getColorBuffersByReference()[0];
}
return null;
};
Expand Down
7 changes: 0 additions & 7 deletions Sources/Rendering/OpenGL/Framebuffer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@ export interface vtkFramebuffer extends vtkObject {
*/
getColorBuffersByReference(): (Nullable<vtkOpenGLTexture> | undefined)[];

/**
* Get the texture attached as the first color buffer, if one is attached.
*
* @deprecated Use `getColorBuffers()[0]` instead.
*/
getColorTexture(): Nullable<vtkOpenGLTexture> | undefined;

/**
* Get the underlying WebGL framebuffer, or `null` before `create()`.
*/
Expand Down
3 changes: 0 additions & 3 deletions Sources/Rendering/OpenGL/Framebuffer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,6 @@ function vtkFramebuffer(publicAPI, model) {
publicAPI.releaseGraphicsResources,
publicAPI.delete
);

// For backwards compatibility. Use getColorBuffers()[0] going forward.
publicAPI.getColorTexture = () => model.colorBuffers[0];
}

// ----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ it.skipIf(__VTK_TEST_NO_WEBGL__)(

// Removing one attachment must not shift the others off their slots.
framebuffer.removeColorBuffer(0);
expect(framebuffer.getColorBuffers()[2]).toBe(texture2);
const colorBuffers = framebuffer.getColorBuffers();
expect(colorBuffers[0]).toBeNull();
expect(colorBuffers[1]).toBeUndefined();
expect(colorBuffers[2]).toBe(texture2);
expect(framebuffer.getColorBuffersByReference()).toEqual(colorBuffers);
expect(() => framebuffer.bind()).not.toThrow();

// recreating while bound must keep the caller on the new framebuffer
Expand Down
2 changes: 1 addition & 1 deletion Sources/Rendering/OpenGL/RadialDistortionPass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function vtkRadialDistortionPass(publicAPI, model) {
gl.scissor(0, 0, size[0], size[1]);

// activate texture
const tex = model.framebuffer.getColorTexture();
const tex = model.framebuffer.getColorBuffersByReference()[0];
tex.activate();
model.copyShader.setUniformi('distTexture', tex.getTextureUnit());

Expand Down
2 changes: 1 addition & 1 deletion Sources/Rendering/OpenGL/VolumeMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
model.context.viewport(0, 0, size[0], size[1]);

// activate texture
const tex = model.framebuffer.getColorTexture();
const tex = model.framebuffer.getColorBuffersByReference()[0];
tex.activate();
model.copyShader.setUniformi('texture', tex.getTextureUnit());
model.copyShader.setUniform2f('tfactor', model.fvp[0], model.fvp[1]);
Expand Down
Loading