Merge pull request #5163 from samme/fix/headless-renderTexture

Fix error adding a Render Texture with Headless renderer
This commit is contained in:
Richard Davey 2020-07-13 12:32:53 +01:00 committed by GitHub
commit 0ecaed42ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,6 +12,7 @@ var Components = require('../components');
var CONST = require('../../const');
var Frame = require('../../textures/Frame');
var GameObject = require('../GameObject');
var NOOP = require('../../utils/NOOP');
var Render = require('./RenderTextureRender');
var Utils = require('../../renderer/webgl/Utils');
var UUID = require('../../utils/string/UUID');
@ -274,7 +275,11 @@ var RenderTexture = new Class({
var renderer = this.renderer;
if (renderer.type === CONST.WEBGL)
if (!renderer)
{
this.drawGameObject = NOOP;
}
else if (renderer.type === CONST.WEBGL)
{
var gl = renderer.gl;