Skip to content

Commit

Permalink
[Fix] Create a dummy framebuffer on NullDevice to avoid undefined acc…
Browse files Browse the repository at this point in the history
…ess (#7382)

Co-authored-by: Martin Valigursky <[email protected]>
  • Loading branch information
mvaligursky and Martin Valigursky authored Feb 26, 2025
1 parent 4c5f88e commit 19d45fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/platform/graphics/null/null-graphics-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
DEVICETYPE_NULL
} from '../constants.js';
import { GraphicsDevice } from '../graphics-device.js';
import { RenderTarget } from '../render-target.js';

import { NullIndexBuffer } from './null-index-buffer.js';
import { NullRenderTarget } from './null-render-target.js';
Expand All @@ -17,6 +18,14 @@ class NullGraphicsDevice extends GraphicsDevice {
this.isNull = true;
this._deviceType = DEVICETYPE_NULL;
this.samples = 1;

this.backBuffer = new RenderTarget({
name: 'Framebuffer',
graphicsDevice: this,
depth: this.initOptions.depth,
stencil: this.supportsStencil,
samples: this.samples
});
}

destroy() {
Expand Down

0 comments on commit 19d45fb

Please sign in to comment.