@luma.gl/gltools
Advanced tools
Comparing version 9.0.0-alpha.10 to 9.0.0-alpha.11
@@ -35,3 +35,3 @@ import type { Device, DeviceProps } from '@luma.gl/api'; | ||
*/ | ||
export declare function hasFeatures(gl: WebGLRenderingContext, features: string | string[]): boolean; | ||
export declare function hasFeatures(device: Device | WebGLRenderingContext, features: string | string[]): boolean; | ||
/** | ||
@@ -41,3 +41,3 @@ * Check one feature | ||
*/ | ||
export declare function hasFeature(gl: WebGLRenderingContext, feature: string): boolean; | ||
export declare function hasFeature(device: Device | WebGLRenderingContext, feature: string): boolean; | ||
/** | ||
@@ -47,3 +47,3 @@ * Return a map of supported features | ||
*/ | ||
export declare function getFeatures(gl: WebGLRenderingContext): Record<string, boolean>; | ||
export declare function getFeatures(device: Device | WebGLRenderingContext): Record<string, boolean>; | ||
/** | ||
@@ -50,0 +50,0 @@ * Provides strings identifying the GPU vendor and driver. |
@@ -16,4 +16,4 @@ import GL from '@luma.gl/constants'; | ||
} | ||
export function hasFeatures(gl, features) { | ||
const webglDevice = WebGLDevice.attach(gl); | ||
export function hasFeatures(device, features) { | ||
const webglDevice = WebGLDevice.attach(device); | ||
const normalizedFeatures = Array.isArray(features) ? features : [features]; | ||
@@ -28,7 +28,7 @@ const deviceFeatures = normalizedFeatures.map(feature => classicToDeviceFeature(feature)); | ||
export function hasFeature(gl, feature) { | ||
return hasFeatures(gl, feature); | ||
export function hasFeature(device, feature) { | ||
return hasFeatures(device, feature); | ||
} | ||
export function getFeatures(gl) { | ||
const webglDevice = WebGLDevice.attach(gl); | ||
export function getFeatures(device) { | ||
const webglDevice = WebGLDevice.attach(device); | ||
const featureMap = {}; | ||
@@ -35,0 +35,0 @@ |
@@ -1,3 +0,3 @@ | ||
import type { RenderbufferProps } from '@luma.gl/webgl'; | ||
import { WEBGLRenderbuffer } from '@luma.gl/webgl'; | ||
import type { Device } from '@luma.gl/api'; | ||
import { WEBGLRenderbuffer, RenderbufferProps } from '@luma.gl/webgl'; | ||
export type { RenderbufferProps }; | ||
@@ -17,9 +17,9 @@ /** | ||
export default class Renderbuffer extends WEBGLRenderbuffer { | ||
static isSupported(gl: WebGLRenderingContext, options?: { | ||
static isSupported(device: Device | WebGLRenderingContext, options?: { | ||
format?: number; | ||
}): boolean; | ||
static getSamplesForFormat(gl: WebGL2RenderingContext, options: { | ||
static getSamplesForFormat(device: Device | WebGL2RenderingContext, options: { | ||
format: number; | ||
}): number; | ||
constructor(gl: WebGLRenderingContext, props?: RenderbufferProps); | ||
constructor(device: Device | WebGLRenderingContext, props?: RenderbufferProps); | ||
/** Creates and initializes a renderbuffer object's data store */ | ||
@@ -26,0 +26,0 @@ initialize(props: RenderbufferProps): this; |
import GL from '@luma.gl/constants'; | ||
import { WebGLDevice, WEBGLRenderbuffer } from '@luma.gl/webgl'; | ||
export default class Renderbuffer extends WEBGLRenderbuffer { | ||
static isSupported(gl, options) { | ||
static isSupported(device, options) { | ||
const gl = WebGLDevice.attach(device).gl; | ||
return WEBGLRenderbuffer.isSupported(gl, options); | ||
} | ||
static getSamplesForFormat(gl, options) { | ||
return gl.getInternalformatParameter(GL.RENDERBUFFER, options.format, GL.SAMPLES); | ||
static getSamplesForFormat(device, options) { | ||
const gl2 = WebGLDevice.attach(device).gl; | ||
return gl2.getInternalformatParameter(GL.RENDERBUFFER, options.format, GL.SAMPLES); | ||
} | ||
constructor(gl, props) { | ||
constructor(device, props) { | ||
const gl = WebGLDevice.attach(device).gl; | ||
super(WebGLDevice.attach(gl), props); | ||
@@ -14,0 +17,0 @@ } |
@@ -5,3 +5,3 @@ export { log } from '@luma.gl/api'; | ||
export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from '@luma.gl/webgl'; | ||
export { cssToDeviceRatio, cssToDevicePixels } from '@luma.gl/webgl'; | ||
export { cssToDeviceRatio, cssToDevicePixels, getDevicePixelRatio, setDevicePixelRatio } from './classic/device-pixels'; | ||
export type { GLParameters } from '@luma.gl/webgl'; | ||
@@ -8,0 +8,0 @@ export { getParameters, setParameters, resetParameters } from '@luma.gl/webgl'; |
export { log } from '@luma.gl/api'; | ||
export { createGLContext, instrumentGLContext, resizeGLContext, hasFeature, hasFeatures, getFeatures, getContextInfo, getGLContextInfo, getContextLimits, getContextDebugInfo } from './classic/context-api'; | ||
export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from '@luma.gl/webgl'; | ||
export { cssToDeviceRatio, cssToDevicePixels } from '@luma.gl/webgl'; | ||
export { cssToDeviceRatio, cssToDevicePixels, getDevicePixelRatio, setDevicePixelRatio } from './classic/device-pixels'; | ||
export { getParameters, setParameters, resetParameters } from '@luma.gl/webgl'; | ||
@@ -6,0 +6,0 @@ export { withParameters } from '@luma.gl/webgl'; |
{ | ||
"name": "@luma.gl/gltools", | ||
"version": "9.0.0-alpha.10", | ||
"version": "9.0.0-alpha.11", | ||
"description": "WebGL2 API Polyfills for WebGL1 WebGLRenderingContext", | ||
@@ -32,8 +32,8 @@ "license": "MIT", | ||
"@babel/runtime": "^7.0.0", | ||
"@luma.gl/constants": "9.0.0-alpha.10", | ||
"@luma.gl/engine": "9.0.0-alpha.10", | ||
"@luma.gl/webgl": "9.0.0-alpha.10", | ||
"@luma.gl/constants": "9.0.0-alpha.11", | ||
"@luma.gl/engine": "9.0.0-alpha.11", | ||
"@luma.gl/webgl": "9.0.0-alpha.11", | ||
"@probe.gl/log": "^3.5.0" | ||
}, | ||
"gitHead": "eaa912a3f1479a58e6b9915e905a9274e11d9c34" | ||
"gitHead": "3a99f57970a609d50948851aec7a56d56685ab62" | ||
} |
@@ -61,4 +61,4 @@ // luma.gl, MIT license | ||
*/ | ||
export function hasFeatures(gl: WebGLRenderingContext, features: string | string[]): boolean { | ||
const webglDevice = WebGLDevice.attach(gl); | ||
export function hasFeatures(device: Device | WebGLRenderingContext, features: string | string[]): boolean { | ||
const webglDevice = WebGLDevice.attach(device); | ||
const normalizedFeatures = Array.isArray(features) ? features : [features]; | ||
@@ -83,4 +83,4 @@ const deviceFeatures = normalizedFeatures.map(feature => classicToDeviceFeature(feature)); | ||
*/ | ||
export function hasFeature(gl: WebGLRenderingContext, feature: string): boolean { | ||
return hasFeatures(gl, feature); | ||
export function hasFeature(device: Device | WebGLRenderingContext, feature: string): boolean { | ||
return hasFeatures(device, feature); | ||
} | ||
@@ -92,4 +92,4 @@ | ||
*/ | ||
export function getFeatures(gl: WebGLRenderingContext): Record<string, boolean> { | ||
const webglDevice = WebGLDevice.attach(gl); | ||
export function getFeatures(device: Device | WebGLRenderingContext): Record<string, boolean> { | ||
const webglDevice = WebGLDevice.attach(device); | ||
const featureMap: Record<string, boolean> = {}; | ||
@@ -96,0 +96,0 @@ for (const feature in DEPRECATED_FEATURES) { |
/* eslint-disable no-inline-comments */ | ||
import type {Device} from '@luma.gl/api'; | ||
import GL from '@luma.gl/constants'; | ||
import type {RenderbufferProps} from '@luma.gl/webgl'; | ||
import {WebGLDevice, WEBGLRenderbuffer} from '@luma.gl/webgl'; | ||
import {WebGLDevice, WEBGLRenderbuffer, RenderbufferProps} from '@luma.gl/webgl'; | ||
@@ -21,12 +21,15 @@ export type {RenderbufferProps} | ||
export default class Renderbuffer extends WEBGLRenderbuffer { | ||
static isSupported(gl: WebGLRenderingContext, options?: {format?: number}): boolean { | ||
static isSupported(device: Device | WebGLRenderingContext, options?: {format?: number}): boolean { | ||
const gl = WebGLDevice.attach(device).gl; | ||
return WEBGLRenderbuffer.isSupported(gl, options); | ||
} | ||
static getSamplesForFormat(gl: WebGL2RenderingContext, options: {format: number}): number{ | ||
static getSamplesForFormat(device: Device | WebGL2RenderingContext, options: {format: number}): number{ | ||
const gl2 = WebGLDevice.attach(device).gl as WebGL2RenderingContext; | ||
// Polyfilled to return [0] under WebGL1 | ||
return gl.getInternalformatParameter(GL.RENDERBUFFER, options.format, GL.SAMPLES); | ||
return gl2.getInternalformatParameter(GL.RENDERBUFFER, options.format, GL.SAMPLES); | ||
} | ||
constructor(gl: WebGLRenderingContext, props?: RenderbufferProps) { | ||
constructor(device: Device | WebGLRenderingContext, props?: RenderbufferProps) { | ||
const gl = WebGLDevice.attach(device).gl; | ||
super(WebGLDevice.attach(gl), props); | ||
@@ -33,0 +36,0 @@ } |
@@ -33,3 +33,8 @@ // luma.gl, MIT license | ||
// Device ratio | ||
export {cssToDeviceRatio, cssToDevicePixels} from '@luma.gl/webgl'; | ||
export { | ||
cssToDeviceRatio, | ||
cssToDevicePixels, | ||
getDevicePixelRatio, | ||
setDevicePixelRatio | ||
} from './classic/device-pixels'; | ||
@@ -39,18 +44,8 @@ // Unified parameter API | ||
export type {GLParameters} from '@luma.gl/webgl'; | ||
export { | ||
getParameters, | ||
setParameters, | ||
resetParameters | ||
} from '@luma.gl/webgl'; | ||
export {getParameters, setParameters, resetParameters} from '@luma.gl/webgl'; | ||
export { | ||
withParameters | ||
} from '@luma.gl/webgl'; | ||
export {withParameters} from '@luma.gl/webgl'; | ||
// State tracking | ||
export { | ||
trackContextState, | ||
pushContextState, | ||
popContextState | ||
} from '@luma.gl/webgl'; | ||
export {trackContextState, pushContextState, popContextState} from '@luma.gl/webgl'; | ||
@@ -60,3 +55,2 @@ // Polyfills (supports a subset of WebGL2 APIs on WebGL1 contexts) | ||
// Features | ||
@@ -122,3 +116,6 @@ export {DEPRECATED_FEATURES as FEATURES} from './classic/features'; | ||
// luma.gl v8 Engine API | ||
export type {ClassicAnimationLoopProps, ClassicAnimationProps} from './engine/classic-animation-loop'; | ||
export type { | ||
ClassicAnimationLoopProps, | ||
ClassicAnimationProps | ||
} from './engine/classic-animation-loop'; | ||
export {default as ClassicAnimationLoop} from './engine/classic-animation-loop'; | ||
@@ -125,0 +122,0 @@ export type {ClassicModelProps} from './engine/classic-model'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
965491
207
13548
+ Added@luma.gl/api@9.0.0-alpha.11(transitive)
+ Added@luma.gl/constants@9.0.0-alpha.11(transitive)
+ Added@luma.gl/engine@9.0.0-alpha.11(transitive)
+ Added@luma.gl/shadertools@9.0.0-alpha.11(transitive)
+ Added@luma.gl/webgl@9.0.0-alpha.11(transitive)
- Removed@luma.gl/api@9.0.0-alpha.10(transitive)
- Removed@luma.gl/constants@9.0.0-alpha.10(transitive)
- Removed@luma.gl/engine@9.0.0-alpha.10(transitive)
- Removed@luma.gl/shadertools@9.0.0-alpha.10(transitive)
- Removed@luma.gl/webgl@9.0.0-alpha.10(transitive)