Skip to content

Commit

Permalink
Merge 1b8f27d into 7e3c3d5
Browse files Browse the repository at this point in the history
  • Loading branch information
tsherif committed Nov 11, 2019
2 parents 7e3c3d5 + 1b8f27d commit 2621af0
Show file tree
Hide file tree
Showing 35 changed files with 7,590 additions and 119 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
"semi-spacing": "error",
"semi-style": "error",
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"spaced-comment": ["error", "always", {
"exceptions": ["/"]
}],
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules
package-lock.json
npm-debug.log
build/*.map
.nyc_output/
coverage/
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ sudo: false
language: node_js
node_js:
- "10"
script:
- npm run coverage
after_success:
- cat coverage/lcov.info | coveralls
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PicoGL.js
=========

[![Build Status](https://travis-ci.org/tsherif/picogl.js.svg?branch=master)](https://travis-ci.org/tsherif/picogl.js) [![GZIP size](https://badge-size.herokuapp.com/tsherif/picogl.js/master/build/picogl.min.js.svg?compression=gzip)](https://github.com/tsherif/picogl.js/blob/master/build/picogl.min.js) [![Gitter](https://img.shields.io/gitter/room/picogl.js/general.svg)](https://gitter.im/picogl-js/general) [![License](https://img.shields.io/github/license/tsherif/picogl.js.svg)](https://github.com/tsherif/picogl.js/blob/master/LICENSE) [![NPM](https://img.shields.io/npm/v/picogl.svg)](https://www.npmjs.com/package/picogl)
[![Build Status](https://travis-ci.org/tsherif/picogl.js.svg?branch=master)](https://travis-ci.org/tsherif/picogl.js) [![Coverage Status](https://coveralls.io/repos/github/tsherif/picogl.js/badge.svg?branch=master)](https://coveralls.io/github/tsherif/picogl.js?branch=master) [![GZIP size](https://badge-size.herokuapp.com/tsherif/picogl.js/master/build/picogl.min.js.svg?compression=gzip)](https://github.com/tsherif/picogl.js/blob/master/build/picogl.min.js) [![Gitter](https://img.shields.io/gitter/room/picogl.js/general.svg)](https://gitter.im/picogl-js/general) [![License](https://img.shields.io/github/license/tsherif/picogl.js.svg)](https://github.com/tsherif/picogl.js/blob/master/LICENSE) [![NPM](https://img.shields.io/npm/v/picogl.svg)](https://www.npmjs.com/package/picogl)

**[API Docs](https://tsherif.github.io/picogl.js/docs/)** | **[Tutorial](https://tsherif.wordpress.com/2017/07/26/webgl-2-development-with-picogl-js/)** | **[Chat](https://gitter.im/picogl-js/general)**

Expand Down
74 changes: 37 additions & 37 deletions build/module/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,43 +459,6 @@ export class App {
return this;
}


/**
Enable scissor testing.
@method
@return {App} The App object.
*/
scissorTest() {
this.gl.enable(this.gl.SCISSOR_TEST);

return this;
}

/**
Disable scissor testing.
@method
@return {App} The App object.
*/
noScissorTest() {
this.gl.disable(this.gl.SCISSOR_TEST);

return this;
}

/**
Define the scissor box.
@method
@return {App} The App object.
*/
scissor(x, y, width, height) {
this.gl.scissor(x, y, width, height);

return this;
}

/**
Set the bitmask to use for tested stencil values.
E.g. app.stencilMask(0xFF).
Expand Down Expand Up @@ -606,6 +569,43 @@ export class App {
return this;
}


/**
Enable scissor testing.
@method
@return {App} The App object.
*/
scissorTest() {
this.gl.enable(this.gl.SCISSOR_TEST);

return this;
}

/**
Disable scissor testing.
@method
@return {App} The App object.
*/
noScissorTest() {
this.gl.disable(this.gl.SCISSOR_TEST);

return this;
}

/**
Define the scissor box.
@method
@return {App} The App object.
*/
scissor(x, y, width, height) {
this.gl.scissor(x, y, width, height);

return this;
}

