syoyo/tinygltf

Ignore reading image but ret false

pigLoveRabbit520 opened this issue · 1 comments

Describe the issue

// Define these only in *one* .cc file.
#define TINYGLTF_IMPLEMENTATION
#define TINYGLTF_NO_STB_IMAGE
#define TINYGLTF_NO_INCLUDE_STB_IMAGE
#define TINYGLTF_NO_STB_IMAGE_WRITE
#define TINYGLTF_NO_INCLUDE_STB_IMAGE_WRITE
#define TINYGLTF_ENABLE_DRACO
#include "tiny_gltf.h"

using namespace tinygltf;

int main()
{
	Model model;
	TinyGLTF loader;
	std::string err;
	std::string warn;

	bool ret = loader.LoadBinaryFromFile(&model, &err, &warn, "C:/Users/pig/Desktop/gltfFactory/x64/Debug/guantou.glb");

	if (!warn.empty()) {
		printf("Warn: %s\n", warn.c_str());
	}

	if (!err.empty()) {
		printf("Err: %s\n", err.c_str());
	}

	if (!ret) {
		printf("Failed to parse glTF\n");
		return -1;
	}
}

got

Err: No LoadImageData callback specified.
Failed to parse glTF

To Reproduce

Expected behaviour
glb is ok
ret is true

Screenshots

Additional context
Add any other context about the problem here.