Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow graphics device to be provided to Application #6099

Merged
merged 1 commit into from
Feb 29, 2024
Merged
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
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