Giter Club home page Giter Club logo

headless-gl's Introduction

gl

ci js-standard-style

gl lets you create a WebGL context in Node.js without making a window or loading a full browser environment.

It aspires to fully conform to the WebGL 1.0.3 specification.

Example

// Create context
var width   = 64
var height  = 64
var gl = require('gl')(width, height, { preserveDrawingBuffer: true })

//Clear screen to red
gl.clearColor(1, 0, 0, 1)
gl.clear(gl.COLOR_BUFFER_BIT)

//Write output as a PPM formatted image
var pixels = new Uint8Array(width * height * 4)
gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels)
process.stdout.write(['P3\n# gl.ppm\n', width, " ", height, '\n255\n'].join(''))

for(var i = 0; i < pixels.length; i += 4) {
  for(var j = 0; j < 3; ++j) {
    process.stdout.write(pixels[i + j] + ' ')
  }
}

Install

Installing headless-gl on a supported platform is a snap using one of the prebuilt binaries. Using npm run the command,

npm install gl

And you are good to go!

Prebuilt binaries are generally available for LTS node versions (e.g. 18, 20). If your system is not supported, then please see the development section on how to configure your build environment. Patches to improve support are always welcome!

Supported platforms and Node.js versions

gl runs on Linux, macOS, and Windows.

Node.js versions 16 and up are supported.

API

headless-gl exports exactly one function which you can use to create a WebGL context,

var gl = require('gl')(width, height[, contextAttributes])

Creates a new WebGLRenderingContext with the given context attributes.

Returns A new WebGLRenderingContext object

Extensions

In addition to all the usual WebGL methods, headless-gl exposes some custom extensions to make it easier to manage WebGL context resources in a server side environment:

STACKGL_resize_drawingbuffer

This extension provides a mechanism to resize the drawing buffer of a WebGL context once it is created.

In a pure DOM implementation, this method would implemented by resizing the WebGLContext's canvas element by modifying its width/height properties. This canvas manipulation is not possible in headless-gl, since a headless context doesn't have a DOM or a canvas element associated to it.

Example

var assert = require('assert')
var gl = require('gl')(10, 10)
assert(gl.drawingBufferHeight === 10 && gl.drawingBufferWidth === 10)

var ext = gl.getExtension('STACKGL_resize_drawingbuffer')
ext.resize(20, 5)
assert(gl.drawingBufferHeight === 20 && gl.drawingBufferWidth === 5)

IDL

[NoInterfaceObject]
interface STACKGL_resize_drawingbuffer {
    void resize(GLint width, GLint height);
};

ext.resize(width, height)

Resizes the drawing buffer of a WebGL rendering context

  • width is the new width of the drawing buffer for the context
  • height is the new height of the drawing buffer for the context

STACKGL_destroy_context

Destroys the WebGL context immediately, reclaiming all resources associated with it.

For long running jobs, garbage collection of contexts is often not fast enough. To prevent the system from becoming overloaded with unused contexts, you can force the system to reclaim a WebGL context immediately by calling .destroy().

Example

var gl = require('gl')(10, 10)

var ext = gl.getExtension('STACKGL_destroy_context')
ext.destroy()

IDL

[NoInterfaceObject]
interface STACKGL_destroy_context {
    void destroy();
};

gl.getExtension('STACKGL_destroy_context').destroy()

Immediately destroys the context and all associated resources.

System dependencies

In most cases installing headless-gl from npm should just work. However, if you run into problems you might need to adjust your system configuration and make sure all your dependencies are up to date. For general information on building native modules, see the node-gyp documentation.

Mac OS X

Ubuntu/Debian

$ sudo apt-get install -y build-essential libxi-dev libglu1-mesa-dev libglew-dev pkg-config

Windows

FAQ

How can I use headless-gl with a continuous integration service?

headless-gl should work out of the box on most CI systems. Some notes on specific CI systems:

  • CircleCI: headless-gl should just work in the default node environment.
  • AppVeyor: Again it should just work
  • TravisCI: Works out of the box on the OS X image. For Linux VMs, you need to install mesa and xvfb. To do this, create a file in the root of your repo called .travis.yml and paste the following into it:
language: node_js
os: linux
sudo: required
dist: trusty
addons:
  apt:
    packages:
    - mesa-utils
    - xvfb
    - libgl1-mesa-dri
    - libglapi-mesa
    - libosmesa6
node_js:
  - '20'
before_script:
  - export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start

If you know of a service not listed here, open an issue I'll add it to the list.

How can headless-gl be used on a headless Linux machine?

If you are running your own minimal Linux server, such as the one one would want to use on Amazon AWS or equivalent, it will likely not provide an X11 nor an OpenGL environment. To setup such an environment you can use those two packages:

  1. Xvfb is a lightweight X11 server which provides a back buffer for displaying X11 application offscreen and reading back the pixels which were drawn offscreen. It is typically used in Continuous Integration systems. It can be installed on CentOS with yum install -y Xvfb, and comes preinstalled on Ubuntu.
  2. Mesa is the reference open source software implementation of OpenGL. It can be installed on CentOS with yum install -y mesa-dri-drivers, or apt-get install libgl1-mesa-dev. Since a cloud Linux instance will typically run on a machine that does not have a GPU, a software implementation of OpenGL will be required.

Interacting with Xvfb requires you to start it on the background and to execute your node program with the DISPLAY environment variable set to whatever was configured when running Xvfb (the default being :99). If you want to do that reliably you'll have to start Xvfb from an init.d script at boot time, which is extra configuration burden. Fortunately there is a wrapper script shipped with Xvfb known as xvfb-run which can start Xvfb on the fly, execute your Node.js program and finally shut Xvfb down. Here's how to run it:

xvfb-run -s "-ac -screen 0 1280x1024x24" <node program>

Does headless-gl work in a browser?

Yes, with browserify. The STACKGL_destroy_context and STACKGL_resize_drawingbuffer extensions are emulated as well.

How are <image> and <video> elements implemented?

They aren't for now. If you want to upload data to a texture, you will need to unpack the pixels into a Uint8Array and feed it into texImage2D. To help reading and saving images, you should check out the following modules:

What extensions are supported?

Only the following for now:

How can I keep up to date with what has changed in headless-gl?

There is a change log.

Why use this thing instead of node-webgl?

Despite the name node-webgl doesn't actually implement WebGL - rather it gives you "WebGL"-flavored bindings to whatever OpenGL driver is configured on your system. If you are starting from an existing WebGL application or library, this means you'll have to do a bunch of work rewriting your WebGL code and shaders to deal with all the idiosyncrasies and bugs present on whatever platforms you try to run on. The upside though is that node-webgl exposes a lot of non-WebGL stuff that might be useful for games like window creation, mouse and keyboard input, requestAnimationFrame emulation, and some native OpenGL features.

headless-gl on the other hand just implements WebGL. It is built on top of ANGLE and passes the full Khronos ARB conformance suite, which means it works exactly the same on all supported systems. This makes it a great choice for running on a server or in a command line tool. You can use it to run tests, generate images or perform GPGPU computations using shaders.

Why use this thing instead of electron?

Electron is fantastic if you are writing a desktop application or if you need a full DOM implementation. On the other hand, because it is a larger dependency electron is more difficult to set up and configure in a server-side/CI environment. headless-gl is more modular in the sense that it just implements WebGL and nothing else. As a result creating a headless-gl context takes just a few milliseconds on most systems, while spawning a full electron instance can take upwards of 15-30 seconds. If you are using WebGL in a command line interface or need to execute WebGL in a service, headless-gl might be a more efficient and simpler choice.

How should I set up a development environment for headless-gl?

After you have your system dependencies installed, do the following:

  1. Clone this repo: git clone [email protected]:stackgl/headless-gl.git
  2. Switch to the headless gl directory: cd headless-gl
  3. Initialize the angle submodule: git submodule init
  4. Update the angle submodule: git submodule update
  5. Install npm dependencies: npm install
  6. Run node-gyp to generate build scripts: npm run rebuild

Once this is done, you should be good to go! A few more things

  • To run the test cases, use the command npm test, or execute specific tests by just running them using node.
  • On a Unix-like platform, you can do incremental rebuilds by going into the build/ directory and running make. This is way faster running npm build each time you make a change.

License

See LICENSES

headless-gl's People

Contributors

agamnentzar avatar begmec avatar bhouston avatar brupelo avatar cclauss avatar creationix avatar dhritzkiv avatar dphil avatar dy avatar erikmchut avatar erkaman avatar ivansanchez avatar lmeyerov avatar m2wasabi avatar michaeljherrmann avatar mikemorris avatar mikeseven avatar mikolalysenko avatar mourner avatar nicholasbishop avatar nikhilso avatar ralphtheninja avatar robertleeplummerjr avatar stepancar avatar stepankuzmin avatar stevesan avatar timknip2 avatar tmcw avatar tmpvar avatar xoryouyou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

headless-gl's Issues

BadValue X error (in X_CreatePixmap) on CentOS 7.1 using Xvfb

As root:
Xvfb :99 -ac -screen 0 1280x1024x24 &

As a normal user
xvfb-run

Then this error:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  53 (X_CreatePixmap)
  Value in failed request:  0x0
  Serial number of failed request:  20
  Current serial number in output stream:  23
/usr/bin/xvfb-run: line 171: kill: (5496) - No such process

Xvfb seems like a standard for running headless X apps on servers, maybe there are other options but I'm not aware of them. Since it's a standard thing it would be ideal for headless-gl to support it.

My environment: I'm running CentOS in virtualbox on a mac. My app works beautifully on OSX. I suspect that the default headless-gl prog will fail but I'll double check to see if the problem is in my app or not.

I'd like to help troubleshoot further, I can put a breakpoint in XCreatePixmap, or I could build my own libANGLE but I don't know what "init the git angle submodule" means in the README.md instructions.

Cannot git init the angle submodule

I'm a complete noob with submodules, I just tried those instructions (https://git-scm.com/book/en/v2/Git-Tools-Submodules). I wonder if setting the repo to use the https protocol instead of the git protocol would help.

unknown0800276F74F3 headless-gl$ git submodule init
Submodule 'angle' ([email protected]:mikolalysenko/angle.git) registered for path 'angle'
unknown0800276F74F3 headless-gl$ git submodule update
Cloning into 'angle'...
The authenticity of host 'github.com (192.30.252.131)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.131' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of '[email protected]:mikolalysenko/angle.git' into submodule path 'angle' failed

Changing it to https did work

