Skip to content

Commit

Permalink
Updating WebGLRenderingContext for node (#8842)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljherrmann authored and bigtimebuddy committed Dec 12, 2022
1 parent 4d9d09e commit 08f4e5e
Show file tree
Hide file tree
Showing 3 changed files with 573 additions and 142 deletions.
4 changes: 2 additions & 2 deletions bundles/pixi.js-node/package.json
Expand Up @@ -64,11 +64,11 @@
"@pixi/spritesheet": "7.0.4",
"@pixi/text": "7.0.4",
"@pixi/text-bitmap": "7.0.4",
"@types/gl": "^4.1.0",
"@types/gl": "^6.0.2",
"@types/xml2js": "^0.4.11",
"canvas": "^2.9.1",
"cross-fetch": "^3.1.5",
"gl": "^5.0.0",
"gl": "^6.0.1",
"xml2js": "^0.4.23"
},
"nodeDependencies": [
Expand Down
4 changes: 2 additions & 2 deletions bundles/pixi.js-node/src/adapter/adapter.ts
@@ -1,6 +1,6 @@
import { fetch, Request, Response } from 'cross-fetch';
import fs from 'fs';
import createContext from 'gl';
import { WebGLRenderingContext } from 'gl';
import { settings, utils } from '@pixi/core';
import { NodeCanvasElement } from './NodeCanvasElement';

Expand All @@ -15,7 +15,7 @@ export const NodeAdapter = {
*/
createCanvas: (width?: number, height?: number) => new NodeCanvasElement(width, height),
/** Returns a webgl rendering context using the gl package. */
getWebGLRenderingContext: () => createContext(1, 1) as unknown as typeof WebGLRenderingContext,
getWebGLRenderingContext: () => WebGLRenderingContext,
/** Returns the fake user agent string of `node` */
getNavigator: () => ({ userAgent: 'node' }),
/** Returns the path from which the process is being run */
Expand Down

0 comments on commit 08f4e5e

Please sign in to comment.