[ts][webgl] Added support for WebGL2. Closes #1500.

This commit is contained in:
badlogic 2019-09-23 14:38:26 +02:00
parent e89043b1f6
commit 4913926e3b
13 changed files with 22 additions and 22 deletions

View File

@ -1515,14 +1515,14 @@ var spine;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
case AnimationState.SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
continue;
blend = spine.MixBlend.setup;
timelineBlend = spine.MixBlend.setup;
}
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
continue;
timelineBlend = blend;
alpha = alphaMix;
break;
case AnimationState.FIRST:
@ -10945,7 +10945,7 @@ var spine;
this.restorables = new Array();
if (canvasOrContext instanceof HTMLCanvasElement) {
var canvas_1 = canvasOrContext;
this.gl = (canvas_1.getContext("webgl", contextConfig) || canvas_1.getContext("experimental-webgl", contextConfig));
this.gl = (canvas_1.getContext("webgl2", contextConfig)) || (canvas_1.getContext("webgl", contextConfig) || canvas_1.getContext("experimental-webgl", contextConfig));
this.canvas = canvas_1;
canvas_1.addEventListener("webglcontextlost", function (e) {
var event = e;

File diff suppressed because one or more lines are too long

View File

@ -1515,14 +1515,14 @@ var spine;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
case AnimationState.SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
continue;
blend = spine.MixBlend.setup;
timelineBlend = spine.MixBlend.setup;
}
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
continue;
timelineBlend = blend;
alpha = alphaMix;
break;
case AnimationState.FIRST:

File diff suppressed because one or more lines are too long

View File

@ -1515,14 +1515,14 @@ var spine;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
case AnimationState.SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
continue;
blend = spine.MixBlend.setup;
timelineBlend = spine.MixBlend.setup;
}
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
continue;
timelineBlend = blend;
alpha = alphaMix;
break;
case AnimationState.FIRST:

File diff suppressed because one or more lines are too long

View File

@ -1515,14 +1515,14 @@ var spine;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
case AnimationState.SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
continue;
blend = spine.MixBlend.setup;
timelineBlend = spine.MixBlend.setup;
}
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
continue;
timelineBlend = blend;
alpha = alphaMix;
break;
case AnimationState.FIRST:
@ -10677,7 +10677,7 @@ var spine;
this.restorables = new Array();
if (canvasOrContext instanceof HTMLCanvasElement) {
var canvas = canvasOrContext;
this.gl = (canvas.getContext("webgl", contextConfig) || canvas.getContext("experimental-webgl", contextConfig));
this.gl = (canvas.getContext("webgl2", contextConfig)) || (canvas.getContext("webgl", contextConfig) || canvas.getContext("experimental-webgl", contextConfig));
this.canvas = canvas;
canvas.addEventListener("webglcontextlost", function (e) {
var event = e;

File diff suppressed because one or more lines are too long

View File

@ -1515,14 +1515,14 @@ var spine;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
case AnimationState.SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
continue;
blend = spine.MixBlend.setup;
timelineBlend = spine.MixBlend.setup;
}
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
continue;
timelineBlend = blend;
alpha = alphaMix;
break;
case AnimationState.FIRST:

File diff suppressed because one or more lines are too long

View File

@ -1515,14 +1515,14 @@ var spine;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
case AnimationState.SUBSEQUENT:
timelineBlend = blend;
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
continue;
blend = spine.MixBlend.setup;
timelineBlend = spine.MixBlend.setup;
}
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
continue;
timelineBlend = blend;
alpha = alphaMix;
break;
case AnimationState.FIRST:
@ -10677,7 +10677,7 @@ var spine;
this.restorables = new Array();
if (canvasOrContext instanceof HTMLCanvasElement) {
var canvas = canvasOrContext;
this.gl = (canvas.getContext("webgl", contextConfig) || canvas.getContext("experimental-webgl", contextConfig));
this.gl = (canvas.getContext("webgl2", contextConfig)) || (canvas.getContext("webgl", contextConfig) || canvas.getContext("experimental-webgl", contextConfig));
this.canvas = canvas;
canvas.addEventListener("webglcontextlost", function (e) {
var event = e;

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@ module spine.webgl {
constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig: any = { alpha: "true" }) {
if (canvasOrContext instanceof HTMLCanvasElement) {
let canvas = canvasOrContext;
this.gl = <WebGLRenderingContext> (canvas.getContext("webgl", contextConfig) || canvas.getContext("experimental-webgl", contextConfig));
this.gl = <WebGLRenderingContext> (canvas.getContext("webgl2", contextConfig)) || (canvas.getContext("webgl", contextConfig) || canvas.getContext("experimental-webgl", contextConfig));
this.canvas = canvas;
canvas.addEventListener("webglcontextlost", (e: any) => {
let event = <WebGLContextEvent>e;