$ git submodule deinit .
Submodule 'angle' ([email protected]:mikolalysenko/angle.git) unregistered for path 'angle'
$ git submodule init
Submodule 'angle' (https://github.com/mikolalysenko/angle.git) registered for path 'angle'
$ git submodule update
...

NPM Compile issue - Ubuntu 12.04, node.js v0.10 and v0.11

Hi,
Compiling in both latest git pre-release v0.11 and the release v0.10 rendered the same error in GL. I tried both as regular and root users.
Appreciate any advice from experts.


npm install gl

npm http GET https://registry.npmjs.org/gl
npm http 200 https://registry.npmjs.org/gl
npm http GET https://registry.npmjs.org/gl/-/gl-0.0.2.tgz
npm http 200 https://registry.npmjs.org/gl/-/gl-0.0.2.tgz

[email protected] install /root/node_modules/gl
node-gyp rebuild

gyp http GET http://nodejs.org/dist/v0.10.23/node-v0.10.23.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.23/node-v0.10.23.tar.gz
make: Entering directory /root/node_modules/gl/build' CXX(target) Release/obj.target/webgl/src/bindings.o In file included from ../src/bindings.cc:15:0: ../src/webgl.h:32:3: error: ‘GLuint’ does not name a type ../src/webgl.h:33:28: error: ‘GLuint’ has not been declared ../src/webgl.h: In constructor ‘GLObj::GLObj(GLObjectType, int)’: ../src/webgl.h:35:11: error: ‘struct GLObj’ has no member named ‘obj’ ../src/webgl.h: At global scope: ../src/webgl.h:45:3: error: ‘GL_CONTEXT_TYPE’ does not name a type ../src/webgl.h:48:41: error: ‘GLuint’ has not been declared ../src/webgl.h:49:24: error: ‘GLuint’ has not been declared ../src/bindings.cc: In function ‘void init(v8::Handle<v8::Object>)’: ../src/bindings.cc:187:3: error: ‘GL_DEPTH_BUFFER_BIT’ was not declared in this scope ../src/bindings.cc:188:3: error: ‘GL_STENCIL_BUFFER_BIT’ was not declared in this scope ../src/bindings.cc:189:3: error: ‘GL_COLOR_BUFFER_BIT’ was not declared in this scope ../src/bindings.cc:192:3: error: ‘GL_FALSE’ was not declared in this scope ../src/bindings.cc:193:3: error: ‘GL_TRUE’ was not declared in this scope ../src/bindings.cc:196:3: error: ‘GL_POINTS’ was not declared in this scope ../src/bindings.cc:197:3: error: ‘GL_LINES’ was not declared in this scope ../src/bindings.cc:198:3: error: ‘GL_LINE_LOOP’ was not declared in this scope ../src/bindings.cc:199:3: error: ‘GL_LINE_STRIP’ was not declared in this scope ../src/bindings.cc:200:3: error: ‘GL_TRIANGLES’ was not declared in this scope ../src/bindings.cc:201:3: error: ‘GL_TRIANGLE_STRIP’ was not declared in this scope ../src/bindings.cc:202:3: error: ‘GL_TRIANGLE_FAN’ was not declared in this scope ../src/bindings.cc:215:3: error: ‘GL_ZERO’ was not declared in this scope ../src/bindings.cc:216:3: error: ‘GL_ONE’ was not declared in this scope ../src/bindings.cc:217:3: error: ‘GL_SRC_COLOR’ was not declared in this scope ../src/bindings.cc:218:3: error: ‘GL_ONE_MINUS_SRC_COLOR’ was not declared in this scope ../src/bindings.cc:219:3: error: ‘GL_SRC_ALPHA’ was not declared in this scope ../src/bindings.cc:220:3: error: ‘GL_ONE_MINUS_SRC_ALPHA’ was not declared in this scope ../src/bindings.cc:221:3: error: ‘GL_DST_ALPHA’ was not declared in this scope ../src/bindings.cc:222:3: error: ‘GL_ONE_MINUS_DST_ALPHA’ was not declared in this scope ../src/bindings.cc:227:3: error: ‘GL_DST_COLOR’ was not declared in this scope ../src/bindings.cc:228:3: error: ‘GL_ONE_MINUS_DST_COLOR’ was not declared in this scope ../src/bindings.cc:229:3: error: ‘GL_SRC_ALPHA_SATURATE’ was not declared in this scope ../src/bindings.cc:236:3: error: ‘GL_FUNC_ADD’ was not declared in this scope ../src/bindings.cc:237:3: error: ‘GL_BLEND_EQUATION’ was not declared in this scope ../src/bindings.cc:238:3: error: ‘GL_BLEND_EQUATION_RGB’ was not declared in this scope ../src/bindings.cc:239:3: error: ‘GL_BLEND_EQUATION_ALPHA’ was not declared in this scope ../src/bindings.cc:242:3: error: ‘GL_FUNC_SUBTRACT’ was not declared in this scope ../src/bindings.cc:243:3: error: ‘GL_FUNC_REVERSE_SUBTRACT’ was not declared in this scope ../src/bindings.cc:246:3: error: ‘GL_BLEND_DST_RGB’ was not declared in this scope ../src/bindings.cc:247:3: error: ‘GL_BLEND_SRC_RGB’ was not declared in this scope ../src/bindings.cc:248:3: error: ‘GL_BLEND_DST_ALPHA’ was not declared in this scope ../src/bindings.cc:249:3: error: ‘GL_BLEND_SRC_ALPHA’ was not declared in this scope ../src/bindings.cc:250:3: error: ‘GL_CONSTANT_COLOR’ was not declared in this scope ../src/bindings.cc:251:3: error: ‘GL_ONE_MINUS_CONSTANT_COLOR’ was not declared in this scope ../src/bindings.cc:252:3: error: ‘GL_CONSTANT_ALPHA’ was not declared in this scope ../src/bindings.cc:253:3: error: ‘GL_ONE_MINUS_CONSTANT_ALPHA’ was not declared in this scope ../src/bindings.cc:254:3: error: ‘GL_BLEND_COLOR’ was not declared in this scope ../src/bindings.cc:257:3: error: ‘GL_ARRAY_BUFFER’ was not declared in this scope ../src/bindings.cc:258:3: error: ‘GL_ELEMENT_ARRAY_BUFFER’ was not declared in this scope ../src/bindings.cc:259:3: error: ‘GL_ARRAY_BUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:260:3: error: ‘GL_ELEMENT_ARRAY_BUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:262:3: error: ‘GL_STREAM_DRAW’ was not declared in this scope ../src/bindings.cc:263:3: error: ‘GL_STATIC_DRAW’ was not declared in this scope ../src/bindings.cc:264:3: error: ‘GL_DYNAMIC_DRAW’ was not declared in this scope ../src/bindings.cc:266:3: error: ‘GL_BUFFER_SIZE’ was not declared in this scope ../src/bindings.cc:267:3: error: ‘GL_BUFFER_USAGE’ was not declared in this scope ../src/bindings.cc:269:3: error: ‘GL_CURRENT_VERTEX_ATTRIB’ was not declared in this scope ../src/bindings.cc:272:3: error: ‘GL_FRONT’ was not declared in this scope ../src/bindings.cc:273:3: error: ‘GL_BACK’ was not declared in this scope ../src/bindings.cc:274:3: error: ‘GL_FRONT_AND_BACK’ was not declared in this scope ../src/bindings.cc:287:3: error: ‘GL_TEXTURE_2D’ was not declared in this scope ../src/bindings.cc:288:3: error: ‘GL_CULL_FACE’ was not declared in this scope ../src/bindings.cc:289:3: error: ‘GL_BLEND’ was not declared in this scope ../src/bindings.cc:290:3: error: ‘GL_DITHER’ was not declared in this scope ../src/bindings.cc:291:3: error: ‘GL_STENCIL_TEST’ was not declared in this scope ../src/bindings.cc:292:3: error: ‘GL_DEPTH_TEST’ was not declared in this scope ../src/bindings.cc:293:3: error: ‘GL_SCISSOR_TEST’ was not declared in this scope ../src/bindings.cc:294:3: error: ‘GL_POLYGON_OFFSET_FILL’ was not declared in this scope ../src/bindings.cc:295:3: error: ‘GL_SAMPLE_ALPHA_TO_COVERAGE’ was not declared in this scope ../src/bindings.cc:296:3: error: ‘GL_SAMPLE_COVERAGE’ was not declared in this scope ../src/bindings.cc:299:3: error: ‘GL_NO_ERROR’ was not declared in this scope ../src/bindings.cc:300:3: error: ‘GL_INVALID_ENUM’ was not declared in this scope ../src/bindings.cc:301:3: error: ‘GL_INVALID_VALUE’ was not declared in this scope ../src/bindings.cc:302:3: error: ‘GL_INVALID_OPERATION’ was not declared in this scope ../src/bindings.cc:303:3: error: ‘GL_OUT_OF_MEMORY’ was not declared in this scope ../src/bindings.cc:306:3: error: ‘GL_CW’ was not declared in this scope ../src/bindings.cc:307:3: error: ‘GL_CCW’ was not declared in this scope ../src/bindings.cc:310:3: error: ‘GL_LINE_WIDTH’ was not declared in this scope ../src/bindings.cc:311:3: error: ‘GL_ALIASED_POINT_SIZE_RANGE’ was not declared in this scope ../src/bindings.cc:312:3: error: ‘GL_ALIASED_LINE_WIDTH_RANGE’ was not declared in this scope ../src/bindings.cc:313:3: error: ‘GL_CULL_FACE_MODE’ was not declared in this scope ../src/bindings.cc:314:3: error: ‘GL_FRONT_FACE’ was not declared in this scope ../src/bindings.cc:315:3: error: ‘GL_DEPTH_RANGE’ was not declared in this scope ../src/bindings.cc:316:3: error: ‘GL_DEPTH_WRITEMASK’ was not declared in this scope ../src/bindings.cc:317:3: error: ‘GL_DEPTH_CLEAR_VALUE’ was not declared in this scope ../src/bindings.cc:318:3: error: ‘GL_DEPTH_FUNC’ was not declared in this scope ../src/bindings.cc:319:3: error: ‘GL_STENCIL_CLEAR_VALUE’ was not declared in this scope ../src/bindings.cc:320:3: error: ‘GL_STENCIL_FUNC’ was not declared in this scope ../src/bindings.cc:321:3: error: ‘GL_STENCIL_FAIL’ was not declared in this scope ../src/bindings.cc:322:3: error: ‘GL_STENCIL_PASS_DEPTH_FAIL’ was not declared in this scope ../src/bindings.cc:323:3: error: ‘GL_STENCIL_PASS_DEPTH_PASS’ was not declared in this scope ../src/bindings.cc:324:3: error: ‘GL_STENCIL_REF’ was not declared in this scope ../src/bindings.cc:325:3: error: ‘GL_STENCIL_VALUE_MASK’ was not declared in this scope ../src/bindings.cc:326:3: error: ‘GL_STENCIL_WRITEMASK’ was not declared in this scope ../src/bindings.cc:327:3: error: ‘GL_STENCIL_BACK_FUNC’ was not declared in this scope ../src/bindings.cc:328:3: error: ‘GL_STENCIL_BACK_FAIL’ was not declared in this scope ../src/bindings.cc:329:3: error: ‘GL_STENCIL_BACK_PASS_DEPTH_FAIL’ was not declared in this scope ../src/bindings.cc:330:3: error: ‘GL_STENCIL_BACK_PASS_DEPTH_PASS’ was not declared in this scope ../src/bindings.cc:331:3: error: ‘GL_STENCIL_BACK_REF’ was not declared in this scope ../src/bindings.cc:332:3: error: ‘GL_STENCIL_BACK_VALUE_MASK’ was not declared in this scope ../src/bindings.cc:333:3: error: ‘GL_STENCIL_BACK_WRITEMASK’ was not declared in this scope ../src/bindings.cc:334:3: error: ‘GL_VIEWPORT’ was not declared in this scope ../src/bindings.cc:335:3: error: ‘GL_SCISSOR_BOX’ was not declared in this scope ../src/bindings.cc:337:3: error: ‘GL_COLOR_CLEAR_VALUE’ was not declared in this scope ../src/bindings.cc:338:3: error: ‘GL_COLOR_WRITEMASK’ was not declared in this scope ../src/bindings.cc:339:3: error: ‘GL_UNPACK_ALIGNMENT’ was not declared in this scope ../src/bindings.cc:340:3: error: ‘GL_PACK_ALIGNMENT’ was not declared in this scope ../src/bindings.cc:341:3: error: ‘GL_MAX_TEXTURE_SIZE’ was not declared in this scope ../src/bindings.cc:342:3: error: ‘GL_MAX_VIEWPORT_DIMS’ was not declared in this scope ../src/bindings.cc:343:3: error: ‘GL_SUBPIXEL_BITS’ was not declared in this scope ../src/bindings.cc:344:3: error: ‘GL_RED_BITS’ was not declared in this scope ../src/bindings.cc:345:3: error: ‘GL_GREEN_BITS’ was not declared in this scope ../src/bindings.cc:346:3: error: ‘GL_BLUE_BITS’ was not declared in this scope ../src/bindings.cc:347:3: error: ‘GL_ALPHA_BITS’ was not declared in this scope ../src/bindings.cc:348:3: error: ‘GL_DEPTH_BITS’ was not declared in this scope ../src/bindings.cc:349:3: error: ‘GL_STENCIL_BITS’ was not declared in this scope ../src/bindings.cc:350:3: error: ‘GL_POLYGON_OFFSET_UNITS’ was not declared in this scope ../src/bindings.cc:352:3: error: ‘GL_POLYGON_OFFSET_FACTOR’ was not declared in this scope ../src/bindings.cc:353:3: error: ‘GL_TEXTURE_BINDING_2D’ was not declared in this scope ../src/bindings.cc:354:3: error: ‘GL_SAMPLE_BUFFERS’ was not declared in this scope ../src/bindings.cc:355:3: error: ‘GL_SAMPLES’ was not declared in this scope ../src/bindings.cc:356:3: error: ‘GL_SAMPLE_COVERAGE_VALUE’ was not declared in this scope ../src/bindings.cc:357:3: error: ‘GL_SAMPLE_COVERAGE_INVERT’ was not declared in this scope ../src/bindings.cc:365:3: error: ‘GL_NUM_COMPRESSED_TEXTURE_FORMATS’ was not declared in this scope ../src/bindings.cc:366:3: error: ‘GL_COMPRESSED_TEXTURE_FORMATS’ was not declared in this scope ../src/bindings.cc:369:3: error: ‘GL_DONT_CARE’ was not declared in this scope ../src/bindings.cc:370:3: error: ‘GL_FASTEST’ was not declared in this scope ../src/bindings.cc:371:3: error: ‘GL_NICEST’ was not declared in this scope ../src/bindings.cc:374:3: error: ‘GL_GENERATE_MIPMAP_HINT’ was not declared in this scope ../src/bindings.cc:377:3: error: ‘GL_BYTE’ was not declared in this scope ../src/bindings.cc:378:3: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope ../src/bindings.cc:379:3: error: ‘GL_SHORT’ was not declared in this scope ../src/bindings.cc:380:3: error: ‘GL_UNSIGNED_SHORT’ was not declared in this scope ../src/bindings.cc:381:3: error: ‘GL_INT’ was not declared in this scope ../src/bindings.cc:382:3: error: ‘GL_UNSIGNED_INT’ was not declared in this scope ../src/bindings.cc:383:3: error: ‘GL_FLOAT’ was not declared in this scope ../src/bindings.cc:385:3: error: ‘GL_FIXED’ was not declared in this scope ../src/bindings.cc:389:3: error: ‘GL_DEPTH_COMPONENT’ was not declared in this scope ../src/bindings.cc:390:3: error: ‘GL_ALPHA’ was not declared in this scope ../src/bindings.cc:391:3: error: ‘GL_RGB’ was not declared in this scope ../src/bindings.cc:392:3: error: ‘GL_RGBA’ was not declared in this scope ../src/bindings.cc:393:3: error: ‘GL_LUMINANCE’ was not declared in this scope ../src/bindings.cc:394:3: error: ‘GL_LUMINANCE_ALPHA’ was not declared in this scope ../src/bindings.cc:398:3: error: ‘GL_UNSIGNED_SHORT_4_4_4_4’ was not declared in this scope ../src/bindings.cc:399:3: error: ‘GL_UNSIGNED_SHORT_5_5_5_1’ was not declared in this scope ../src/bindings.cc:400:3: error: ‘GL_UNSIGNED_SHORT_5_6_5’ was not declared in this scope ../src/bindings.cc:403:3: error: ‘GL_FRAGMENT_SHADER’ was not declared in this scope ../src/bindings.cc:404:3: error: ‘GL_VERTEX_SHADER’ was not declared in this scope ../src/bindings.cc:405:3: error: ‘GL_MAX_VERTEX_ATTRIBS’ was not declared in this scope ../src/bindings.cc:407:3: error: ‘GL_MAX_VERTEX_UNIFORM_VECTORS’ was not declared in this scope ../src/bindings.cc:408:3: error: ‘GL_MAX_VARYING_VECTORS’ was not declared in this scope ../src/bindings.cc:410:3: error: ‘GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS’ was not declared in this scope ../src/bindings.cc:411:3: error: ‘GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS’ was not declared in this scope ../src/bindings.cc:412:3: error: ‘GL_MAX_TEXTURE_IMAGE_UNITS’ was not declared in this scope ../src/bindings.cc:414:3: error: ‘GL_MAX_FRAGMENT_UNIFORM_VECTORS’ was not declared in this scope ../src/bindings.cc:416:3: error: ‘GL_SHADER_TYPE’ was not declared in this scope ../src/bindings.cc:417:3: error: ‘GL_DELETE_STATUS’ was not declared in this scope ../src/bindings.cc:418:3: error: ‘GL_LINK_STATUS’ was not declared in this scope ../src/bindings.cc:419:3: error: ‘GL_VALIDATE_STATUS’ was not declared in this scope ../src/bindings.cc:420:3: error: ‘GL_ATTACHED_SHADERS’ was not declared in this scope ../src/bindings.cc:421:3: error: ‘GL_ACTIVE_UNIFORMS’ was not declared in this scope ../src/bindings.cc:422:3: error: ‘GL_ACTIVE_UNIFORM_MAX_LENGTH’ was not declared in this scope ../src/bindings.cc:423:3: error: ‘GL_ACTIVE_ATTRIBUTES’ was not declared in this scope ../src/bindings.cc:424:3: error: ‘GL_ACTIVE_ATTRIBUTE_MAX_LENGTH’ was not declared in this scope ../src/bindings.cc:425:3: error: ‘GL_SHADING_LANGUAGE_VERSION’ was not declared in this scope ../src/bindings.cc:426:3: error: ‘GL_CURRENT_PROGRAM’ was not declared in this scope ../src/bindings.cc:429:3: error: ‘GL_NEVER’ was not declared in this scope ../src/bindings.cc:430:3: error: ‘GL_LESS’ was not declared in this scope ../src/bindings.cc:431:3: error: ‘GL_EQUAL’ was not declared in this scope ../src/bindings.cc:432:3: error: ‘GL_LEQUAL’ was not declared in this scope ../src/bindings.cc:433:3: error: ‘GL_GREATER’ was not declared in this scope ../src/bindings.cc:434:3: error: ‘GL_NOTEQUAL’ was not declared in this scope ../src/bindings.cc:435:3: error: ‘GL_GEQUAL’ was not declared in this scope ../src/bindings.cc:436:3: error: ‘GL_ALWAYS’ was not declared in this scope ../src/bindings.cc:440:3: error: ‘GL_KEEP’ was not declared in this scope ../src/bindings.cc:441:3: error: ‘GL_REPLACE’ was not declared in this scope ../src/bindings.cc:442:3: error: ‘GL_INCR’ was not declared in this scope ../src/bindings.cc:443:3: error: ‘GL_DECR’ was not declared in this scope ../src/bindings.cc:444:3: error: ‘GL_INVERT’ was not declared in this scope ../src/bindings.cc:445:3: error: ‘GL_INCR_WRAP’ was not declared in this scope ../src/bindings.cc:446:3: error: ‘GL_DECR_WRAP’ was not declared in this scope ../src/bindings.cc:449:3: error: ‘GL_VENDOR’ was not declared in this scope ../src/bindings.cc:450:3: error: ‘GL_RENDERER’ was not declared in this scope ../src/bindings.cc:451:3: error: ‘GL_VERSION’ was not declared in this scope ../src/bindings.cc:452:3: error: ‘GL_EXTENSIONS’ was not declared in this scope ../src/bindings.cc:455:3: error: ‘GL_NEAREST’ was not declared in this scope ../src/bindings.cc:456:3: error: ‘GL_LINEAR’ was not declared in this scope ../src/bindings.cc:461:3: error: ‘GL_NEAREST_MIPMAP_NEAREST’ was not declared in this scope ../src/bindings.cc:462:3: error: ‘GL_LINEAR_MIPMAP_NEAREST’ was not declared in this scope ../src/bindings.cc:463:3: error: ‘GL_NEAREST_MIPMAP_LINEAR’ was not declared in this scope ../src/bindings.cc:464:3: error: ‘GL_LINEAR_MIPMAP_LINEAR’ was not declared in this scope ../src/bindings.cc:467:3: error: ‘GL_TEXTURE_MAG_FILTER’ was not declared in this scope ../src/bindings.cc:468:3: error: ‘GL_TEXTURE_MIN_FILTER’ was not declared in this scope ../src/bindings.cc:469:3: error: ‘GL_TEXTURE_WRAP_S’ was not declared in this scope ../src/bindings.cc:470:3: error: ‘GL_TEXTURE_WRAP_T’ was not declared in this scope ../src/bindings.cc:474:3: error: ‘GL_TEXTURE’ was not declared in this scope ../src/bindings.cc:476:3: error: ‘GL_TEXTURE_CUBE_MAP’ was not declared in this scope ../src/bindings.cc:477:3: error: ‘GL_TEXTURE_BINDING_CUBE_MAP’ was not declared in this scope ../src/bindings.cc:478:3: error: ‘GL_TEXTURE_CUBE_MAP_POSITIVE_X’ was not declared in this scope ../src/bindings.cc:479:3: error: ‘GL_TEXTURE_CUBE_MAP_NEGATIVE_X’ was not declared in this scope ../src/bindings.cc:480:3: error: ‘GL_TEXTURE_CUBE_MAP_POSITIVE_Y’ was not declared in this scope ../src/bindings.cc:481:3: error: ‘GL_TEXTURE_CUBE_MAP_NEGATIVE_Y’ was not declared in this scope ../src/bindings.cc:482:3: error: ‘GL_TEXTURE_CUBE_MAP_POSITIVE_Z’ was not declared in this scope ../src/bindings.cc:483:3: error: ‘GL_TEXTURE_CUBE_MAP_NEGATIVE_Z’ was not declared in this scope ../src/bindings.cc:484:3: error: ‘GL_MAX_CUBE_MAP_TEXTURE_SIZE’ was not declared in this scope ../src/bindings.cc:487:3: error: ‘GL_TEXTURE0’ was not declared in this scope ../src/bindings.cc:488:3: error: ‘GL_TEXTURE1’ was not declared in this scope ../src/bindings.cc:489:3: error: ‘GL_TEXTURE2’ was not declared in this scope ../src/bindings.cc:490:3: error: ‘GL_TEXTURE3’ was not declared in this scope ../src/bindings.cc:491:3: error: ‘GL_TEXTURE4’ was not declared in this scope ../src/bindings.cc:492:3: error: ‘GL_TEXTURE5’ was not declared in this scope ../src/bindings.cc:493:3: error: ‘GL_TEXTURE6’ was not declared in this scope ../src/bindings.cc:494:3: error: ‘GL_TEXTURE7’ was not declared in this scope ../src/bindings.cc:495:3: error: ‘GL_TEXTURE8’ was not declared in this scope ../src/bindings.cc:496:3: error: ‘GL_TEXTURE9’ was not declared in this scope ../src/bindings.cc:497:3: error: ‘GL_TEXTURE10’ was not declared in this scope ../src/bindings.cc:498:3: error: ‘GL_TEXTURE11’ was not declared in this scope ../src/bindings.cc:499:3: error: ‘GL_TEXTURE12’ was not declared in this scope ../src/bindings.cc:500:3: error: ‘GL_TEXTURE13’ was not declared in this scope ../src/bindings.cc:501:3: error: ‘GL_TEXTURE14’ was not declared in this scope ../src/bindings.cc:502:3: error: ‘GL_TEXTURE15’ was not declared in this scope ../src/bindings.cc:503:3: error: ‘GL_TEXTURE16’ was not declared in this scope ../src/bindings.cc:504:3: error: ‘GL_TEXTURE17’ was not declared in this scope ../src/bindings.cc:505:3: error: ‘GL_TEXTURE18’ was not declared in this scope ../src/bindings.cc:506:3: error: ‘GL_TEXTURE19’ was not declared in this scope ../src/bindings.cc:507:3: error: ‘GL_TEXTURE20’ was not declared in this scope ../src/bindings.cc:508:3: error: ‘GL_TEXTURE21’ was not declared in this scope ../src/bindings.cc:509:3: error: ‘GL_TEXTURE22’ was not declared in this scope ../src/bindings.cc:510:3: error: ‘GL_TEXTURE23’ was not declared in this scope ../src/bindings.cc:511:3: error: ‘GL_TEXTURE24’ was not declared in this scope ../src/bindings.cc:512:3: error: ‘GL_TEXTURE25’ was not declared in this scope ../src/bindings.cc:513:3: error: ‘GL_TEXTURE26’ was not declared in this scope ../src/bindings.cc:514:3: error: ‘GL_TEXTURE27’ was not declared in this scope ../src/bindings.cc:515:3: error: ‘GL_TEXTURE28’ was not declared in this scope ../src/bindings.cc:516:3: error: ‘GL_TEXTURE29’ was not declared in this scope ../src/bindings.cc:517:3: error: ‘GL_TEXTURE30’ was not declared in this scope ../src/bindings.cc:518:3: error: ‘GL_TEXTURE31’ was not declared in this scope ../src/bindings.cc:519:3: error: ‘GL_ACTIVE_TEXTURE’ was not declared in this scope ../src/bindings.cc:522:3: error: ‘GL_REPEAT’ was not declared in this scope ../src/bindings.cc:523:3: error: ‘GL_CLAMP_TO_EDGE’ was not declared in this scope ../src/bindings.cc:524:3: error: ‘GL_MIRRORED_REPEAT’ was not declared in this scope ../src/bindings.cc:527:3: error: ‘GL_FLOAT_VEC2’ was not declared in this scope ../src/bindings.cc:528:3: error: ‘GL_FLOAT_VEC3’ was not declared in this scope ../src/bindings.cc:529:3: error: ‘GL_FLOAT_VEC4’ was not declared in this scope ../src/bindings.cc:530:3: error: ‘GL_INT_VEC2’ was not declared in this scope ../src/bindings.cc:531:3: error: ‘GL_INT_VEC3’ was not declared in this scope ../src/bindings.cc:532:3: error: ‘GL_INT_VEC4’ was not declared in this scope ../src/bindings.cc:533:3: error: ‘GL_BOOL’ was not declared in this scope ../src/bindings.cc:534:3: error: ‘GL_BOOL_VEC2’ was not declared in this scope ../src/bindings.cc:535:3: error: ‘GL_BOOL_VEC3’ was not declared in this scope ../src/bindings.cc:536:3: error: ‘GL_BOOL_VEC4’ was not declared in this scope ../src/bindings.cc:537:3: error: ‘GL_FLOAT_MAT2’ was not declared in this scope ../src/bindings.cc:538:3: error: ‘GL_FLOAT_MAT3’ was not declared in this scope ../src/bindings.cc:539:3: error: ‘GL_FLOAT_MAT4’ was not declared in this scope ../src/bindings.cc:540:3: error: ‘GL_SAMPLER_2D’ was not declared in this scope ../src/bindings.cc:541:3: error: ‘GL_SAMPLER_CUBE’ was not declared in this scope ../src/bindings.cc:544:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_ENABLED’ was not declared in this scope ../src/bindings.cc:545:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_SIZE’ was not declared in this scope ../src/bindings.cc:546:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_STRIDE’ was not declared in this scope ../src/bindings.cc:547:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_TYPE’ was not declared in this scope ../src/bindings.cc:548:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_NORMALIZED’ was not declared in this scope ../src/bindings.cc:549:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_POINTER’ was not declared in this scope ../src/bindings.cc:550:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:554:3: error: ‘GL_IMPLEMENTATION_COLOR_READ_TYPE’ was not declared in this scope ../src/bindings.cc:555:3: error: ‘GL_IMPLEMENTATION_COLOR_READ_FORMAT’ was not declared in this scope ../src/bindings.cc:559:3: error: ‘GL_COMPILE_STATUS’ was not declared in this scope ../src/bindings.cc:560:3: error: ‘GL_INFO_LOG_LENGTH’ was not declared in this scope ../src/bindings.cc:561:3: error: ‘GL_SHADER_SOURCE_LENGTH’ was not declared in this scope ../src/bindings.cc:563:3: error: ‘GL_SHADER_COMPILER’ was not declared in this scope ../src/bindings.cc:568:3: error: ‘GL_SHADER_BINARY_FORMATS’ was not declared in this scope ../src/bindings.cc:569:3: error: ‘GL_NUM_SHADER_BINARY_FORMATS’ was not declared in this scope ../src/bindings.cc:574:3: error: ‘GL_LOW_FLOAT’ was not declared in this scope ../src/bindings.cc:575:3: error: ‘GL_MEDIUM_FLOAT’ was not declared in this scope ../src/bindings.cc:576:3: error: ‘GL_HIGH_FLOAT’ was not declared in this scope ../src/bindings.cc:577:3: error: ‘GL_LOW_INT’ was not declared in this scope ../src/bindings.cc:578:3: error: ‘GL_MEDIUM_INT’ was not declared in this scope ../src/bindings.cc:579:3: error: ‘GL_HIGH_INT’ was not declared in this scope ../src/bindings.cc:583:3: error: ‘GL_FRAMEBUFFER’ was not declared in this scope ../src/bindings.cc:584:3: error: ‘GL_RENDERBUFFER’ was not declared in this scope ../src/bindings.cc:586:3: error: ‘GL_RGBA4’ was not declared in this scope ../src/bindings.cc:587:3: error: ‘GL_RGB5_A1’ was not declared in this scope ../src/bindings.cc:591:3: error: ‘GL_DEPTH_COMPONENT16’ was not declared in this scope ../src/bindings.cc:592:3: error: ‘GL_STENCIL_INDEX’ was not declared in this scope ../src/bindings.cc:593:3: error: ‘GL_STENCIL_INDEX8’ was not declared in this scope ../src/bindings.cc:595:3: error: ‘GL_RENDERBUFFER_WIDTH’ was not declared in this scope ../src/bindings.cc:596:3: error: ‘GL_RENDERBUFFER_HEIGHT’ was not declared in this scope ../src/bindings.cc:597:3: error: ‘GL_RENDERBUFFER_INTERNAL_FORMAT’ was not declared in this scope ../src/bindings.cc:598:3: error: ‘GL_RENDERBUFFER_RED_SIZE’ was not declared in this scope ../src/bindings.cc:599:3: error: ‘GL_RENDERBUFFER_GREEN_SIZE’ was not declared in this scope ../src/bindings.cc:600:3: error: ‘GL_RENDERBUFFER_BLUE_SIZE’ was not declared in this scope ../src/bindings.cc:601:3: error: ‘GL_RENDERBUFFER_ALPHA_SIZE’ was not declared in this scope ../src/bindings.cc:602:3: error: ‘GL_RENDERBUFFER_DEPTH_SIZE’ was not declared in this scope ../src/bindings.cc:603:3: error: ‘GL_RENDERBUFFER_STENCIL_SIZE’ was not declared in this scope ../src/bindings.cc:605:3: error: ‘GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE’ was not declared in this scope ../src/bindings.cc:606:3: error: ‘GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME’ was not declared in this scope ../src/bindings.cc:607:3: error: ‘GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL’ was not declared in this scope ../src/bindings.cc:608:3: error: ‘GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE’ was not declared in this scope ../src/bindings.cc:610:3: error: ‘GL_COLOR_ATTACHMENT0’ was not declared in this scope ../src/bindings.cc:611:3: error: ‘GL_DEPTH_ATTACHMENT’ was not declared in this scope ../src/bindings.cc:612:3: error: ‘GL_STENCIL_ATTACHMENT’ was not declared in this scope ../src/bindings.cc:614:3: error: ‘GL_NONE’ was not declared in this scope ../src/bindings.cc:616:3: error: ‘GL_FRAMEBUFFER_COMPLETE’ was not declared in this scope ../src/bindings.cc:617:3: error: ‘GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT’ was not declared in this scope ../src/bindings.cc:618:3: error: ‘GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT’ was not declared in this scope ../src/bindings.cc:622:3: error: ‘GL_FRAMEBUFFER_UNSUPPORTED’ was not declared in this scope ../src/bindings.cc:624:3: error: ‘GL_FRAMEBUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:625:3: error: ‘GL_RENDERBUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:626:3: error: ‘GL_MAX_RENDERBUFFER_SIZE’ was not declared in this scope ../src/bindings.cc:628:3: error: ‘GL_INVALID_FRAMEBUFFER_OPERATION’ was not declared in this scope make: *** [Release/obj.target/webgl/src/bindings.o] Error 1 make: Leaving directory/root/node_modules/gl/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.2.0-57-virtual
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node_modules/gl
gyp ERR! node -v v0.10.23
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the gl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls gl
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-57-virtual
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "gl"
npm ERR! cwd /root
npm ERR! node -v v0.10.23
npm ERR! npm -v 1.3.17
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm ERR! not ok code 0

npm owner ls gl

npm http GET https://registry.npmjs.org/gl
npm http 304 https://registry.npmjs.org/gl
mikolalysenko [email protected]

Additive blend mode is broken

Hi guys! Great project. We are using it for http://clara.io.

I just wanted to share that we have determined conclusively that the additive pre-multiplied blend mode is incorrect in headless-gl.

Specifically this does not work:

gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD );
gl.blendFuncSeparate( gl.ONE, gl.ONE, gl.ONE, gl.ONE );