/**
Enable rasterization step.
Expand Down
2 changes: 1 addition & 1 deletion build/module/picogl.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let webglInfoInitialized = false;
@namespace PicoGL
*/
export const PicoGL = Object.assign({
version: "0.15.0",
version: "0.15.1",

WEBGL_INFO,

Expand Down
2 changes: 1 addition & 1 deletion build/module/shader.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Shader {
this.appState = appState;
this.shader = null;
this.type = type;
this.source = source;
this.source = source.trim();

this.restore();
}
Expand Down
2 changes: 1 addition & 1 deletion build/picogl.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ <h1>PicoGL.js</h1>
<a class="badge-link" href="https://travis-ci.org/tsherif/picogl.js">
<img src="https://travis-ci.org/tsherif/picogl.js.svg?branch=master">
</a>
<a href='https://coveralls.io/github/tsherif/picogl.js?branch=master'>
<img src='https://coveralls.io/repos/github/tsherif/picogl.js/badge.svg?branch=master' alt='Coverage Status' />
</a>
<a class="badge-link" href="https://github.com/tsherif/picogl.js/blob/master/build/picogl.min.js">
<img src="https://badge-size.herokuapp.com/tsherif/picogl.js/master/build/picogl.min.js.svg?compression=gzip">
</a>
Expand Down
27 changes: 9 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "picogl",
"version": "0.15.0",
"version": "0.15.1",
"description": "A minimal WebGL 2 rendering library",
"main": "build/picogl.min.js",
"repository": {
Expand All @@ -13,13 +13,15 @@
"url": "http://tareksherif.net/"
},
"scripts": {
"lint": "eslint src/*.js",
"lint": "eslint src/*.js test/*.js test/tests/*.js",
"compile-module": "rimraf build/module && cpy src build/module && replace %%VERSION%% $npm_package_version build/module/picogl.js",
"compile-bundle": "webpack",
"compile": "npm run compile-module && npm run compile-bundle",
"build": "npm run lint && npm run compile",
"docs": "jsdoc -d docs src/*.js",
"test": "npm run lint"
"test-unit": "rimraf .nyc_output/ && node test/puppeteer.js",
"coverage": "npm test && nyc report --reporter=lcov",
"test": "npm run lint && npm run test-unit"
},
"keywords": [
"webgl",
Expand All @@ -33,26 +35,15 @@
"bugs": {
"url": "https://github.com/tsherif/picogl.js/issues"
},
"jshintConfig": {
"eqeqeq": true,
"undef": true,
"unused": true,
"strict": true,
"latedef": "nofunc",
"nonew": true,
"trailing": true,
"browser": true,
"devel": true,
"browserify": true,
"globals": {
"PicoGL": true
}
},
"devDependencies": {
"babel-minify-webpack-plugin": "^0.3.1",
"coveralls": "^3.0.7",
"cpy-cli": "^2.0.0",
"eslint": "^6.3.0",
"jsdoc": "^3.6.3",
"nyc": "^14.1.1",
"puppeteer": "^2.0.0",
"puppeteer-to-istanbul": "^1.2.2",
"replace": "^1.1.1",
"rimraf": "^3.0.0",
"webpack": "^4.39.3",
Expand Down
3 changes: 2 additions & 1 deletion src/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"parserOptions": {
"sourceType": "module"
"sourceType": "module",
"ecmaVersion": 6
},
"env": {
"browser": true,
Expand Down
74 changes: 37 additions & 37 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,43 +459,6 @@ export class App {
return this;
}


/**
Enable scissor testing.
@method
@return {App} The App object.
*/
scissorTest() {
this.gl.enable(this.gl.SCISSOR_TEST);

return this;
}

/**
Disable scissor testing.
@method
@return {App} The App object.
*/
noScissorTest() {
this.gl.disable(this.gl.SCISSOR_TEST);

return this;
}

/**
Define the scissor box.
@method
@return {App} The App object.
*/
scissor(x, y, width, height) {
this.gl.scissor(x, y, width, height);

return this;
}

/**
Set the bitmask to use for tested stencil values.
E.g. app.stencilMask(0xFF).
Expand Down Expand Up @@ -606,6 +569,43 @@ export class App {
return this;
}


/**
Enable scissor testing.
@method
@return {App} The App object.
*/
scissorTest() {
this.gl.enable(this.gl.SCISSOR_TEST);

return this;
}

/**
Disable scissor testing.
@method
@return {App} The App object.
*/
noScissorTest() {
this.gl.disable(this.gl.SCISSOR_TEST);

return this;
}

/**
Define the scissor box.
@method
@return {App} The App object.
*/
scissor(x, y, width, height) {
this.gl.scissor(x, y, width, height);

return this;
}

/**
Enable rasterization step.
Expand Down
2 changes: 1 addition & 1 deletion src/shader.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Shader {
this.appState = appState;
this.shader = null;
this.type = type;
this.source = source;
this.source = source.trim();

this.restore();
}
Expand Down
9 changes: 9 additions & 0 deletions test/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"parserOptions": {
"ecmaVersion": 8
},
"env": {
"node": true,
"es6": true
}
}

0 comments on commit 2621af0

Please sign in to comment.