您好,我目前正在使用spine-glfw,来通过OpenGL管线渲染spine动画,我使用了示例里面附带的spine动画素材(v4.2),能够正常播放。

我原先项目里面是有 4.2.1的spine-cpp和4.2.1的spine-glfw 但是我需要支持v3.8.99的动画素材。我注意到github仓库里面有3.8.95的spine-cpp,而spine-glfw只有4.2之后的版本。

我直接用4.2的加载3.8的毫无疑问遇到了:
Binary load error: Skeleton version tJ4pdYUq31ZnjnTLhss3.8.99 does not match runtime version 4.2

如果我希望将运行时替换成3.8.95的,我需要怎么做呢,我能否同时保留两份不同的版本?我主要希望保留OpenGL管线渲染,如果需要可以放弃glfw部分,通过其他方式处理OpenGL渲染结果。

Related Discussions
...

3.8 is very old, so we did not backport spine-glfw to the 3.8 branch on GitHub.

spine-glfw is a thin wrapper around spine-cpp 4.1+ SkeletonRenderer. That renderer returns meshes that you can send off to the GPU via whatever rendering API you use.

Here's the usage:
EsotericSoftware/spine-runtimesblob/4.2/spine-glfw/src/spine-glfw.cpp#L292-L333

Here's the implementation:
EsotericSoftware/spine-runtimesblob/4.2/spine-cpp/spine-cpp/src/spine/SkeletonRenderer.cpp

You could backport SkeletonRenderer to the 3.8 branch version of spine-cpp. Then you could likely use spine-cpp 3.8 as is with spine-glfw.

Alternatively, you can check out the rendering logic implemented in SkeletonRenderer and port that directly to your rendering API of choice, ignoring spine-glfw.

  • ETO ответили на это сообщение.

    Mario

    我可能需要确认一些细节的东西,因为我对这些依赖不是很了解

    我目前的代码是在spine-glfw下面运行的,主要是参考了这两个代码:

    如果我希望保持我编写代码大体不变,我需要做的是将项目里面的spine-cpp(v4.2)直接整体替换为spine-cpp(v3.8),然后将SkeletonRenderer(SkeletonRenderer.cpp,SkeletonRenderer.h,BlockAllocator.h)移植到spine-cpp(v3.8)中,spine-glfw 中的 spine-glfw.cpp,spine-glfw.h 保持不变,如此就可以

    Mario could likely use spine-cpp 3.8 as is with spine-glfw

    请问我这样理解正确吗,很抱歉我对这些不是很熟悉。