The above should be functionally equivalent to:

gl_FragColor.rgb = src.rgb + dst.rgb;
gl_FragColor.a = src.a + dst.a;

But it isn't. Rather the result is ending up all mid-tone gray when rendered in headless-gl. I am not exactly sure how it is ending up in gray.

I believe more than just this one blend mode are incorrect.

I do not need a fix for this as I have worked around this in my code base by writing my own compositing pass that supports various blend modes to avoid relying upon the build-in WebGL blending modes.

/FYI @wvl

Package fails to install in some environments

headless-gl will fail to install in some environments. My company's build servers do not have GPUs and probably lack important opengl/x11/graphics packages. The error message is as follows:

prebuild WARN install libX11.so.6: cannot open shared object file: No such file or directory
gyp: Call to 'pkg-config --libs-only-l x11 xi xext' returned exit status 127 while in angle/src/angle.gyp. while loading dependencies of binding.gyp while trying to load binding.gyp

Is it possible to provide a sane no-op fallback (such as loading nogl when these packages or object files are not available) so the build can succeed?

Failure to render the stanford bunny model using standard stack-gl code

I'm getting a full red image with this code. I removed all the manual buffer creation, and converted the example to javascript (was coffee script).

Run it with:
node ./headless_offscreen.js

// Generated by CoffeeScript 1.9.3
(function() {
  var Geometry, PNG, Shader, bunny, camera, fragShader, fs, geometry, gl, height, i, j, mat4, model, normals, path, pixels, png, projection, ref, render, shader, stream, update, vertShader, view, width;

  PNG = require('pngjs').PNG;

  fs = require('fs');

  bunny = require('bunny');

  normals = require('normals');

  Shader = require('gl-shader');

  camera = require('lookat-camera')();

  width = 600;

  height = 400;

  gl = require("gl")(width, height, {
    preserveDrawingBuffer: true
  });

  Geometry = require('gl-geometry');

  geometry = Geometry(gl);

  geometry.attr('aPosition', bunny.positions);

  geometry.attr('aNormal', normals.vertexNormals(bunny.cells, bunny.positions));

  geometry.faces(bunny.cells);

  mat4 = require('gl-mat4');

  projection = mat4.create();

  model = mat4.create();

  view = mat4.create();

  vertShader = "attribute vec3 aPosition;\n\nuniform mat4 uProjection;\nuniform mat4 uModel;\nuniform mat4 uView;\n\nvoid main() {\n  gl_Position = uProjection * uView * \n                uModel * vec4(aPosition, 1.0);\n}";

  fragShader = "void main() {\n  gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);\n}";

  shader = Shader(gl, vertShader, fragShader);

  update = function(width, height) {
    var aspectRatio, far, fieldOfView, near;
    camera.target = new Float32Array([0, 0, 0]);
    camera.position = new Float32Array([20, 20, 20]);
    view = camera.view(view);
    aspectRatio = width / height;
    fieldOfView = Math.PI / 4;
    near = 0.01;
    far = 100;
    return mat4.perspective(projection, fieldOfView, aspectRatio, near, far);
  };

  render = function(width, height) {
    update(width, height);
    gl.clearColor(1.0, 0.0, 0.0, 1.0);
    gl.clear(gl.COLOR_BUFFER_BIT);
    gl.clear(gl.DEPTH_BUFFER_BIT);
    gl.enable(gl.DEPTH_TEST);
    gl.viewport(0, 0, width, height);
    geometry.bind(shader);
    shader.uniforms.uProjection = projection;
    shader.uniforms.uView = view;
    shader.uniforms.uModel = model;
    geometry.draw(gl.TRIANGLES);
    return gl.finish();
  };

  render(width, height);

  path = "out.png";

  pixels = new Uint8Array(width * height * 4);

  gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);

  png = new PNG({
    width: width,
    height: height
  });

  for (i = j = 0, ref = pixels.length; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
    png.data[i] = pixels[i];
  }

  stream = fs.createWriteStream(path);

  png.pack().pipe(stream);

  stream.on('close', function() {
    return console.log("Image written: " + path);
  });

  gl.destroy();

}).call(this);

