Compare commits

...

7 Commits

Author SHA1 Message Date
Syoyo Fujita
aec35f10c0 Update README. 2017-12-03 17:19:55 +09:00
Syoyo Fujita
802b4df991 Merge branch 'validator' into jsoncpp 2017-12-03 17:17:03 +09:00
Syoyo Fujita
738a13ebf4 Use C++11 in Travis build and appveyor build. 2017-12-02 21:22:58 +09:00
Syoyo Fujita
7ce4a42fc3 Fix compilation. 2017-12-02 21:21:06 +09:00
Syoyo Fujita
0501a46612 Use C++11 flag. 2017-12-02 21:18:59 +09:00
Syoyo Fujita
836753132b Merge branch 'devel' into jsoncpp 2017-12-02 21:14:13 +09:00
Syoyo Fujita
2e21be7e19 Use json.hpp instead of picojson(W.I.P.) 2017-11-05 17:13:24 +09:00
9 changed files with 15490 additions and 1870 deletions

View File

@@ -40,5 +40,5 @@ script:
- export CC="${CC}-${COMPILER_VERSION}" - export CC="${CC}-${COMPILER_VERSION}"
- export CXX="${CXX}-${COMPILER_VERSION}" - export CXX="${CXX}-${COMPILER_VERSION}"
- ${CC} -v - ${CC} -v
- ${CXX} ${EXTRA_CXXFLAGS} -Wall -g -o loader_example loader_example.cc - ${CXX} ${EXTRA_CXXFLAGS} -std=c++11 -Wall -g -o loader_example loader_example.cc
- ./loader_example ./models/Cube/Cube.gltf - ./loader_example ./models/Cube/Cube.gltf

View File

@@ -3,7 +3,7 @@
#EXTRA_CXXFLAGS := -fsanitize=address -Wall -Werror -Weverything -Wno-c++11-long-long -DTINYGLTF_APPLY_CLANG_WEVERYTHING #EXTRA_CXXFLAGS := -fsanitize=address -Wall -Werror -Weverything -Wno-c++11-long-long -DTINYGLTF_APPLY_CLANG_WEVERYTHING
all: all:
clang++ $(EXTRA_CXXFLAGS) -g -O0 -o loader_example loader_example.cc clang++ $(EXTRA_CXXFLAGS) -std=c++11 -g -O0 -o loader_example loader_example.cc
lint: lint:
./cpplint.py tiny_gltf_loader.h ./cpplint.py tiny_gltf_loader.h

View File

@@ -1,6 +1,6 @@
# Header only C++ tiny glTF library(loader/saver). # Header only C++ tiny glTF library(loader/saver).
`TinyGLTF` is a header only C++ glTF 2.0 https://github.com/KhronosGroup/glTF library. `TinyGLTF` is a header only C++11 glTF 2.0 https://github.com/KhronosGroup/glTF library.
## Status ## Status
@@ -14,7 +14,7 @@ Work in process(`devel` branch). Very near to release, but need more tests and e
## Features ## Features
* Written in portable C++. C++-03 with STL dependency only. * Written in portable C++. C++-11 with STL dependency only.
* [x] macOS + clang(LLVM) * [x] macOS + clang(LLVM)
* [x] iOS + clang * [x] iOS + clang
* [x] Linux + gcc/clang * [x] Linux + gcc/clang
@@ -40,11 +40,12 @@ Work in process(`devel` branch). Very near to release, but need more tests and e
## Examples ## Examples
* [glview](examples/glview) : Simple glTF geometry viewer. * [glview](examples/glview) : Simple glTF geometry viewer.
* [validator](examples/validator) : Simple glTF validator with JSON schema.
## TODOs ## TODOs
* [ ] Write C++ code generator from json schema for robust parsing. * [ ] Write C++ code generator from json schema for robust parsing.
* [ ] Serialization * [x] Serialization
* [ ] Compression/decompression(Open3DGC, etc) * [ ] Compression/decompression(Open3DGC, etc)
* [ ] Support `extensions` and `extras` property * [ ] Support `extensions` and `extras` property
* [ ] HDR image? * [ ] HDR image?
@@ -56,14 +57,14 @@ TinyGLTF is licensed under MIT license.
TinyGLTF uses the following third party libraries. TinyGLTF uses the following third party libraries.
* picojson.h : Copyright 2009-2010 Cybozu Labs, Inc. Copyright 2011-2014 Kazuho Oku * json.hpp : Copyright (c) 2013-2017 Niels Lohmann. MIT license.
* base64 : Copyright (C) 2004-2008 René Nyffenegger * base64 : Copyright (C) 2004-2008 René Nyffenegger
* stb_image.h : v2.08 - public domain image loader - http://nothings.org/stb_image.h * stb_image.h : v2.08 - public domain image loader - http://nothings.org/stb_image.h
## Build and example ## Build and example
Copy `stb_image.h`, `picojson.h` and `tiny_gltf.h` to your project. Copy `stb_image.h`, `json.hpp` and `tiny_gltf.h` to your project.
### Loading glTF 2.0 model ### Loading glTF 2.0 model

View File

@@ -10,6 +10,7 @@ solution "glview"
files { "glview.cc", "trackball.cc" } files { "glview.cc", "trackball.cc" }
includedirs { "./" } includedirs { "./" }
includedirs { "../../" } includedirs { "../../" }
flags "c++11"
configuration { "linux" } configuration { "linux" }
linkoptions { "`pkg-config --libs glfw3`" } linkoptions { "`pkg-config --libs glfw3`" }

View File

@@ -1,5 +1,7 @@
#include "gltf-loader.h" #include "gltf-loader.h"
#include <iostream>
#define TINYGLTF_IMPLEMENTATION #define TINYGLTF_IMPLEMENTATION
#define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION
#include "tiny_gltf.h" #include "tiny_gltf.h"

14722
json.hpp Normal file

File diff suppressed because it is too large Load Diff

1163
picojson.h

File diff suppressed because it is too large Load Diff

View File

@@ -17,6 +17,7 @@ solution "TinyGLTFSolution"
kind "ConsoleApp" kind "ConsoleApp"
language "C++" language "C++"
files { sources } files { sources }
flags { "c++11" }
configuration "Debug" configuration "Debug"
defines { "DEBUG" } -- -DDEBUG defines { "DEBUG" } -- -DDEBUG

File diff suppressed because it is too large Load Diff