mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 09:32:38 +08:00
Set preserveDrawingBuffer only for wechat game environment
This commit is contained in:
@@ -698,13 +698,16 @@ var game = {
|
||||
}
|
||||
|
||||
if (cc._renderType === game.RENDER_TYPE_WEBGL) {
|
||||
this._renderContext = cc._renderContext = cc.webglContext
|
||||
= cc.create3DContext(localCanvas, {
|
||||
var opts = {
|
||||
'stencil': true,
|
||||
'alpha': cc.macro.ENABLE_TRANSPARENT_CANVAS,
|
||||
'antialias': cc.macro.ENABLE_WEBGL_ANTIALIAS
|
||||
'preserveDrawingBuffer': isWeChatGame
|
||||
});
|
||||
};
|
||||
if (isWeChatGame) {
|
||||
opts['preserveDrawingBuffer'] = true;
|
||||
}
|
||||
this._renderContext = cc._renderContext = cc.webglContext
|
||||
= cc.create3DContext(localCanvas, opts);
|
||||
}
|
||||
// WebGL context created successfully
|
||||
if (this._renderContext) {
|
||||
|
||||
Reference in New Issue
Block a user