Jump to content

Forcing canvas or webGl not working in the last github versions


Recommended Posts

PIXI.autoDetectRenderer is working fine.

In the past I have the option to use directly both PIXI.CanvasRenderer and PIXI.WebGLRenderer to force pixi to choose either canvas or webGl.

In the latest version it's not possible anymore and:

PIXI.CanvasRenderer - always returning null object (on both borwsers with no web-gl and with web-gl support).

PIXI.WebGLRenderer - always returning object that doesn't work.

PIXI.autoDetectRenderer is working fine.


Source code:


    // Create an new instance of a pixi stage:
    this.stage = new PIXI.Stage ( 0x000000, true );

    // Create a renderer instance:
    var engineType = 0; // either 0,1 or 2
    var widthMax = $(window).width ();
    var heightMax = $(window).height ();
    switch ( engineType ) {
        case 1:
        case 'canvas':
            this.renderer = PIXI.CanvasRenderer ( widthMax, heightMax );

        case 2:
        case 'webgl':
            this.renderer = PIXI.WebGLRenderer ( widthMax, heightMax );

            this.renderer = PIXI.autoDetectRenderer ( widthMax, heightMax );
    } // End of switch.

Link to comment
Share on other sites

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.

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.


  • Recently Browsing   0 members

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