prebuild CI

Need to run the prebuild scripts and publish to npm whenever a new version is released. Not sure the best way to automate this yet. At minimum, we need to support the following platforms:

  • OS X (64-bit)
  • Linux (32 and 64-bit)
  • Windows 8 (32 and 64 bit)
  • Windows 10 (32 and 64 bit)

Latest version broken on Ubuntu 14.04 LTS

Installing the latest on Ubuntu 14.04 LTS, when trying to run code that uses headless-gl I get:

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /var/3d2png/node_modules/gl/build/Release/webgl.node)

This doesn't happen with 2.1.5

uniform/vertex *v methods should accept vanilla JS arrays

The uniform[1234][fi]v, uniformMatrix[234]fv, and vertexAttrib[1234]fv methods should accept a vanilla JavaScript array as the values argument. Currently they work only when passed Float32Array/Int32Array and segfault when passed a regular array.

symbol lookup error on nVidia

node-gl was working fine for me inside Vagrant, then I tried speeding it up by using it on a machine with a real X server on an nVidia card and I got this error:

node: symbol lookup error: .../node_modules/gl/build/Release/webgl.node: undefined symbol: _Z15XextFindDisplayP15_XExtensionInfoP9_XDisplay

I fixed the error by recompiling everything and manually copying webgl.node into my installation.

Doesn't compile on Node 0.12

npm install on Node 0.12.0 (latest stable) throws errors like:

$ npm install

> [email protected] install /Users/mourner/Projects/headless-gl
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
  CXX(target) Release/obj.target/webgl/src/bindings.o
In file included from ../src/bindings.cc:18:
../src/webgl.h:45:28: error: expected class name
class WebGL : public node::ObjectWrap {
                           ^
../src/webgl.h:68:3: error: no type named 'Arguments' in namespace 'v8'; did you mean
      'v8::internal::Arguments'?
  JS_METHOD(New);
  ^~~~~~~~~~~~~~
../src/webgl.h:23:65: note: expanded from macro 'JS_METHOD'
#define JS_METHOD(name) static v8::Handle<v8::Value> name(const v8::Arguments& args)
                                                                ^~~~
/Users/mourner/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/bindings.cc:18:
../src/webgl.h:69:3: error: no type named 'Arguments' in namespace 'v8'; did you mean
      'v8::internal::Arguments'?
  JS_METHOD(Destroy);
  ^~~~~~~~~~~~~~~~~~
../src/webgl.h:23:65: note: expanded from macro 'JS_METHOD'
#define JS_METHOD(name) static v8::Handle<v8::Value> name(const v8::Arguments& args)
                                                                ^~~~
/Users/mourner/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/bindings.cc:18:
../src/webgl.h:72:3: error: no type named 'Arguments' in namespace 'v8'; did you mean
      'v8::internal::Arguments'?
  JS_METHOD(Uniform1f);
  ^~~~~~~~~~~~~~~~~~~~
../src/webgl.h:23:65: note: expanded from macro 'JS_METHOD'
#define JS_METHOD(name) static v8::Handle<v8::Value> name(const v8::Arguments& args)
                                                                ^~~~
/Users/mourner/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/bindings.cc:18:
../src/webgl.h:73:3: error: no type named 'Arguments' in namespace 'v8'; did you mean
      'v8::internal::Arguments'?
  JS_METHOD(Uniform2f);
  ^~~~~~~~~~~~~~~~~~~~

Linux support

Need to implement xglCreateContext. Should be straightforward

context is null on AWS

hello!
I'm trying really hard to get headless-gl to work on an AWS gpu enabled instance (EC2 gl2.2xlarge).
For the moment I'm not doing anything fancy, just the basic example but the gl context is not created, just null is returned.

I have the latest nvidia drivers installed and am using xvfb-run.
Also, this is logged as well: Xlib: extension "GLX" missing on display ":99".
I googled a lot for that error, set DISPLAY to equal :99, everything i could find, yet still nothing.

Locally headless-gl works just fine, and I think it's very interesting.
Thank you very much for reading and looking forward to any responses. Send help! :)

GLSL GL_ES precision directives yield shader compile errors (Linux)

THREE.WebGLShader: Shader couldn't compile.
THREE.WebGLShader: gl.getShaderInfoLog() 0:1(1): error: syntax error, unexpected NEW_IDENTIFIER
 1: precision highp float;
2: precision highp int;

Even if ANGLE has a shader transpiler that maps ESSL -> conforming GLSL in whatever environment you are running on, this doesn't seem to be working on Linux.

I have tried to strip out such precision directives by removing them from the source in the shaderSource wrapper and the errors go away and my code starts working (yeah), but it feels dirty / gross. I wonder if C++ some code needs to be run to tell ANGLE to transpile the shaders.

Here is the code that does that for reference:

bsergean@92d1f72

Extension support

Need to verify that extension support from node-webgl is working.

Frequent Segfault:11 errors happening

Note sure where to place it, but it seems to happen often while loading textures and generating mipmaps.
Output:

PID 73245 received SIGSEGV for address: 0x115456000
0   segfault-handler.node               0x0000000100bd047a _ZL16segfault_handleriP9__siginfoPv + 282
1   libsystem_platform.dylib            0x00007fff8d19cf1a _sigtramp + 26
2   node                                0x00000001002a9d88 _ZN2v88internal7Scanner4ScanEv + 508
3   libGLImage.dylib                    0x00007fff8af78329 _ZL22glgCopyRowsWithMemCopyPK15GLGOperationRecmPK15GLDPixelModeRec + 67
4   libGLImage.dylib                    0x00007fff8af769d4 glgProcessPixelsWithProcessor + 1499
5   GLEngine                            0x00007fff8d7d62a6 gleTextureImagePut + 1224
6   GLEngine                            0x00007fff8d69e5f5 glTexImage2D_Exec + 1248
7   libGL.dylib                         0x00007fff944b646d glTexImage2D + 77
8   webgl.node                          0x00000001008e814e _ZN5WebGL10TexImage2DERKN2v89ArgumentsE + 626
9   node                                0x0000000100145b9a _ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 459
10  ???                                 0x00003d951700618e 0x0 + 67710545322382
11  ???                                 0x00003d95172976d2 0x0 + 67710548014802

"npm i" error

Hello,
I am on Window 8.1 64bit with nodejs 0.10
I cannot install gl module.
Here is log:
$ npm i
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data

[email protected] install F:\Data\git\door\node_modules\gl
prebuild --download

prebuild WARN install Prebuilt binaries for node version v0.10.29 are not available
prebuildnpm ERR! [email protected] install: prebuild --download
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the gl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! prebuild --download
npm ERR! You can get their info via:
npm ERR! npm owner ls gl
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "i"
npm ERR! cwd F:\Data\git\door
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE

Thank you

GL extension support

There does not seem to be any code to support GL extensions. I wonder what it would take to add this.

GL_METHOD(GetSupportedExtensions) {
  GL_BOILERPLATE;
  char *extensions=(char*) glGetString(GL_EXTENSIONS);
  NanReturnValue(NanNew<v8::String>(extensions));
}

GL_METHOD(GetExtension) {
  GL_BOILERPLATE;

  //TODO

  NanReturnUndefined();
}

gl.clear() failing for framebuffer with RGB color attachment

I've created a minimal example in the attached file to demonstrate:

clear_rgb_buffer.txt

It fails with INVALID_FRAMEBUFFER_OPERATION, but changing the texture format to RGBA produces no error.

We (@bhouston) have code that functions normally when rendering to, say, the browser, but fails with headless-gl for this reason.

The code that ultimately results in the error is:

    if (colorAttachment._format !== gl.RGBA ||
        colorAttachment._type !== gl.UNSIGNED_BYTE) {
      return gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
    }

in preCheckFramebufferStatus() which runs right before a clear operation. I believe this check can safely be relaxed to allow RGB-formatted color attachments through?

zero-arg createContext fails on linux

On linux, require('gl').createContext() (as shown in the README) produces the following error:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  53 (X_CreatePixmap)
  Value in failed request:  0x0
  Serial number of failed request:  18
  Current serial number in output stream:  22

If a no-argument call is not intended to work (it does work on OS X), the README should show the intended usage and createContext should check the arguments.

Texture does not work

Texture does not work without any error logging.
I use data from this :
//create image data

var canvas = document.createElement('canvas'),
ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);

                //now we can finally get a Uint8ClampedArray
                var imageData = ctx.getImageData(0, 0, image.width, image.height);
            image =  imageData;

Then pass image to texImage2D

ALPHA and LUMINANCE not working correctly

Currently ALPHA and LUMINANCE textures aren't working correctly. This might be a problem in ANGLE, or it could be an issue with how the context is getting set up.

Missing 0/144 methods inorder to fully support webkit.js :)

Hello! Thank you for this awesome project! I'm trying to implement this inorder to support webkit.js (link here). However, for some odd reason, I'm getting blank pixels. I'm confident its probably Webkit.js's fault since it has been maintained in about a year and It seems as though there are far more things going on then I even realize, but nonetheless I wanted to see if there was something I can do now that would get me further faster.

