mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +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;
|
||||
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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user