mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts][webgl] Added support for WebGL2. Closes #1500.
This commit is contained in:
parent
e89043b1f6
commit
4913926e3b
@ -1515,14 +1515,14 @@ var spine;
|
|||||||
var alpha = 0;
|
var alpha = 0;
|
||||||
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
||||||
case AnimationState.SUBSEQUENT:
|
case AnimationState.SUBSEQUENT:
|
||||||
|
timelineBlend = blend;
|
||||||
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
||||||
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
||||||
continue;
|
continue;
|
||||||
blend = spine.MixBlend.setup;
|
timelineBlend = spine.MixBlend.setup;
|
||||||
}
|
}
|
||||||
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
||||||
continue;
|
continue;
|
||||||
timelineBlend = blend;
|
|
||||||
alpha = alphaMix;
|
alpha = alphaMix;
|
||||||
break;
|
break;
|
||||||
case AnimationState.FIRST:
|
case AnimationState.FIRST:
|
||||||
@ -10945,7 +10945,7 @@ var spine;
|
|||||||
this.restorables = new Array();
|
this.restorables = new Array();
|
||||||
if (canvasOrContext instanceof HTMLCanvasElement) {
|
if (canvasOrContext instanceof HTMLCanvasElement) {
|
||||||
var canvas_1 = canvasOrContext;
|
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;
|
this.canvas = canvas_1;
|
||||||
canvas_1.addEventListener("webglcontextlost", function (e) {
|
canvas_1.addEventListener("webglcontextlost", function (e) {
|
||||||
var event = e;
|
var event = e;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1515,14 +1515,14 @@ var spine;
|
|||||||
var alpha = 0;
|
var alpha = 0;
|
||||||
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
||||||
case AnimationState.SUBSEQUENT:
|
case AnimationState.SUBSEQUENT:
|
||||||
|
timelineBlend = blend;
|
||||||
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
||||||
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
||||||
continue;
|
continue;
|
||||||
blend = spine.MixBlend.setup;
|
timelineBlend = spine.MixBlend.setup;
|
||||||
}
|
}
|
||||||
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
||||||
continue;
|
continue;
|
||||||
timelineBlend = blend;
|
|
||||||
alpha = alphaMix;
|
alpha = alphaMix;
|
||||||
break;
|
break;
|
||||||
case AnimationState.FIRST:
|
case AnimationState.FIRST:
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1515,14 +1515,14 @@ var spine;
|
|||||||
var alpha = 0;
|
var alpha = 0;
|
||||||
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
||||||
case AnimationState.SUBSEQUENT:
|
case AnimationState.SUBSEQUENT:
|
||||||
|
timelineBlend = blend;
|
||||||
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
||||||
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
||||||
continue;
|
continue;
|
||||||
blend = spine.MixBlend.setup;
|
timelineBlend = spine.MixBlend.setup;
|
||||||
}
|
}
|
||||||
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
||||||
continue;
|
continue;
|
||||||
timelineBlend = blend;
|
|
||||||
alpha = alphaMix;
|
alpha = alphaMix;
|
||||||
break;
|
break;
|
||||||
case AnimationState.FIRST:
|
case AnimationState.FIRST:
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1515,14 +1515,14 @@ var spine;
|
|||||||
var alpha = 0;
|
var alpha = 0;
|
||||||
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
||||||
case AnimationState.SUBSEQUENT:
|
case AnimationState.SUBSEQUENT:
|
||||||
|
timelineBlend = blend;
|
||||||
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
||||||
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
||||||
continue;
|
continue;
|
||||||
blend = spine.MixBlend.setup;
|
timelineBlend = spine.MixBlend.setup;
|
||||||
}
|
}
|
||||||
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
||||||
continue;
|
continue;
|
||||||
timelineBlend = blend;
|
|
||||||
alpha = alphaMix;
|
alpha = alphaMix;
|
||||||
break;
|
break;
|
||||||
case AnimationState.FIRST:
|
case AnimationState.FIRST:
|
||||||
@ -10677,7 +10677,7 @@ var spine;
|
|||||||
this.restorables = new Array();
|
this.restorables = new Array();
|
||||||
if (canvasOrContext instanceof HTMLCanvasElement) {
|
if (canvasOrContext instanceof HTMLCanvasElement) {
|
||||||
var canvas = canvasOrContext;
|
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;
|
this.canvas = canvas;
|
||||||
canvas.addEventListener("webglcontextlost", function (e) {
|
canvas.addEventListener("webglcontextlost", function (e) {
|
||||||
var event = e;
|
var event = e;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1515,14 +1515,14 @@ var spine;
|
|||||||
var alpha = 0;
|
var alpha = 0;
|
||||||
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
||||||
case AnimationState.SUBSEQUENT:
|
case AnimationState.SUBSEQUENT:
|
||||||
|
timelineBlend = blend;
|
||||||
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
||||||
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
||||||
continue;
|
continue;
|
||||||
blend = spine.MixBlend.setup;
|
timelineBlend = spine.MixBlend.setup;
|
||||||
}
|
}
|
||||||
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
||||||
continue;
|
continue;
|
||||||
timelineBlend = blend;
|
|
||||||
alpha = alphaMix;
|
alpha = alphaMix;
|
||||||
break;
|
break;
|
||||||
case AnimationState.FIRST:
|
case AnimationState.FIRST:
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1515,14 +1515,14 @@ var spine;
|
|||||||
var alpha = 0;
|
var alpha = 0;
|
||||||
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
|
||||||
case AnimationState.SUBSEQUENT:
|
case AnimationState.SUBSEQUENT:
|
||||||
|
timelineBlend = blend;
|
||||||
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
if (!attachments && timeline instanceof spine.AttachmentTimeline) {
|
||||||
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
if ((timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
|
||||||
continue;
|
continue;
|
||||||
blend = spine.MixBlend.setup;
|
timelineBlend = spine.MixBlend.setup;
|
||||||
}
|
}
|
||||||
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)
|
||||||
continue;
|
continue;
|
||||||
timelineBlend = blend;
|
|
||||||
alpha = alphaMix;
|
alpha = alphaMix;
|
||||||
break;
|
break;
|
||||||
case AnimationState.FIRST:
|
case AnimationState.FIRST:
|
||||||
@ -10677,7 +10677,7 @@ var spine;
|
|||||||
this.restorables = new Array();
|
this.restorables = new Array();
|
||||||
if (canvasOrContext instanceof HTMLCanvasElement) {
|
if (canvasOrContext instanceof HTMLCanvasElement) {
|
||||||
var canvas = canvasOrContext;
|
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;
|
this.canvas = canvas;
|
||||||
canvas.addEventListener("webglcontextlost", function (e) {
|
canvas.addEventListener("webglcontextlost", function (e) {
|
||||||
var event = e;
|
var event = e;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -36,7 +36,7 @@ module spine.webgl {
|
|||||||
constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig: any = { alpha: "true" }) {
|
constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig: any = { alpha: "true" }) {
|
||||||
if (canvasOrContext instanceof HTMLCanvasElement) {
|
if (canvasOrContext instanceof HTMLCanvasElement) {
|
||||||
let canvas = canvasOrContext;
|
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;
|
this.canvas = canvas;
|
||||||
canvas.addEventListener("webglcontextlost", (e: any) => {
|
canvas.addEventListener("webglcontextlost", (e: any) => {
|
||||||
let event = <WebGLContextEvent>e;
|
let event = <WebGLContextEvent>e;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user