So, one thought was that its possible you haven't implemented the necessary methods. The problem with this being a problem is that I would expect an error to be thrown at some point about how undefined is not a function. But this never happens.

Currently I'm missing the following methods

["compressedTexImage2D", "compressedTexSubImage2D", "uniform1fv", "uniform1iv", "uniform2fv", "uniform2iv", "uniform3fv", "uniform3iv", "uniform4fv", "uniform4iv", "vertexAttrib1fv", "vertexAttrib2fv", "vertexAttrib3fv", "vertexAttrib4fv"]

I have no idea what any of these are (though perhaps its time for me to find out)

To repeat go to or download https://raw.githubusercontent.com/trevorlinton/webkit.js/master/bin/webkit.bin.js

// if in the inspector
var text = document.body.firstChild.textContent;
// otherwise you can just have it from a httprequest or filesystem

var isGLLine = /GLctx(\.|\[)/;
var repeatCapture = /GLctx(?:\.|\['|\[")(\w+)/g;
var singleCapture = /GLctx(?:\.|\['|\[")(\w+)/;

var lines = text.split('\n')
var glLines = lines.filter(isGLLine.test.bind(isGLLine));


var dirtyMethods = glLines.map(function(str){ return str.match(repeatCapture) });;

var repeatedMethods = dirtyMethods.reduce(function(array, curArray){
  return array.concat(curArray.map(function(line){ return singleCapture.exec(line)[1] }));
}, []);

var uniqueMethods = Array.from(new Set(repeatedMethods)).sort();

This will give you

["ACTIVE_ATTRIBUTES","ACTIVE_UNIFORMS","ARRAY_BUFFER","ARRAY_BUFFER_BINDING","DYNAMIC_DRAW","ELEMENT_ARRAY_BUFFER","ELEMENT_ARRAY_BUFFER_BINDING","MAX_VERTEX_ATTRIBS","RGBA","STATIC_DRAW","activeTexture","attachShader","bindAttribLocation","bindBuffer","bindFramebuffer","bindRenderbuffer","bindTexture","blendColor","blendEquation","blendEquationSeparate","blendFunc","blendFuncSeparate","bufferData","bufferSubData","checkFramebufferStatus","clear","clearColor","clearDepth","clearStencil","colorMask","compileShader","compressedTexImage2D","compressedTexSubImage2D","copyTexImage2D","copyTexSubImage2D","createBuffer","createFramebuffer","createProgram","createRenderbuffer","createShader","createTexture","cullFace","deleteBuffer","deleteFramebuffer","deleteProgram","deleteRenderbuffer","deleteShader","deleteTexture","depthFunc","depthMask","depthRange","detachShader","disable","disableVertexAttribArray","drawArrays","drawElements","enable","enableVertexAttribArray","finish","flush","framebufferRenderbuffer","framebufferTexture2D","frontFace","generateMipmap","getActiveAttrib","getActiveUniform","getAttachedShaders","getAttribLocation","getBufferParameter","getError","getExtension","getFramebufferAttachmentParameter","getParameter","getProgramInfoLog","getProgramParameter","getRenderbufferParameter","getShaderInfoLog","getShaderParameter","getShaderPrecisionFormat","getShaderSource","getSupportedExtensions","getTexParameter","getUniform","getUniformLocation","getVertexAttrib","getVertexAttribOffset","hint","isBuffer","isEnabled","isFramebuffer","isProgram","isRenderbuffer","isShader","isTexture","lineWidth","linkProgram","pixelStorei","polygonOffset","readPixels","renderbufferStorage","sampleCoverage","scissor","shaderSource","stencilFunc","stencilFuncSeparate","stencilMask","stencilMaskSeparate","stencilOp","stencilOpSeparate","texImage2D","texParameterf","texParameteri","texSubImage2D","uniform1f","uniform1fv","uniform1i","uniform1iv","uniform2f","uniform2fv","uniform2i","uniform2iv","uniform3f","uniform3fv","uniform3i","uniform3iv","uniform4f","uniform4fv","uniform4i","uniform4iv","uniformMatrix2fv","uniformMatrix3fv","uniformMatrix4fv","useProgram","validateProgram","vertexAttrib1f","vertexAttrib1fv","vertexAttrib2f","vertexAttrib2fv","vertexAttrib3f","vertexAttrib3fv","vertexAttrib4f","vertexAttrib4fv","vertexAttribPointer","viewport"]

Go to or download https://raw.githubusercontent.com/stackgl/headless-gl/master/src/bindings.cc

var tofind = OUR_ARRAY_FROM_BEFORE;

var tofindTests = tofind.map(function(method){ return new RegExp("[\"\\(]"+method+"[\"\\)]") });

var lines = document.body.firstChild.textContent.split('\n');

var unhandledMethods = tofind.filter(function(method, i){
  return !lines.some(tofindTests[i].test.bind(tofindTests[i]));
});

var handledMethods = tofind.filter(function(method, i){
  return lines.some(tofindTests[i].test.bind(tofindTests[i]));
})

Anti-aliasing support

It looks like Browser anti-alias by default, while the antialiasing parameters given at context creation does not impact the rendering.

Adding a screen-shot that compares a Chrome render with a slightly jagged headless-gl render.

screen shot 2015-09-14 at 8 48 25 am

It's unclear to me what should be done, there might be fixes needed in multiple areas, maybe the only fix needs to be on the user side by calling glEnagle(gl.MULTI_SAMPLE) or something, and I don't know if the GL context needs something special as well.

There are workaround too, such as some GLSL post-processing, but if we can get this for free that would be much easier. Some googling led me to this -> https://github.com/mattdesl/glsl-fxaa

node-pre-gyp binaries

2.0.0 requires an extremely long build due to the ANGLE dep (which is bad both for local installs and CI). We need to prebuild the binaries for a few common platforms (Node 0.12 for OS X and Linux in particular) and set them up through https://github.com/mapbox/node-pre-gyp for fast installs.

Opengl linking errors on windows

The addon is not built on windows out of the box. If you try to build it with vs2013 x64 like this:

npm i gl --msvs_version=2013

You'll get a lot of opengl linker errors, what's the missing dependency? The readme states is just python2.7 and visual studio, both of them are satisfied

webgl.obj : error LNK2001: unresolved external symbol __imp_glDeleteTextures
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetIntegerv
webgl.obj : error LNK2001: unresolved external symbol __imp_glDepthFunc
webgl.obj : error LNK2001: unresolved external symbol __imp_glClear
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetBooleanv
webgl.obj : error LNK2001: unresolved external symbol __imp_glShaderSource
webgl.obj : error LNK2001: unresolved external symbol __imp_glClearColor
webgl.obj : error LNK2001: unresolved external symbol __imp_glCreateProgram
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetShaderiv
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetShaderSource
webgl.obj : error LNK2001: unresolved external symbol __imp_glCheckFramebufferStatus
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetFramebufferAttachmentParameteriv
webgl.obj : error LNK2001: unresolved external symbol __imp_glDrawElements
webgl.obj : error LNK2001: unresolved external symbol __imp_glTexSubImage2D
webgl.obj : error LNK2001: unresolved external symbol __imp_eglDestroyContext
webgl.obj : error LNK2001: unresolved external symbol __imp_glIsShader
webgl.obj : error LNK2001: unresolved external symbol __imp_glGenRenderbuffers
webgl.obj : error LNK2001: unresolved external symbol __imp_glTexParameterf
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetVertexAttribiv
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniformMatrix4fv
webgl.obj : error LNK2001: unresolved external symbol __imp_glColorMask
webgl.obj : error LNK2001: unresolved external symbol __imp_glScissor
webgl.obj : error LNK2001: unresolved external symbol __imp_glDeleteShader
webgl.obj : error LNK2001: unresolved external symbol __imp_glVertexAttrib1f
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniform1i
webgl.obj : error LNK2001: unresolved external symbol __imp_glGenBuffers
webgl.obj : error LNK2001: unresolved external symbol __imp_glPixelStorei
webgl.obj : error LNK2001: unresolved external symbol __imp_glBlendFuncSeparate
webgl.obj : error LNK2001: unresolved external symbol __imp_glVertexAttrib3f
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetShaderInfoLog
webgl.obj : error LNK2001: unresolved external symbol __imp_glIsEnabled
webgl.obj : error LNK2001: unresolved external symbol __imp_glDetachShader
webgl.obj : error LNK2001: unresolved external symbol __imp_glUseProgram
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniformMatrix3fv
webgl.obj : error LNK2001: unresolved external symbol __imp_glActiveTexture
webgl.obj : error LNK2001: unresolved external symbol __imp_glFinish
webgl.obj : error LNK2001: unresolved external symbol __imp_glBindBuffer
webgl.obj : error LNK2001: unresolved external symbol __imp_glBindTexture
webgl.obj : error LNK2001: unresolved external symbol __imp_glVertexAttrib2f
webgl.obj : error LNK2001: unresolved external symbol __imp_glPolygonOffset
webgl.obj : error LNK2001: unresolved external symbol __imp_eglMakeCurrent
webgl.obj : error LNK2001: unresolved external symbol __imp_glDisableVertexAttribArray
webgl.obj : error LNK2001: unresolved external symbol __imp_eglInitialize
webgl.obj : error LNK2001: unresolved external symbol __imp_eglChooseConfig
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetAttachedShaders
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniform3f
webgl.obj : error LNK2001: unresolved external symbol __imp_glLinkProgram
webgl.obj : error LNK2001: unresolved external symbol __imp_glTexImage2D
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetError
webgl.obj : error LNK2001: unresolved external symbol __imp_glStencilOpSeparate
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniform4i
webgl.obj : error LNK2001: unresolved external symbol __imp_glSampleCoverage
webgl.obj : error LNK2001: unresolved external symbol __imp_glDisable
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetRenderbufferParameteriv
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetString
webgl.obj : error LNK2001: unresolved external symbol __imp_glVertexAttribPointer
webgl.obj : error LNK2001: unresolved external symbol __imp_glDrawArrays
webgl.obj : error LNK2001: unresolved external symbol __imp_glCreateShader
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniform2i
webgl.obj : error LNK2001: unresolved external symbol __imp_glDepthMask
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetVertexAttribfv
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetTexParameteriv
webgl.obj : error LNK2001: unresolved external symbol __imp_glCopyTexSubImage2D
webgl.obj : error LNK2001: unresolved external symbol __imp_glFramebufferTexture2D
webgl.obj : error LNK2001: unresolved external symbol __imp_glEnableVertexAttribArray
webgl.obj : error LNK2001: unresolved external symbol __imp_glTexParameteri
webgl.obj : error LNK2001: unresolved external symbol __imp_glVertexAttrib4f
webgl.obj : error LNK2001: unresolved external symbol __imp_glCopyTexImage2D
webgl.obj : error LNK2001: unresolved external symbol __imp_glClearStencil
webgl.obj : error LNK2001: unresolved external symbol __imp_glBindRenderbuffer
webgl.obj : error LNK2001: unresolved external symbol __imp_glReadPixels
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetFloatv
webgl.obj : error LNK2001: unresolved external symbol __imp_glGenFramebuffers
webgl.obj : error LNK2001: unresolved external symbol __imp_glIsRenderbuffer
webgl.obj : error LNK2001: unresolved external symbol __imp_glBindFramebuffer
webgl.obj : error LNK2001: unresolved external symbol __imp_glStencilFunc
webgl.obj : error LNK2001: unresolved external symbol __imp_eglCreatePbufferSurface
webgl.obj : error LNK2001: unresolved external symbol __imp_glGenerateMipmap
webgl.obj : error LNK2001: unresolved external symbol __imp_glBlendFunc
webgl.obj : error LNK2001: unresolved external symbol __imp_glStencilMask
webgl.obj : error LNK2001: unresolved external symbol __imp_glCullFace
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetActiveUniform
webgl.obj : error LNK2001: unresolved external symbol __imp_glBufferSubData
webgl.obj : error LNK2001: unresolved external symbol __imp_glCompileShader
webgl.obj : error LNK2001: unresolved external symbol __imp_glStencilFuncSeparate
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniform3i
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetAttribLocation
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniform2f
webgl.obj : error LNK2001: unresolved external symbol __imp_glDepthRangef
webgl.obj : error LNK2001: unresolved external symbol __imp_glBlendColor
webgl.obj : error LNK2001: unresolved external symbol __imp_glIsBuffer
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetProgramInfoLog
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetVertexAttribPointerv
webgl.obj : error LNK2001: unresolved external symbol __imp_glViewport
webgl.obj : error LNK2001: unresolved external symbol __imp_glIsTexture
webgl.obj : error LNK2001: unresolved external symbol __imp_eglCreateContext
webgl.obj : error LNK2001: unresolved external symbol __imp_glDeleteProgram
webgl.obj : error LNK2001: unresolved external symbol __imp_glFramebufferRenderbuffer
webgl.obj : error LNK2001: unresolved external symbol __imp_glAttachShader
webgl.obj : error LNK2001: unresolved external symbol __imp_glIsFramebuffer
webgl.obj : error LNK2001: unresolved external symbol __imp_glLineWidth
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetShaderPrecisionFormat
webgl.obj : error LNK2001: unresolved external symbol __imp_eglTerminate
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniform4f
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetUniformfv
webgl.obj : error LNK2001: unresolved external symbol __imp_glIsProgram
webgl.obj : error LNK2001: unresolved external symbol __imp_glBufferData
webgl.obj : error LNK2001: unresolved external symbol __imp_glDeleteRenderbuffers
webgl.obj : error LNK2001: unresolved external symbol __imp_glClearDepthf
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetUniformLocation
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetBufferParameteriv
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniform1f
webgl.obj : error LNK2001: unresolved external symbol __imp_glStencilOp
webgl.obj : error LNK2001: unresolved external symbol __imp_glBlendEquationSeparate
webgl.obj : error LNK2001: unresolved external symbol __imp_glEnable
webgl.obj : error LNK2001: unresolved external symbol __imp_glDeleteFramebuffers
webgl.obj : error LNK2001: unresolved external symbol __imp_eglGetDisplay
webgl.obj : error LNK2001: unresolved external symbol __imp_glDeleteBuffers
webgl.obj : error LNK2001: unresolved external symbol __imp_glFrontFace
webgl.obj : error LNK2001: unresolved external symbol __imp_glFlush
webgl.obj : error LNK2001: unresolved external symbol __imp_glStencilMaskSeparate
webgl.obj : error LNK2001: unresolved external symbol __imp_glGenTextures
webgl.obj : error LNK2001: unresolved external symbol __imp_glRenderbufferStorage
webgl.obj : error LNK2001: unresolved external symbol __imp_glBlendEquation
webgl.obj : error LNK2001: unresolved external symbol __imp_glValidateProgram
webgl.obj : error LNK2001: unresolved external symbol __imp_glHint
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetActiveAttrib
webgl.obj : error LNK2001: unresolved external symbol __imp_glGetProgramiv
webgl.obj : error LNK2001: unresolved external symbol __imp_glUniformMatrix2fv
webgl.obj : error LNK2001: unresolved external symbol __imp_glBindAttribLocation

Creating a window

What is involved in creating a window to render to? Do I do it through an angle call?

building on the raspberry pi rasbian jessie

Trying to install it on a raspberry pi with rasbian jessie installed and getting the below error.
It's failing to compile the libAngle library but it looks like that is for converting from opengl es to directx which doesn't make sense for linux. I'm probably wrong :)

Entire output:

$ npm install gl
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
/
> [email protected] install /home/abrown28/svg2txt/node_modules/gl
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
make: Entering directory '/home/abrown28/svg2txt/node_modules/gl/build'
  CXX(target) Release/obj.target/angle_common/angle/src/common/Float16ToFloat32.o
  CXX(target) Release/obj.target/angle_common/angle/src/common/MemoryBuffer.o
  CXX(target) Release/obj.target/angle_common/angle/src/common/angleutils.o
  CXX(target) Release/obj.target/angle_common/angle/src/common/debug.o
  CXX(target) Release/obj.target/angle_common/angle/src/common/mathutil.o
../angle/src/common/mathutil.cpp: In function ‘unsigned int gl::convertRGBFloatsTo999E5(float, float, float)’:
../angle/src/common/mathutil.cpp:55:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     return *reinterpret_cast<unsigned int*>(&output);

  CXX(target) Release/obj.target/angle_common/angle/src/common/string_utils.o
  CXX(target) Release/obj.target/angle_common/angle/src/common/tls.o
  CXX(target) Release/obj.target/angle_common/angle/src/common/utilities.o
  AR(target) Release/obj.target/angle/src/angle_common.a
  COPY Release/angle_common.a
  COPY Release/obj/gen/angle/id/commit.h
  TOUCH Release/obj.target/angle/src/commit_id.stamp
  CXX(target) Release/obj.target/libANGLE/angle/src/common/event_tracer.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/AttributeMap.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Buffer.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Caps.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Compiler.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Config.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Context.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Data.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Device.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Display.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Error.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Fence.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Framebuffer.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/FramebufferAttachment.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/HandleAllocator.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Image.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/ImageIndex.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/IndexRangeCache.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Platform.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Program.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Query.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/RefCountObject.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Renderbuffer.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/ResourceManager.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Sampler.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Shader.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/State.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Surface.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Texture.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/TransformFeedback.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Uniform.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/VertexArray.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/VertexAttribute.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/angletypes.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/formatutils.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/queryconversions.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/DeviceImpl.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/DisplayImpl.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/ProgramImpl.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/Renderer.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/SurfaceImpl.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/validationEGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/validationES.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/validationES2.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/validationES3.o
  CXX(target) Release/obj.target/libANGLE/angle/src/third_party/murmurhash/MurmurHash3.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/BufferGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/CompilerGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/DisplayGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/FenceNVGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/FenceSyncGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/FramebufferGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/FunctionsGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/ProgramGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/QueryGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/RenderbufferGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/RendererGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/ShaderGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/StateManagerGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/SurfaceGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/TextureGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/TransformFeedbackGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/VertexArrayGL.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/formatutilsgl.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/renderergl_utils.o
  CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/glx/DisplayGLX.o
../angle/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp: In member function ‘virtual egl::Error rx::DisplayGLX::initialize(egl::Display*)’:
../angle/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp:134:49: error: ‘contextConfig’ was not declared in this scope
         mContext = mGLX.createContextAttribsARB(contextConfig, nullptr, True, nullptr);

../angle/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp:137:42: error: ‘contextConfig’ was not declared in this scope
         mContext = mGLX.createNewContext(contextConfig, GLX_RGBA_TYPE, nullptr, True);

../angle/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp:155:9: warning: unused variable ‘pbufferAttribs’ [-Wunused-variable]
     int pbufferAttribs[] = { 0 };

angle/src/libANGLE.target.mk:207: recipe for target 'Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/glx/DisplayGLX.o' failed
make: *** [Release/obj.target/libANGLE/angle/src/libANGLE/renderer/gl/glx/DisplayGLX.o] Error 1
make: Leaving directory '/home/abrown28/svg2txt/node_modules/gl/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 4.1.6-v7+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/abrown28/svg2txt/node_modules/gl
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 4.1.6-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "gl"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the gl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls gl
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/abrown28/svg2txt/npm-debug.log

does not seem to be node 6 compatible?

after updating to node 6 I get this:

> [email protected] install /Users/makc/Desktop/xxxxxxx/3d/node_modules/gl
> prebuild --install

prebuild WARN install No prebuilt binaries found (target=v6.0.0 arch=x64 platform=darwin)
gyp: angle/build/standalone.gypi not found (cwd: /Users/makc/Desktop/xxxxxxx/3d/node_modules/gl) while reading includes of angle/src/angle.gyp while loading dependencies of binding.gyp while trying to load binding.gyp
prebuild ERR! configure error 
prebuild ERR! stack Error: `gyp` failed with exit code: 1
prebuild ERR! stack     at ChildProcess.onCpExit (/Users/makc/Desktop/xxxxxxx/3d/node_modules/node-gyp/lib/configure.js:305:16)
prebuild ERR! stack     at emitTwo (events.js:106:13)
prebuild ERR! stack     at ChildProcess.emit (events.js:191:7)
prebuild ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
prebuild ERR! not ok 

is this even fixable on my end?

Syntax error for precision

Hi, i try to adapt the three.js library to your ambitious project (really really cool).
I don't know if the adaptation is possible, but it could offer a precious help for the webgl community for the Three.js scene server side rendering.
After fixing variables and headless stuff issues, i got an error during the shader compilation which look like to :
'precision' : syntax error: syntax error

Do you have an idea about that ?
I searched by my side, but i found nothing 😞

Thans for all :bowtie:

New Linux crashes

Currently have a bunch of new bugs on Linux after upgrading ANGLE. Need to sort out what is going on, but many of the tricky test cases are crashing now.

compile fails on ubuntu

running in virtualbox with 3d acceleration setup

gedw@gedw-VirtualBox:/_data/headlesswebgl$ ls
gedw@gedw-VirtualBox:
/_data/headlesswebgl$ npm install gl
npm http GET https://registry.npmjs.org/gl
npm http 200 https://registry.npmjs.org/gl
npm http GET https://registry.npmjs.org/gl/-/gl-0.0.2.tgz
npm http 200 https://registry.npmjs.org/gl/-/gl-0.0.2.tgz

[email protected] install /home/gedw/_data/headlesswebgl/node_modules/gl
node-gyp rebuild

gyp http GET http://nodejs.org/dist/v0.10.13/node-v0.10.13.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.13/node-v0.10.13.tar.gz
make: Entering directory /home/gedw/_data/headlesswebgl/node_modules/gl/build' CXX(target) Release/obj.target/webgl/src/bindings.o In file included from ../src/bindings.cc:15:0: ../src/webgl.h:32:3: error: ‘GLuint’ does not name a type ../src/webgl.h:33:28: error: ‘GLuint’ has not been declared ../src/webgl.h: In constructor ‘GLObj::GLObj(GLObjectType, int)’: ../src/webgl.h:35:11: error: ‘struct GLObj’ has no member named ‘obj’ ../src/webgl.h: At global scope: ../src/webgl.h:45:3: error: ‘GL_CONTEXT_TYPE’ does not name a type ../src/webgl.h:48:41: error: ‘GLuint’ has not been declared ../src/webgl.h:49:24: error: ‘GLuint’ has not been declared ../src/bindings.cc: In function ‘void init(v8::Handle<v8::Object>)’: ../src/bindings.cc:187:3: error: ‘GL_DEPTH_BUFFER_BIT’ was not declared in this scope ../src/bindings.cc:188:3: error: ‘GL_STENCIL_BUFFER_BIT’ was not declared in this scope ../src/bindings.cc:189:3: error: ‘GL_COLOR_BUFFER_BIT’ was not declared in this scope ../src/bindings.cc:192:3: error: ‘GL_FALSE’ was not declared in this scope ../src/bindings.cc:193:3: error: ‘GL_TRUE’ was not declared in this scope ../src/bindings.cc:196:3: error: ‘GL_POINTS’ was not declared in this scope ../src/bindings.cc:197:3: error: ‘GL_LINES’ was not declared in this scope ../src/bindings.cc:198:3: error: ‘GL_LINE_LOOP’ was not declared in this scope ../src/bindings.cc:199:3: error: ‘GL_LINE_STRIP’ was not declared in this scope ../src/bindings.cc:200:3: error: ‘GL_TRIANGLES’ was not declared in this scope ../src/bindings.cc:201:3: error: ‘GL_TRIANGLE_STRIP’ was not declared in this scope ../src/bindings.cc:202:3: error: ‘GL_TRIANGLE_FAN’ was not declared in this scope ../src/bindings.cc:215:3: error: ‘GL_ZERO’ was not declared in this scope ../src/bindings.cc:216:3: error: ‘GL_ONE’ was not declared in this scope ../src/bindings.cc:217:3: error: ‘GL_SRC_COLOR’ was not declared in this scope ../src/bindings.cc:218:3: error: ‘GL_ONE_MINUS_SRC_COLOR’ was not declared in this scope ../src/bindings.cc:219:3: error: ‘GL_SRC_ALPHA’ was not declared in this scope ../src/bindings.cc:220:3: error: ‘GL_ONE_MINUS_SRC_ALPHA’ was not declared in this scope ../src/bindings.cc:221:3: error: ‘GL_DST_ALPHA’ was not declared in this scope ../src/bindings.cc:222:3: error: ‘GL_ONE_MINUS_DST_ALPHA’ was not declared in this scope ../src/bindings.cc:227:3: error: ‘GL_DST_COLOR’ was not declared in this scope ../src/bindings.cc:228:3: error: ‘GL_ONE_MINUS_DST_COLOR’ was not declared in this scope ../src/bindings.cc:229:3: error: ‘GL_SRC_ALPHA_SATURATE’ was not declared in this scope ../src/bindings.cc:236:3: error: ‘GL_FUNC_ADD’ was not declared in this scope ../src/bindings.cc:237:3: error: ‘GL_BLEND_EQUATION’ was not declared in this scope ../src/bindings.cc:238:3: error: ‘GL_BLEND_EQUATION_RGB’ was not declared in this scope ../src/bindings.cc:239:3: error: ‘GL_BLEND_EQUATION_ALPHA’ was not declared in this scope ../src/bindings.cc:242:3: error: ‘GL_FUNC_SUBTRACT’ was not declared in this scope ../src/bindings.cc:243:3: error: ‘GL_FUNC_REVERSE_SUBTRACT’ was not declared in this scope ../src/bindings.cc:246:3: error: ‘GL_BLEND_DST_RGB’ was not declared in this scope ../src/bindings.cc:247:3: error: ‘GL_BLEND_SRC_RGB’ was not declared in this scope ../src/bindings.cc:248:3: error: ‘GL_BLEND_DST_ALPHA’ was not declared in this scope ../src/bindings.cc:249:3: error: ‘GL_BLEND_SRC_ALPHA’ was not declared in this scope ../src/bindings.cc:250:3: error: ‘GL_CONSTANT_COLOR’ was not declared in this scope ../src/bindings.cc:251:3: error: ‘GL_ONE_MINUS_CONSTANT_COLOR’ was not declared in this scope ../src/bindings.cc:252:3: error: ‘GL_CONSTANT_ALPHA’ was not declared in this scope ../src/bindings.cc:253:3: error: ‘GL_ONE_MINUS_CONSTANT_ALPHA’ was not declared in this scope ../src/bindings.cc:254:3: error: ‘GL_BLEND_COLOR’ was not declared in this scope ../src/bindings.cc:257:3: error: ‘GL_ARRAY_BUFFER’ was not declared in this scope ../src/bindings.cc:258:3: error: ‘GL_ELEMENT_ARRAY_BUFFER’ was not declared in this scope ../src/bindings.cc:259:3: error: ‘GL_ARRAY_BUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:260:3: error: ‘GL_ELEMENT_ARRAY_BUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:262:3: error: ‘GL_STREAM_DRAW’ was not declared in this scope ../src/bindings.cc:263:3: error: ‘GL_STATIC_DRAW’ was not declared in this scope ../src/bindings.cc:264:3: error: ‘GL_DYNAMIC_DRAW’ was not declared in this scope ../src/bindings.cc:266:3: error: ‘GL_BUFFER_SIZE’ was not declared in this scope ../src/bindings.cc:267:3: error: ‘GL_BUFFER_USAGE’ was not declared in this scope ../src/bindings.cc:269:3: error: ‘GL_CURRENT_VERTEX_ATTRIB’ was not declared in this scope ../src/bindings.cc:272:3: error: ‘GL_FRONT’ was not declared in this scope ../src/bindings.cc:273:3: error: ‘GL_BACK’ was not declared in this scope ../src/bindings.cc:274:3: error: ‘GL_FRONT_AND_BACK’ was not declared in this scope ../src/bindings.cc:287:3: error: ‘GL_TEXTURE_2D’ was not declared in this scope ../src/bindings.cc:288:3: error: ‘GL_CULL_FACE’ was not declared in this scope ../src/bindings.cc:289:3: error: ‘GL_BLEND’ was not declared in this scope ../src/bindings.cc:290:3: error: ‘GL_DITHER’ was not declared in this scope ../src/bindings.cc:291:3: error: ‘GL_STENCIL_TEST’ was not declared in this scope ../src/bindings.cc:292:3: error: ‘GL_DEPTH_TEST’ was not declared in this scope ../src/bindings.cc:293:3: error: ‘GL_SCISSOR_TEST’ was not declared in this scope ../src/bindings.cc:294:3: error: ‘GL_POLYGON_OFFSET_FILL’ was not declared in this scope ../src/bindings.cc:295:3: error: ‘GL_SAMPLE_ALPHA_TO_COVERAGE’ was not declared in this scope ../src/bindings.cc:296:3: error: ‘GL_SAMPLE_COVERAGE’ was not declared in this scope ../src/bindings.cc:299:3: error: ‘GL_NO_ERROR’ was not declared in this scope ../src/bindings.cc:300:3: error: ‘GL_INVALID_ENUM’ was not declared in this scope ../src/bindings.cc:301:3: error: ‘GL_INVALID_VALUE’ was not declared in this scope ../src/bindings.cc:302:3: error: ‘GL_INVALID_OPERATION’ was not declared in this scope ../src/bindings.cc:303:3: error: ‘GL_OUT_OF_MEMORY’ was not declared in this scope ../src/bindings.cc:306:3: error: ‘GL_CW’ was not declared in this scope ../src/bindings.cc:307:3: error: ‘GL_CCW’ was not declared in this scope ../src/bindings.cc:310:3: error: ‘GL_LINE_WIDTH’ was not declared in this scope ../src/bindings.cc:311:3: error: ‘GL_ALIASED_POINT_SIZE_RANGE’ was not declared in this scope ../src/bindings.cc:312:3: error: ‘GL_ALIASED_LINE_WIDTH_RANGE’ was not declared in this scope ../src/bindings.cc:313:3: error: ‘GL_CULL_FACE_MODE’ was not declared in this scope ../src/bindings.cc:314:3: error: ‘GL_FRONT_FACE’ was not declared in this scope ../src/bindings.cc:315:3: error: ‘GL_DEPTH_RANGE’ was not declared in this scope ../src/bindings.cc:316:3: error: ‘GL_DEPTH_WRITEMASK’ was not declared in this scope ../src/bindings.cc:317:3: error: ‘GL_DEPTH_CLEAR_VALUE’ was not declared in this scope ../src/bindings.cc:318:3: error: ‘GL_DEPTH_FUNC’ was not declared in this scope ../src/bindings.cc:319:3: error: ‘GL_STENCIL_CLEAR_VALUE’ was not declared in this scope ../src/bindings.cc:320:3: error: ‘GL_STENCIL_FUNC’ was not declared in this scope ../src/bindings.cc:321:3: error: ‘GL_STENCIL_FAIL’ was not declared in this scope ../src/bindings.cc:322:3: error: ‘GL_STENCIL_PASS_DEPTH_FAIL’ was not declared in this scope ../src/bindings.cc:323:3: error: ‘GL_STENCIL_PASS_DEPTH_PASS’ was not declared in this scope ../src/bindings.cc:324:3: error: ‘GL_STENCIL_REF’ was not declared in this scope ../src/bindings.cc:325:3: error: ‘GL_STENCIL_VALUE_MASK’ was not declared in this scope ../src/bindings.cc:326:3: error: ‘GL_STENCIL_WRITEMASK’ was not declared in this scope ../src/bindings.cc:327:3: error: ‘GL_STENCIL_BACK_FUNC’ was not declared in this scope ../src/bindings.cc:328:3: error: ‘GL_STENCIL_BACK_FAIL’ was not declared in this scope ../src/bindings.cc:329:3: error: ‘GL_STENCIL_BACK_PASS_DEPTH_FAIL’ was not declared in this scope ../src/bindings.cc:330:3: error: ‘GL_STENCIL_BACK_PASS_DEPTH_PASS’ was not declared in this scope ../src/bindings.cc:331:3: error: ‘GL_STENCIL_BACK_REF’ was not declared in this scope ../src/bindings.cc:332:3: error: ‘GL_STENCIL_BACK_VALUE_MASK’ was not declared in this scope ../src/bindings.cc:333:3: error: ‘GL_STENCIL_BACK_WRITEMASK’ was not declared in this scope ../src/bindings.cc:334:3: error: ‘GL_VIEWPORT’ was not declared in this scope ../src/bindings.cc:335:3: error: ‘GL_SCISSOR_BOX’ was not declared in this scope ../src/bindings.cc:337:3: error: ‘GL_COLOR_CLEAR_VALUE’ was not declared in this scope ../src/bindings.cc:338:3: error: ‘GL_COLOR_WRITEMASK’ was not declared in this scope ../src/bindings.cc:339:3: error: ‘GL_UNPACK_ALIGNMENT’ was not declared in this scope ../src/bindings.cc:340:3: error: ‘GL_PACK_ALIGNMENT’ was not declared in this scope ../src/bindings.cc:341:3: error: ‘GL_MAX_TEXTURE_SIZE’ was not declared in this scope ../src/bindings.cc:342:3: error: ‘GL_MAX_VIEWPORT_DIMS’ was not declared in this scope ../src/bindings.cc:343:3: error: ‘GL_SUBPIXEL_BITS’ was not declared in this scope ../src/bindings.cc:344:3: error: ‘GL_RED_BITS’ was not declared in this scope ../src/bindings.cc:345:3: error: ‘GL_GREEN_BITS’ was not declared in this scope ../src/bindings.cc:346:3: error: ‘GL_BLUE_BITS’ was not declared in this scope ../src/bindings.cc:347:3: error: ‘GL_ALPHA_BITS’ was not declared in this scope ../src/bindings.cc:348:3: error: ‘GL_DEPTH_BITS’ was not declared in this scope ../src/bindings.cc:349:3: error: ‘GL_STENCIL_BITS’ was not declared in this scope ../src/bindings.cc:350:3: error: ‘GL_POLYGON_OFFSET_UNITS’ was not declared in this scope ../src/bindings.cc:352:3: error: ‘GL_POLYGON_OFFSET_FACTOR’ was not declared in this scope ../src/bindings.cc:353:3: error: ‘GL_TEXTURE_BINDING_2D’ was not declared in this scope ../src/bindings.cc:354:3: error: ‘GL_SAMPLE_BUFFERS’ was not declared in this scope ../src/bindings.cc:355:3: error: ‘GL_SAMPLES’ was not declared in this scope ../src/bindings.cc:356:3: error: ‘GL_SAMPLE_COVERAGE_VALUE’ was not declared in this scope ../src/bindings.cc:357:3: error: ‘GL_SAMPLE_COVERAGE_INVERT’ was not declared in this scope ../src/bindings.cc:365:3: error: ‘GL_NUM_COMPRESSED_TEXTURE_FORMATS’ was not declared in this scope ../src/bindings.cc:366:3: error: ‘GL_COMPRESSED_TEXTURE_FORMATS’ was not declared in this scope ../src/bindings.cc:369:3: error: ‘GL_DONT_CARE’ was not declared in this scope ../src/bindings.cc:370:3: error: ‘GL_FASTEST’ was not declared in this scope ../src/bindings.cc:371:3: error: ‘GL_NICEST’ was not declared in this scope ../src/bindings.cc:374:3: error: ‘GL_GENERATE_MIPMAP_HINT’ was not declared in this scope ../src/bindings.cc:377:3: error: ‘GL_BYTE’ was not declared in this scope ../src/bindings.cc:378:3: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope ../src/bindings.cc:379:3: error: ‘GL_SHORT’ was not declared in this scope ../src/bindings.cc:380:3: error: ‘GL_UNSIGNED_SHORT’ was not declared in this scope ../src/bindings.cc:381:3: error: ‘GL_INT’ was not declared in this scope ../src/bindings.cc:382:3: error: ‘GL_UNSIGNED_INT’ was not declared in this scope ../src/bindings.cc:383:3: error: ‘GL_FLOAT’ was not declared in this scope ../src/bindings.cc:385:3: error: ‘GL_FIXED’ was not declared in this scope ../src/bindings.cc:389:3: error: ‘GL_DEPTH_COMPONENT’ was not declared in this scope ../src/bindings.cc:390:3: error: ‘GL_ALPHA’ was not declared in this scope ../src/bindings.cc:391:3: error: ‘GL_RGB’ was not declared in this scope ../src/bindings.cc:392:3: error: ‘GL_RGBA’ was not declared in this scope ../src/bindings.cc:393:3: error: ‘GL_LUMINANCE’ was not declared in this scope ../src/bindings.cc:394:3: error: ‘GL_LUMINANCE_ALPHA’ was not declared in this scope ../src/bindings.cc:398:3: error: ‘GL_UNSIGNED_SHORT_4_4_4_4’ was not declared in this scope ../src/bindings.cc:399:3: error: ‘GL_UNSIGNED_SHORT_5_5_5_1’ was not declared in this scope ../src/bindings.cc:400:3: error: ‘GL_UNSIGNED_SHORT_5_6_5’ was not declared in this scope ../src/bindings.cc:403:3: error: ‘GL_FRAGMENT_SHADER’ was not declared in this scope ../src/bindings.cc:404:3: error: ‘GL_VERTEX_SHADER’ was not declared in this scope ../src/bindings.cc:405:3: error: ‘GL_MAX_VERTEX_ATTRIBS’ was not declared in this scope ../src/bindings.cc:407:3: error: ‘GL_MAX_VERTEX_UNIFORM_VECTORS’ was not declared in this scope ../src/bindings.cc:408:3: error: ‘GL_MAX_VARYING_VECTORS’ was not declared in this scope ../src/bindings.cc:410:3: error: ‘GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS’ was not declared in this scope ../src/bindings.cc:411:3: error: ‘GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS’ was not declared in this scope ../src/bindings.cc:412:3: error: ‘GL_MAX_TEXTURE_IMAGE_UNITS’ was not declared in this scope ../src/bindings.cc:414:3: error: ‘GL_MAX_FRAGMENT_UNIFORM_VECTORS’ was not declared in this scope ../src/bindings.cc:416:3: error: ‘GL_SHADER_TYPE’ was not declared in this scope ../src/bindings.cc:417:3: error: ‘GL_DELETE_STATUS’ was not declared in this scope ../src/bindings.cc:418:3: error: ‘GL_LINK_STATUS’ was not declared in this scope ../src/bindings.cc:419:3: error: ‘GL_VALIDATE_STATUS’ was not declared in this scope ../src/bindings.cc:420:3: error: ‘GL_ATTACHED_SHADERS’ was not declared in this scope ../src/bindings.cc:421:3: error: ‘GL_ACTIVE_UNIFORMS’ was not declared in this scope ../src/bindings.cc:422:3: error: ‘GL_ACTIVE_UNIFORM_MAX_LENGTH’ was not declared in this scope ../src/bindings.cc:423:3: error: ‘GL_ACTIVE_ATTRIBUTES’ was not declared in this scope ../src/bindings.cc:424:3: error: ‘GL_ACTIVE_ATTRIBUTE_MAX_LENGTH’ was not declared in this scope ../src/bindings.cc:425:3: error: ‘GL_SHADING_LANGUAGE_VERSION’ was not declared in this scope ../src/bindings.cc:426:3: error: ‘GL_CURRENT_PROGRAM’ was not declared in this scope ../src/bindings.cc:429:3: error: ‘GL_NEVER’ was not declared in this scope ../src/bindings.cc:430:3: error: ‘GL_LESS’ was not declared in this scope ../src/bindings.cc:431:3: error: ‘GL_EQUAL’ was not declared in this scope ../src/bindings.cc:432:3: error: ‘GL_LEQUAL’ was not declared in this scope ../src/bindings.cc:433:3: error: ‘GL_GREATER’ was not declared in this scope ../src/bindings.cc:434:3: error: ‘GL_NOTEQUAL’ was not declared in this scope ../src/bindings.cc:435:3: error: ‘GL_GEQUAL’ was not declared in this scope ../src/bindings.cc:436:3: error: ‘GL_ALWAYS’ was not declared in this scope ../src/bindings.cc:440:3: error: ‘GL_KEEP’ was not declared in this scope ../src/bindings.cc:441:3: error: ‘GL_REPLACE’ was not declared in this scope ../src/bindings.cc:442:3: error: ‘GL_INCR’ was not declared in this scope ../src/bindings.cc:443:3: error: ‘GL_DECR’ was not declared in this scope ../src/bindings.cc:444:3: error: ‘GL_INVERT’ was not declared in this scope ../src/bindings.cc:445:3: error: ‘GL_INCR_WRAP’ was not declared in this scope ../src/bindings.cc:446:3: error: ‘GL_DECR_WRAP’ was not declared in this scope ../src/bindings.cc:449:3: error: ‘GL_VENDOR’ was not declared in this scope ../src/bindings.cc:450:3: error: ‘GL_RENDERER’ was not declared in this scope ../src/bindings.cc:451:3: error: ‘GL_VERSION’ was not declared in this scope ../src/bindings.cc:452:3: error: ‘GL_EXTENSIONS’ was not declared in this scope ../src/bindings.cc:455:3: error: ‘GL_NEAREST’ was not declared in this scope ../src/bindings.cc:456:3: error: ‘GL_LINEAR’ was not declared in this scope ../src/bindings.cc:461:3: error: ‘GL_NEAREST_MIPMAP_NEAREST’ was not declared in this scope ../src/bindings.cc:462:3: error: ‘GL_LINEAR_MIPMAP_NEAREST’ was not declared in this scope ../src/bindings.cc:463:3: error: ‘GL_NEAREST_MIPMAP_LINEAR’ was not declared in this scope ../src/bindings.cc:464:3: error: ‘GL_LINEAR_MIPMAP_LINEAR’ was not declared in this scope ../src/bindings.cc:467:3: error: ‘GL_TEXTURE_MAG_FILTER’ was not declared in this scope ../src/bindings.cc:468:3: error: ‘GL_TEXTURE_MIN_FILTER’ was not declared in this scope ../src/bindings.cc:469:3: error: ‘GL_TEXTURE_WRAP_S’ was not declared in this scope ../src/bindings.cc:470:3: error: ‘GL_TEXTURE_WRAP_T’ was not declared in this scope ../src/bindings.cc:474:3: error: ‘GL_TEXTURE’ was not declared in this scope ../src/bindings.cc:476:3: error: ‘GL_TEXTURE_CUBE_MAP’ was not declared in this scope ../src/bindings.cc:477:3: error: ‘GL_TEXTURE_BINDING_CUBE_MAP’ was not declared in this scope ../src/bindings.cc:478:3: error: ‘GL_TEXTURE_CUBE_MAP_POSITIVE_X’ was not declared in this scope ../src/bindings.cc:479:3: error: ‘GL_TEXTURE_CUBE_MAP_NEGATIVE_X’ was not declared in this scope ../src/bindings.cc:480:3: error: ‘GL_TEXTURE_CUBE_MAP_POSITIVE_Y’ was not declared in this scope ../src/bindings.cc:481:3: error: ‘GL_TEXTURE_CUBE_MAP_NEGATIVE_Y’ was not declared in this scope ../src/bindings.cc:482:3: error: ‘GL_TEXTURE_CUBE_MAP_POSITIVE_Z’ was not declared in this scope ../src/bindings.cc:483:3: error: ‘GL_TEXTURE_CUBE_MAP_NEGATIVE_Z’ was not declared in this scope ../src/bindings.cc:484:3: error: ‘GL_MAX_CUBE_MAP_TEXTURE_SIZE’ was not declared in this scope ../src/bindings.cc:487:3: error: ‘GL_TEXTURE0’ was not declared in this scope ../src/bindings.cc:488:3: error: ‘GL_TEXTURE1’ was not declared in this scope ../src/bindings.cc:489:3: error: ‘GL_TEXTURE2’ was not declared in this scope ../src/bindings.cc:490:3: error: ‘GL_TEXTURE3’ was not declared in this scope ../src/bindings.cc:491:3: error: ‘GL_TEXTURE4’ was not declared in this scope ../src/bindings.cc:492:3: error: ‘GL_TEXTURE5’ was not declared in this scope ../src/bindings.cc:493:3: error: ‘GL_TEXTURE6’ was not declared in this scope ../src/bindings.cc:494:3: error: ‘GL_TEXTURE7’ was not declared in this scope ../src/bindings.cc:495:3: error: ‘GL_TEXTURE8’ was not declared in this scope ../src/bindings.cc:496:3: error: ‘GL_TEXTURE9’ was not declared in this scope ../src/bindings.cc:497:3: error: ‘GL_TEXTURE10’ was not declared in this scope ../src/bindings.cc:498:3: error: ‘GL_TEXTURE11’ was not declared in this scope ../src/bindings.cc:499:3: error: ‘GL_TEXTURE12’ was not declared in this scope ../src/bindings.cc:500:3: error: ‘GL_TEXTURE13’ was not declared in this scope ../src/bindings.cc:501:3: error: ‘GL_TEXTURE14’ was not declared in this scope ../src/bindings.cc:502:3: error: ‘GL_TEXTURE15’ was not declared in this scope ../src/bindings.cc:503:3: error: ‘GL_TEXTURE16’ was not declared in this scope ../src/bindings.cc:504:3: error: ‘GL_TEXTURE17’ was not declared in this scope ../src/bindings.cc:505:3: error: ‘GL_TEXTURE18’ was not declared in this scope ../src/bindings.cc:506:3: error: ‘GL_TEXTURE19’ was not declared in this scope ../src/bindings.cc:507:3: error: ‘GL_TEXTURE20’ was not declared in this scope ../src/bindings.cc:508:3: error: ‘GL_TEXTURE21’ was not declared in this scope ../src/bindings.cc:509:3: error: ‘GL_TEXTURE22’ was not declared in this scope ../src/bindings.cc:510:3: error: ‘GL_TEXTURE23’ was not declared in this scope ../src/bindings.cc:511:3: error: ‘GL_TEXTURE24’ was not declared in this scope ../src/bindings.cc:512:3: error: ‘GL_TEXTURE25’ was not declared in this scope ../src/bindings.cc:513:3: error: ‘GL_TEXTURE26’ was not declared in this scope ../src/bindings.cc:514:3: error: ‘GL_TEXTURE27’ was not declared in this scope ../src/bindings.cc:515:3: error: ‘GL_TEXTURE28’ was not declared in this scope ../src/bindings.cc:516:3: error: ‘GL_TEXTURE29’ was not declared in this scope ../src/bindings.cc:517:3: error: ‘GL_TEXTURE30’ was not declared in this scope ../src/bindings.cc:518:3: error: ‘GL_TEXTURE31’ was not declared in this scope ../src/bindings.cc:519:3: error: ‘GL_ACTIVE_TEXTURE’ was not declared in this scope ../src/bindings.cc:522:3: error: ‘GL_REPEAT’ was not declared in this scope ../src/bindings.cc:523:3: error: ‘GL_CLAMP_TO_EDGE’ was not declared in this scope ../src/bindings.cc:524:3: error: ‘GL_MIRRORED_REPEAT’ was not declared in this scope ../src/bindings.cc:527:3: error: ‘GL_FLOAT_VEC2’ was not declared in this scope ../src/bindings.cc:528:3: error: ‘GL_FLOAT_VEC3’ was not declared in this scope ../src/bindings.cc:529:3: error: ‘GL_FLOAT_VEC4’ was not declared in this scope ../src/bindings.cc:530:3: error: ‘GL_INT_VEC2’ was not declared in this scope ../src/bindings.cc:531:3: error: ‘GL_INT_VEC3’ was not declared in this scope ../src/bindings.cc:532:3: error: ‘GL_INT_VEC4’ was not declared in this scope ../src/bindings.cc:533:3: error: ‘GL_BOOL’ was not declared in this scope ../src/bindings.cc:534:3: error: ‘GL_BOOL_VEC2’ was not declared in this scope ../src/bindings.cc:535:3: error: ‘GL_BOOL_VEC3’ was not declared in this scope ../src/bindings.cc:536:3: error: ‘GL_BOOL_VEC4’ was not declared in this scope ../src/bindings.cc:537:3: error: ‘GL_FLOAT_MAT2’ was not declared in this scope ../src/bindings.cc:538:3: error: ‘GL_FLOAT_MAT3’ was not declared in this scope ../src/bindings.cc:539:3: error: ‘GL_FLOAT_MAT4’ was not declared in this scope ../src/bindings.cc:540:3: error: ‘GL_SAMPLER_2D’ was not declared in this scope ../src/bindings.cc:541:3: error: ‘GL_SAMPLER_CUBE’ was not declared in this scope ../src/bindings.cc:544:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_ENABLED’ was not declared in this scope ../src/bindings.cc:545:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_SIZE’ was not declared in this scope ../src/bindings.cc:546:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_STRIDE’ was not declared in this scope ../src/bindings.cc:547:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_TYPE’ was not declared in this scope ../src/bindings.cc:548:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_NORMALIZED’ was not declared in this scope ../src/bindings.cc:549:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_POINTER’ was not declared in this scope ../src/bindings.cc:550:3: error: ‘GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:554:3: error: ‘GL_IMPLEMENTATION_COLOR_READ_TYPE’ was not declared in this scope ../src/bindings.cc:555:3: error: ‘GL_IMPLEMENTATION_COLOR_READ_FORMAT’ was not declared in this scope ../src/bindings.cc:559:3: error: ‘GL_COMPILE_STATUS’ was not declared in this scope ../src/bindings.cc:560:3: error: ‘GL_INFO_LOG_LENGTH’ was not declared in this scope ../src/bindings.cc:561:3: error: ‘GL_SHADER_SOURCE_LENGTH’ was not declared in this scope ../src/bindings.cc:563:3: error: ‘GL_SHADER_COMPILER’ was not declared in this scope ../src/bindings.cc:568:3: error: ‘GL_SHADER_BINARY_FORMATS’ was not declared in this scope ../src/bindings.cc:569:3: error: ‘GL_NUM_SHADER_BINARY_FORMATS’ was not declared in this scope ../src/bindings.cc:574:3: error: ‘GL_LOW_FLOAT’ was not declared in this scope ../src/bindings.cc:575:3: error: ‘GL_MEDIUM_FLOAT’ was not declared in this scope ../src/bindings.cc:576:3: error: ‘GL_HIGH_FLOAT’ was not declared in this scope ../src/bindings.cc:577:3: error: ‘GL_LOW_INT’ was not declared in this scope ../src/bindings.cc:578:3: error: ‘GL_MEDIUM_INT’ was not declared in this scope ../src/bindings.cc:579:3: error: ‘GL_HIGH_INT’ was not declared in this scope ../src/bindings.cc:583:3: error: ‘GL_FRAMEBUFFER’ was not declared in this scope ../src/bindings.cc:584:3: error: ‘GL_RENDERBUFFER’ was not declared in this scope ../src/bindings.cc:586:3: error: ‘GL_RGBA4’ was not declared in this scope ../src/bindings.cc:587:3: error: ‘GL_RGB5_A1’ was not declared in this scope ../src/bindings.cc:591:3: error: ‘GL_DEPTH_COMPONENT16’ was not declared in this scope ../src/bindings.cc:592:3: error: ‘GL_STENCIL_INDEX’ was not declared in this scope ../src/bindings.cc:593:3: error: ‘GL_STENCIL_INDEX8’ was not declared in this scope ../src/bindings.cc:595:3: error: ‘GL_RENDERBUFFER_WIDTH’ was not declared in this scope ../src/bindings.cc:596:3: error: ‘GL_RENDERBUFFER_HEIGHT’ was not declared in this scope ../src/bindings.cc:597:3: error: ‘GL_RENDERBUFFER_INTERNAL_FORMAT’ was not declared in this scope ../src/bindings.cc:598:3: error: ‘GL_RENDERBUFFER_RED_SIZE’ was not declared in this scope ../src/bindings.cc:599:3: error: ‘GL_RENDERBUFFER_GREEN_SIZE’ was not declared in this scope ../src/bindings.cc:600:3: error: ‘GL_RENDERBUFFER_BLUE_SIZE’ was not declared in this scope ../src/bindings.cc:601:3: error: ‘GL_RENDERBUFFER_ALPHA_SIZE’ was not declared in this scope ../src/bindings.cc:602:3: error: ‘GL_RENDERBUFFER_DEPTH_SIZE’ was not declared in this scope ../src/bindings.cc:603:3: error: ‘GL_RENDERBUFFER_STENCIL_SIZE’ was not declared in this scope ../src/bindings.cc:605:3: error: ‘GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE’ was not declared in this scope ../src/bindings.cc:606:3: error: ‘GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME’ was not declared in this scope ../src/bindings.cc:607:3: error: ‘GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL’ was not declared in this scope ../src/bindings.cc:608:3: error: ‘GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE’ was not declared in this scope ../src/bindings.cc:610:3: error: ‘GL_COLOR_ATTACHMENT0’ was not declared in this scope ../src/bindings.cc:611:3: error: ‘GL_DEPTH_ATTACHMENT’ was not declared in this scope ../src/bindings.cc:612:3: error: ‘GL_STENCIL_ATTACHMENT’ was not declared in this scope ../src/bindings.cc:614:3: error: ‘GL_NONE’ was not declared in this scope ../src/bindings.cc:616:3: error: ‘GL_FRAMEBUFFER_COMPLETE’ was not declared in this scope ../src/bindings.cc:617:3: error: ‘GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT’ was not declared in this scope ../src/bindings.cc:618:3: error: ‘GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT’ was not declared in this scope ../src/bindings.cc:622:3: error: ‘GL_FRAMEBUFFER_UNSUPPORTED’ was not declared in this scope ../src/bindings.cc:624:3: error: ‘GL_FRAMEBUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:625:3: error: ‘GL_RENDERBUFFER_BINDING’ was not declared in this scope ../src/bindings.cc:626:3: error: ‘GL_MAX_RENDERBUFFER_SIZE’ was not declared in this scope ../src/bindings.cc:628:3: error: ‘GL_INVALID_FRAMEBUFFER_OPERATION’ was not declared in this scope make: *** [Release/obj.target/webgl/src/bindings.o] Error 1 make: Leaving directory/home/gedw/_data/headlesswebgl/node_modules/gl/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.5.0-36-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/gedw/_data/headlesswebgl/node_modules/gl
gyp ERR! node -v v0.10.13
gyp ERR! node-gyp -v v0.10.2
gyp ERR! not ok
unbuild [email protected]
npm ERR! weird error 1
npm ERR! not ok code 0
gedw@gedw-VirtualBox:/_data/headlesswebgl$ ^C
gedw@gedw-VirtualBox:
/_data/headlesswebgl$

Refactor

Once all conformance tests pass on all major platforms, it would be good to split up webgl.js into separate files to simplify maintenance.

npm test returns a few failures

Hi,

I plan on using headless-gl to generate, on the server, avatars of MMORPG players (these avatars are meant to be used on a forum that do not have a WebGL rendering engine).

To test the feasibility of using headless-gl, I ran npm test and got a few fails:

  total:     13759
  passing:   13330
  failing:   429
  duration:  9.2s

Among the errors I get:

    context_context-attributes-alpha-depth-stencil-antialias

      ✖ should be 255,0,0,255
      ✖ pixel[0] != 255 && pixel[0] != 0 should be true. Was false.


    extensions_oes-standard-derivatives

      ✖ getError expected: INVALID_ENUM. Was NO_ERROR : hint should not accept FRAGMENT_SHADER_DERIVATIVE_HINT_OES if extension is disabled
      ✖ GL_OES_standard_derivatives defined in shaders when extension is disabled
      ✖ Shader built-ins compiled successfully when extension disabled

And a lot of these:

      ✖ getError expected: NO_ERROR. Was INVALID_VALUE : gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 8, 4) should succeed 
      ✖ getError expected: NO_ERROR. Was INVALID_VALUE : gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 8) should succeed 
      ✖ getError expected: NO_ERROR. Was INVALID_VALUE : gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 4, 8) should succeed 
      ✖ getError expected: NO_ERROR. Was INVALID_VALUE : gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 8, 8) should succeed 
      ...

I run headless-gl on Mac OSX, is it supposed to be well supported?

texImage2D is more aggressive in checking data size that ANGLE

We are submitting a patch to the ThreeJS project here because headless-gl is more strict in validating the size of data arrays to texImage2D:

mrdoob/three.js#9107

The basic issue is that this check here catches that the size of the data passed in ws 3 bytes when the pack alignment was 4:

if (data && data.length < imageSize) {

I am unsure if this is the correct check or if ANGLE's less stringent checking (which I believe is no checking) is the correct approach.

Multiple contexts

Need to find some way to deal with multiple contexts efficiently. One possibility is to package each gl object in its own context and call *glSetContext before invoking any method, but this might be too slow...

Ubuntu `Error creating WebGLContext`

The npm install had no errors and pretty sure I have all the system dependencies. How can I confirm?

root@1e01255122e7:/srv/www# node
> var gl = require('gl')
undefined
> gl()
Error: Error creating WebGLContext
    at Error (native)
    at createContext (/dist/node_modules/gl/index.js:36:12)
    at repl:1:1
    at REPLServer.defaultEval (repl.js:252:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:417:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:210:10)

Intel GPU support

I'm unable to run the example code on an Intel GPU. In this case, it's an Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09), running on Linux (Gentoo).

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  53 (X_CreatePixmap)
  Value in failed request:  0x0
  Serial number of failed request:  28
  Current serial number in output stream:  31

Any hope to be able to run this on Intel?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.