Skip to content

Commit

Permalink
support graphics device being fed in
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck committed Feb 29, 2024
1 parent 312c6ff commit 38bac81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/framework/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ class Application extends AppBase {
* handler for input.
* @param {string} [options.scriptPrefix] - Prefix to apply to script urls before loading.
* @param {string} [options.assetPrefix] - Prefix to apply to asset urls before loading.
* @param {import('../platform/graphics/graphics-device.js').GraphicsDevice} [options.graphicsDevice] - The
* graphics device used by the application. If not provided, a WebGl graphics device will be
* created.
* @param {object} [options.graphicsDeviceOptions] - Options object that is passed into the
* {@link GraphicsDevice} constructor.
* @param {string[]} [options.scriptsOrder] - Scripts in order of loading first.
Expand All @@ -123,7 +126,7 @@ class Application extends AppBase {

const appOptions = new AppOptions();

appOptions.graphicsDevice = this.createDevice(canvas, options);
appOptions.graphicsDevice = options.graphicsDevice ?? this.createDevice(canvas, options);
this.addComponentSystems(appOptions);
this.addResourceHandles(appOptions);

Expand Down

0 comments on commit 38bac81

Please sign in to comment.