Jump to content

WebGLRenderer render method throw error


Bobby
 Share

Recommended Posts

This is my setup:

var win_width  = window.innerWidth;var win_height = window.innerHeight;var stage = new PIXI.Stage(0xFFFFFF);var renderer = new PIXI.WebGLRenderer( win_width, win_height, {  transparent: true});document.body.insertBefore( renderer.view, document.body.firstChild );var game = requestAnimationFrame( updateGame );var rect = new PIXI.Graphics();rect.beginFill(0x336699);rect.drawRect(0, 0, 400, 400);stage.addChild( rect );function updateGame() {  // My simple game logic    renderer.render( stage );  game = requestAnimationFrame( updateGame );}

And when I open in a browser I got this error message

Uncaught TypeError: Cannot read property 'length' of null

Tried to change it to autoDetectRenderer and still producing same error but, If I change the renderer to CanvasRenderer, everything work normally. What do I miss?

 

Additional info:

  • Using PIXI v2.2.8
  • Tested in Google Chrome 41, OS X Yosemite
Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...