mirror of
https://github.com/visgl/luma.gl.git
synced 2026-02-01 14:33:49 +00:00
Working tests
This commit is contained in:
parent
41384eebbf
commit
2d2f50426e
@ -80,11 +80,11 @@
|
||||
"precommit": "npm test",
|
||||
"publish-prod": "npm run build && npm run test-fast && npm publish",
|
||||
"publish-beta": "npm run build && npm run test-fast && npm publish --tag beta",
|
||||
"test": "npm run lint && npm run build-dist && npm run test-headless && npm run test-headless-nowebgl",
|
||||
"test": "npm run lint && npm run build-dist && npm run test-headless-nowebgl && npm run test-headless",
|
||||
"test-fast": "npm run lint && npm run test-headless && npm run test-headless-nowebgl",
|
||||
"test-headless": "babel-node --include='' test/headless.js | faucet",
|
||||
"test-headless-nowebgl": "babel-node --include='' test/headless-nowebgl.js | faucet",
|
||||
"test-browser": "budo test/browser.js:build/test-bundle.js --dir test --live --open --port 3001 --watch-glob '**/*.{html,css,js,glsl}' -- -t babelify",
|
||||
"test-browser": "npm run build-watch && budo test/browser.js:build/test-bundle.js --dir test --live --open --port 3001 --watch-glob '**/*.{html,css,js,glsl}' -- -t babelify",
|
||||
"test-electron": "browserify test/electron.js | testron | faucet",
|
||||
"profile-disc": "browserify src/bundle.js --full-paths -t babelify -t brfs-babel | discify --open",
|
||||
"start": "npm run build-watch && budo dist/bundle.js:dist/lumagl.js --live --open --port 3000 --watch-glob '**/*.{html,css,js,glsl}' -- -t brfs-babel"
|
||||
|
||||
@ -6,9 +6,10 @@ import {
|
||||
GL, Buffer, Program, draw, checkUniformValues, getUniformsTable,
|
||||
WebGLRenderingContext
|
||||
} from '../webgl';
|
||||
import Object3D from '../scenegraph/object-3d';
|
||||
import Object3D from '../deprecated/scenegraph/object-3d';
|
||||
import {log, formatValue} from '../utils';
|
||||
import Geometry from './geometry';
|
||||
import {SHADERS} from '../experimental/shaders';
|
||||
import assert from 'assert';
|
||||
|
||||
const MSG_INSTANCED_PARAM_DEPRECATED = `\
|
||||
@ -41,8 +42,9 @@ export default class Model extends Object3D {
|
||||
init({
|
||||
program,
|
||||
gl = null,
|
||||
vs = null,
|
||||
fs = null,
|
||||
vs = SHADERS.vs,
|
||||
fs = SHADERS.fs,
|
||||
defaultUniforms,
|
||||
geometry,
|
||||
material = null,
|
||||
textures,
|
||||
@ -64,6 +66,11 @@ export default class Model extends Object3D {
|
||||
// assert(program || program instanceof Program);
|
||||
assert(geometry instanceof Geometry, 'Model needs a geometry');
|
||||
|
||||
// Assign default uniforms if any of the default shaders is being used
|
||||
if (vs === SHADERS.vs || fs === SHADERS.fs && defaultUniforms === undefined) {
|
||||
defaultUniforms = SHADERS.defaultUniforms;
|
||||
}
|
||||
|
||||
// set a custom program per o3d
|
||||
this.program = program || new Program(gl, {vs, fs});
|
||||
assert(this.program instanceof Program, 'Model needs a program');
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import Object3D from './object-3d';
|
||||
import {Mat4} from '../deprecated';
|
||||
import {Mat4} from '../math';
|
||||
import assert from 'assert';
|
||||
|
||||
export default class Group extends Object3D {
|
||||
@ -1,6 +1,6 @@
|
||||
import {Vec3, Mat4} from '../deprecated';
|
||||
import {uid} from '../../utils';
|
||||
import {Vec3, Mat4} from '../math';
|
||||
import assert from 'assert';
|
||||
import {uid} from '../utils';
|
||||
|
||||
export default class Object3D {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
// TODO - this is the new picking for deck.gl
|
||||
/* eslint-disable max-statements, no-try-catch */
|
||||
/* global window */
|
||||
import {GL, glContextWithState, Framebuffer} from '../webgl';
|
||||
import {assertWebGLContext} from '../webgl/webgl-checks';
|
||||
import {GL, glContextWithState, Framebuffer} from '../../webgl';
|
||||
import {assertWebGLContext} from '../../webgl/webgl-checks';
|
||||
import Group from './group';
|
||||
import assert from 'assert';
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
// Scene Object management and rendering
|
||||
/* eslint-disable max-statements, no-try-catch */
|
||||
|
||||
import * as config from '../core/config';
|
||||
import * as config from '../../core/config';
|
||||
import {Vector3} from '../math';
|
||||
import {merge} from '../utils';
|
||||
import {merge} from '../../utils';
|
||||
import Group from './group';
|
||||
import {pickModels} from './pick';
|
||||
import assert from 'assert';
|
||||
@ -19,8 +19,6 @@ gl_FragColor = fog_filterColor(gl_FragColor);
|
||||
gl_FragColor = picking_filterColor(gl_FragColor);
|
||||
```
|
||||
|
||||
This would then depend on
|
||||
|
||||
## Uniforms
|
||||
|
||||
Modules usually have uniforms. These are automatically included in the glsl
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
/* eslint-disable camelcase */
|
||||
/* global document */
|
||||
import {Buffer, createGLContext, Program} from '../../../../webgl';
|
||||
import {assembleShaders} from '../../../shader-tools';
|
||||
import {readFileSync} from 'fs';
|
||||
@ -65,7 +64,7 @@ const TEST_CASES = {
|
||||
return {
|
||||
uniforms: {
|
||||
a: float0_vec2,
|
||||
b: float1_vec2,
|
||||
b: float1_vec2
|
||||
},
|
||||
line: `(${float0_vec2}) - (${float1_vec2})`,
|
||||
result: float_ref
|
||||
@ -210,7 +209,7 @@ function initializeGL(canvas) {
|
||||
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
||||
|
||||
if (!gl.getExtension('OES_texture_float')) {
|
||||
console.error('no floating point texture support!');
|
||||
// console.error('no floating point texture support!');
|
||||
throw new Error('no floating point texture support!');
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ const TEST_CASES = {
|
||||
return {
|
||||
uniforms: {
|
||||
a: float0_vec2,
|
||||
b: float1_vec2,
|
||||
b: float1_vec2
|
||||
},
|
||||
line: `(${float0_vec2}) - (${float1_vec2})`,
|
||||
result: float_ref
|
||||
@ -207,7 +207,7 @@ function initializeGL(canvas) {
|
||||
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
||||
|
||||
if (!gl.getExtension('OES_texture_float')) {
|
||||
console.error('no floating point texture support!');
|
||||
// console.error('no floating point texture support!');
|
||||
throw new Error('no floating point texture support!');
|
||||
}
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
import './fp64/test';
|
||||
// import './fp64/test';
|
||||
|
||||
@ -75,8 +75,9 @@ function assembleShader(gl, {
|
||||
assert(shaderModule, 'shader module is not defined');
|
||||
}
|
||||
const moduleSource = shaderModule[type];
|
||||
assembledSource += `
|
||||
assembledSource += `\
|
||||
// BEGIN SHADER MODULE ${moduleName}
|
||||
#define MODULE_${moduleName.toUpperCase()}
|
||||
${moduleSource}
|
||||
// END SHADER MODULE ${moduleName}`;
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ export function registerShaderModules(shaderModuleList) {
|
||||
export function getShaderModule(moduleName) {
|
||||
const shaderModule = shaderModules[moduleName];
|
||||
if (!shaderModule) {
|
||||
console.log(`${moduleName} not in registered modules:`, shaderModules);
|
||||
// console.log(`${moduleName} not in registered modules:`, shaderModules);
|
||||
assert(false, `Unknown shader module ${moduleName}`);
|
||||
}
|
||||
return shaderModule;
|
||||
|
||||
@ -4,40 +4,25 @@
|
||||
precision highp float;
|
||||
#endif
|
||||
|
||||
// texture configs
|
||||
uniform bool hasTexture1;
|
||||
uniform sampler2D sampler1;
|
||||
uniform bool hasTextureCube1;
|
||||
uniform samplerCube samplerCube1;
|
||||
|
||||
// picking configs
|
||||
uniform bool enablePicking;
|
||||
uniform bool hasPickingColors;
|
||||
uniform vec3 pickColor;
|
||||
|
||||
|
||||
// varyings
|
||||
varying vec4 vColor;
|
||||
varying vec4 vPickingColor;
|
||||
varying vec2 vTexCoord;
|
||||
varying vec3 lightWeighting;
|
||||
varying vec3 vReflection;
|
||||
varying vec4 vNormal;
|
||||
|
||||
vec4 main(){
|
||||
// set color from texture
|
||||
if (!hasTexture1) {
|
||||
gl_FragColor = vColor;
|
||||
} else {
|
||||
gl_FragColor = vec4(texture2D(sampler1, vec2(vTexCoord.s, vTexCoord.t));
|
||||
}
|
||||
gl_FragColor = vec4(1., 0., 0., 1.);
|
||||
|
||||
#ifdef MODULE_MATERIAL
|
||||
gl_FragColor = material_filterColor(gl_FragColor);
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_LIGHTING
|
||||
gl_FragColor = lighting_filterColor(gl_FragColor);
|
||||
#endif
|
||||
|
||||
// handle fog
|
||||
if (hasFog) {
|
||||
gl_FragColor = fog_filterColor(gl_FragColor);
|
||||
}
|
||||
#ifdef MODULE_FOG
|
||||
gl_FragColor = fog_filterColor(gl_FragColor);
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_PICKING
|
||||
gl_FragColor = picking_getColor(gl_FragColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -4,15 +4,25 @@
|
||||
attribute vec3 positions;
|
||||
attribute vec3 normals;
|
||||
attribute vec4 colors;
|
||||
attribute vec4 pickingColors;
|
||||
attribute vec2 texCoords;
|
||||
attribute vec4 pickingColors;
|
||||
|
||||
void main(void) {
|
||||
|
||||
#ifdef MODULE_MATERIAL
|
||||
material_setDiffuseColor(colors);
|
||||
material_setDiffuseTextureCoordinates(texCoords);
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_LIGHTING
|
||||
lighting_setPositionAndNormal(positions, normals);
|
||||
lighting_apply_light(positions);
|
||||
lighting_apply_reflection(positions);
|
||||
#endif
|
||||
|
||||
vTexCoord = texCoords;
|
||||
#ifdef MODULE_PICKING
|
||||
picking_setPickingColor(pickingColors);
|
||||
#endif
|
||||
|
||||
gl_Position = projectionMatrix * worldMatrix * vec4(positions, 1.0);
|
||||
}
|
||||
|
||||
15
src/index.js
15
src/index.js
@ -1,12 +1,10 @@
|
||||
// Export core modules for luma.gl
|
||||
export * from './webgl';
|
||||
export * from './math';
|
||||
export * from './scenegraph';
|
||||
export * from './webgl';
|
||||
export * from './core';
|
||||
|
||||
import * as webgl from './webgl';
|
||||
import * as math from './math';
|
||||
import * as scenegraph from './scenegraph';
|
||||
import * as webgl from './webgl';
|
||||
import * as core from './core';
|
||||
|
||||
// Export support modules for luma.gl
|
||||
@ -20,6 +18,8 @@ import * as io from './io';
|
||||
import * as experimental from './experimental';
|
||||
|
||||
// TODO - deprecated
|
||||
export * from './deprecated/scenegraph';
|
||||
import * as scenegraph from './deprecated/scenegraph';
|
||||
import {default as Shaders} from './deprecated/shaderlib';
|
||||
import {default as Fx} from './addons/fx';
|
||||
import * as deprecated from './deprecated';
|
||||
@ -31,17 +31,18 @@ export * from './deprecated';
|
||||
import luma from './globals';
|
||||
|
||||
Object.assign(luma,
|
||||
webgl,
|
||||
math,
|
||||
scenegraph,
|
||||
geometry,
|
||||
|
||||
webgl,
|
||||
core,
|
||||
|
||||
geometry,
|
||||
io,
|
||||
|
||||
experimental,
|
||||
|
||||
// Deprecated
|
||||
scenegraph,
|
||||
deprecated,
|
||||
Shaders,
|
||||
{Fx}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import '../../../src/headless';
|
||||
import {loadImage} from '../../../src/io';
|
||||
import '../../../headless';
|
||||
import {loadImage} from '../../../dist/io';
|
||||
import test from '../../setup';
|
||||
|
||||
/* eslint-disable quotes */
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
// Higher level abstractions can be built on these classes
|
||||
export * from './webgl';
|
||||
|
||||
// WebGL context functions and helpers
|
||||
export * from './context';
|
||||
export {isWebGLContext, isWebGL2Context} from './webgl-checks';
|
||||
|
||||
// WebGL1 objects
|
||||
export {default as Buffer} from './buffer';
|
||||
export {default as Shader, VertexShader, FragmentShader} from './shader';
|
||||
@ -21,7 +25,6 @@ export {VertexAttributes};
|
||||
export {default as TimerQuery} from './timer-query';
|
||||
|
||||
// Functions
|
||||
export * from './context';
|
||||
export * from './draw';
|
||||
export * from './uniforms';
|
||||
|
||||
|
||||
@ -5,7 +5,6 @@ import Buffer from './buffer';
|
||||
import Texture from './texture';
|
||||
import {parseUniformName, getUniformSetter} from './uniforms';
|
||||
import {VertexShader, FragmentShader} from './shader';
|
||||
import {SHADERS} from '../experimental';
|
||||
import {log, uid} from '../utils';
|
||||
import assert from 'assert';
|
||||
|
||||
@ -41,20 +40,13 @@ export default class Program {
|
||||
/* eslint-disable max-statements */
|
||||
constructor(gl, {
|
||||
id,
|
||||
vs = SHADERS.vs,
|
||||
fs = SHADERS.fs,
|
||||
vs,
|
||||
fs,
|
||||
defaultUniforms,
|
||||
handle
|
||||
} = {}) {
|
||||
assertWebGLContext(gl);
|
||||
|
||||
// Assign default uniforms if any of the default shaders is being used
|
||||
if (vs === SHADERS.vs || fs === SHADERS.fs &&
|
||||
defaultUniforms === undefined
|
||||
) {
|
||||
defaultUniforms = SHADERS.defaultUniforms;
|
||||
}
|
||||
|
||||
// Create shaders if needed
|
||||
this.vs = typeof vs === 'string' ? new VertexShader(gl, vs) : vs;
|
||||
this.fs = typeof vs === 'string' ? new FragmentShader(gl, fs) : fs;
|
||||
|
||||
@ -1,13 +1,5 @@
|
||||
require('babel-polyfill');
|
||||
require('tap-browser-color')();
|
||||
|
||||
require('./webgl-independent');
|
||||
require('./webgl');
|
||||
|
||||
require('./core');
|
||||
|
||||
// deprecated
|
||||
require('../src/deprecated/test');
|
||||
|
||||
// experimental
|
||||
require('../src/experimental/test');
|
||||
require('./index-webgl-independent-tests');
|
||||
require('./index-webgl-dependent-tests');
|
||||
|
||||
@ -1,10 +1,3 @@
|
||||
require('babel-polyfill');
|
||||
|
||||
require('./webgl-independent');
|
||||
require('./webgl');
|
||||
|
||||
// experimental
|
||||
require('../src/experimental/test');
|
||||
|
||||
// deprecated
|
||||
require('../src/deprecated/test');
|
||||
require('./index-webgl-dependent-tests');
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import {
|
||||
ConeGeometry, CubeGeometry, CylinderGeometry, IcoSphereGeometry,
|
||||
PlaneGeometry, SphereGeometry
|
||||
} from '../../src/headless';
|
||||
} from '../../headless';
|
||||
import test from 'tape-catch';
|
||||
|
||||
const GEOMETRY_TESTS = [
|
||||
1
test/geometry/index.js
Normal file
1
test/geometry/index.js
Normal file
@ -0,0 +1 @@
|
||||
import './geometry-spec.js';
|
||||
@ -6,4 +6,4 @@ require('babel-polyfill');
|
||||
|
||||
// Quick test that webgl independent code works
|
||||
require('./webgl/context-no-headless.spec');
|
||||
require('./webgl-independent');
|
||||
require('./index-webgl-independent-tests');
|
||||
|
||||
@ -2,14 +2,4 @@ require('source-map-support').install();
|
||||
require('babel-core/register');
|
||||
require('babel-polyfill');
|
||||
|
||||
// require('./webgl-independent');
|
||||
require('./webgl');
|
||||
// require('./node-dependent');
|
||||
|
||||
require('./core');
|
||||
|
||||
// experimental
|
||||
require('../src/experimental/test');
|
||||
|
||||
// deprecated
|
||||
require('../src/deprecated/test');
|
||||
require('./index-webgl-dependent-tests');
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
import {
|
||||
createGLContext, Program,
|
||||
loadFiles, loadTextures
|
||||
} from '../../';
|
||||
import {createGLContext, Program, loadFiles, loadTextures} from '../index';
|
||||
import test from 'tape-catch';
|
||||
|
||||
test('LumaGL#imports are defined', t => {
|
||||
5
test/index-webgl-dependent-tests.js
Normal file
5
test/index-webgl-dependent-tests.js
Normal file
@ -0,0 +1,5 @@
|
||||
// Imports tests for all modules that depend on webgl
|
||||
import './webgl';
|
||||
import '../dist/io/test';
|
||||
import '../dist/deprecated/test';
|
||||
import '../dist/experimental/test';
|
||||
5
test/index-webgl-independent-tests.js
Normal file
5
test/index-webgl-independent-tests.js
Normal file
@ -0,0 +1,5 @@
|
||||
// Imports tests for all modules that do not depend on WebGL
|
||||
import './imports.spec';
|
||||
import './utils';
|
||||
import './geometry';
|
||||
import '../dist/math/test';
|
||||
@ -1,7 +1,6 @@
|
||||
import test from 'blue-tape';
|
||||
import {createGLContext, Program, Texture2D, Buffer}
|
||||
from '../../../src/headless';
|
||||
import {loadImage} from '../../../src/io';
|
||||
import {createGLContext, Program, Texture2D, Buffer} from '../../../headless';
|
||||
import {loadImage} from '../../../io';
|
||||
|
||||
const DATA_URL = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAA
|
||||
Bytg0kAAAAFElEQVQIW2P8z/D/PwMDAwMjjAEAQOwF/W1Dp54AAAAASUVORK5CYII=`;
|
||||
1
test/utils/index.js
Normal file
1
test/utils/index.js
Normal file
@ -0,0 +1 @@
|
||||
import './utils.spec';
|
||||
@ -1,4 +1,4 @@
|
||||
import {merge, splat, noop, uid} from '../../src/utils';
|
||||
import {merge, splat, noop, uid} from '../../dist/utils';
|
||||
import test from 'tape-catch';
|
||||
|
||||
test('Utils#merge', t => {
|
||||
@ -1,8 +0,0 @@
|
||||
import './import-spec.js';
|
||||
|
||||
import '../../src/math/test';
|
||||
|
||||
import './utils-spec.js';
|
||||
import './geometry-spec.js';
|
||||
|
||||
import '../../src/io/test';
|
||||
@ -1,5 +1,4 @@
|
||||
import {createGLContext, Buffer} from '../../src/headless';
|
||||
import {isWebGLContext} from '../../src/webgl/webgl-checks';
|
||||
import {createGLContext, Buffer, isWebGLContext} from '../../headless';
|
||||
import test from 'tape-catch';
|
||||
|
||||
const fixture = {
|
||||
@ -30,9 +29,7 @@ test('WebGL#Buffer constructor/delete', t => {
|
||||
test('WebGL#Buffer bind/unbind', t => {
|
||||
const {gl} = fixture;
|
||||
|
||||
let buffer;
|
||||
|
||||
buffer = new Buffer(gl)
|
||||
const buffer = new Buffer(gl)
|
||||
.bind()
|
||||
.unbind()
|
||||
.delete();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// NOTE: Headless must not be included in this file
|
||||
import {createGLContext, Program, webGLTypesAvailable} from '../../src';
|
||||
import test from 'tape-catch';
|
||||
// NOTE: `headless.js` must not be included in this file
|
||||
import {createGLContext, Program, webGLTypesAvailable} from '../../index';
|
||||
|
||||
test('LumaGL#imports are defined', t => {
|
||||
t.ok(typeof Program === 'function', 'Program is defined');
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
const {createGLContext, glGetDebugInfo} = require('../../src/headless');
|
||||
const {isWebGLContext} = require('../../src/webgl/webgl-checks');
|
||||
|
||||
const test = require('tape-catch');
|
||||
const {createGLContext, glGetDebugInfo, isWebGLContext} = require('../../headless');
|
||||
|
||||
test('WebGL#headless context creation', t => {
|
||||
const gl = createGLContext();
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import {createGLContext, Program} from '../../src/headless';
|
||||
import {isWebGLContext} from '../../src/webgl/webgl-checks';
|
||||
import test from 'tape-catch';
|
||||
import {createGLContext, Program, isWebGLContext} from '../../headless';
|
||||
import {SHADERS} from '../../experimental';
|
||||
|
||||
test('WebGL#draw', t => {
|
||||
const gl = createGLContext();
|
||||
t.ok(isWebGLContext(gl), 'Created gl context');
|
||||
|
||||
const program = new Program(gl);
|
||||
const program = new Program(gl, SHADERS);
|
||||
t.ok(program instanceof Program, 'Program construction successful');
|
||||
t.end();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {createGLContext, Framebuffer} from '../../src/headless';
|
||||
import test from 'tape-catch';
|
||||
import {createGLContext, Framebuffer} from '../../headless';
|
||||
|
||||
const fixture = {
|
||||
gl: createGLContext()
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import test from 'tape-catch';
|
||||
import queryManager
|
||||
from '../../../src/webgl/helpers/query-manager';
|
||||
import queryManager from '../../../src/webgl/helpers/query-manager';
|
||||
|
||||
test('WebGL helpers#queryManager', t => {
|
||||
t.ok(queryManager, 'Imported correctly');
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {createGLContext, Program, Buffer} from '../../src/headless';
|
||||
import {SHADERS} from '../../src/experimental';
|
||||
import test from 'tape-catch';
|
||||
import {createGLContext, Program, Buffer} from '../../headless';
|
||||
import {SHADERS} from '../../experimental';
|
||||
|
||||
const fixture = {
|
||||
gl: createGLContext()
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {createGLContext, Renderbuffer} from '../../src/headless';
|
||||
import test from 'tape-catch';
|
||||
import {createGLContext, Renderbuffer} from '../../headless';
|
||||
|
||||
const fixture = {
|
||||
gl: createGLContext()
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
import test from 'tape-catch';
|
||||
import {createGLContext, Texture2D, Buffer} from '../../src/headless';
|
||||
import {createGLContext, Texture2D} from '../../dist/headless';
|
||||
|
||||
const fixture = {
|
||||
gl: createGLContext()
|
||||
};
|
||||
|
||||
const BUFFER_DATA = new Float32Array([0, 1, 0, -1, -1, 0, 1, -1, 0]);
|
||||
|
||||
test('WebGL#Texture2D construct/delete', t => {
|
||||
const {gl} = fixture;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable max-len, max-statements */
|
||||
import test from 'tape-catch';
|
||||
import {createGLContext, poll, TimerQuery} from '../../src/headless';
|
||||
import {createGLContext, poll, TimerQuery} from '../../dist/headless';
|
||||
|
||||
const fixture = {
|
||||
gl: createGLContext()
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
/* eslint-disable no-inline-comments */
|
||||
import test from 'tape-catch';
|
||||
import {
|
||||
createGLContext, Program, Buffer, Texture, Texture2D, TextureCube,
|
||||
checkUniformValues
|
||||
} from '../../src/headless';
|
||||
|
||||
import test from 'tape-catch';
|
||||
} from '../../headless';
|
||||
|
||||
const gl = createGLContext();
|
||||
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
/* eslint-disable max-len */
|
||||
import {createGLContext} from '../../src/headless';
|
||||
import {VertexArrayObject} from '../../src/webgl';
|
||||
|
||||
import test from 'tape-catch';
|
||||
import {createGLContext} from '../../headless';
|
||||
import {VertexArrayObject} from '../../dist/webgl';
|
||||
|
||||
|
||||
const fixture = {
|
||||
gl: createGLContext()
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
/* eslint-disable max-len */
|
||||
import {createGLContext, VertexAttributes} from '../../src/headless';
|
||||
import {WebGL2RenderingContext} from '../../src/webgl/webgl-types';
|
||||
|
||||
import test from 'tape-catch';
|
||||
import {createGLContext, VertexAttributes, isWebGL2Context} from '../../headless';
|
||||
|
||||
test('WebGL#VertexAttributes#enable', t => {
|
||||
const gl = createGLContext();
|
||||
@ -37,7 +35,7 @@ test('WebGL#VertexAttributes#enable', t => {
|
||||
test('WebGL#VertexAttributes#WebGL2 support', t => {
|
||||
const gl = createGLContext({webgl2: true});
|
||||
|
||||
if (!(gl instanceof WebGL2RenderingContext)) {
|
||||
if (!isWebGL2Context(gl)) {
|
||||
t.comment('- WebGL2 NOT ENABLED: skipping tests');
|
||||
t.end();
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user