61 Commits

Author SHA1 Message Date
Syoyo Fujita
7b0bbc6570 Merge branch 'devel' into Selmar-generic_extension_support 2018-04-05 01:27:03 +09:00
Selmar Kok
9eae110946 serialize texture extensions 2018-04-04 18:10:37 +02:00
Selmar Kok
fa7022f364 Changed ExtensionMap to use Value instead of ParameterMap 2018-04-04 18:10:20 +02:00
johan bowald
b97d34cfee bugfix, serializer skipped texture samplers refering to first index. 2018-04-02 07:29:29 +02:00
Syoyo Fujita
dc4bb86bf1 Suppress clang warnings. 2018-04-02 02:04:24 +09:00
johan bowald
ef151a4fed update examples with new defines 2018-04-01 14:08:45 +02:00
johan bowald
642a343684 output both embedded and image files, small fix to serializer. 2018-04-01 12:37:18 +02:00
Syoyo Fujita
719d7e4a74 Suppress clang warnings.
Apply clang-format.
2018-03-30 19:26:35 +09:00
johan bowald
30c5347afe added embed buffers as an option in serializer 2018-03-30 11:52:56 +02:00
Johan Bowald
faa2722f45 Serializer skips null values 2018-03-28 14:54:22 +02:00
Selmar Kok
5210f1539e Merge remote-tracking branch 'origin/devel' into generic_extension_support 2018-03-26 16:22:18 +02:00
Syoyo Fujita
246654a15a Code clean-up. Reviewed by @Squareeyes. 2018-03-21 20:32:22 +09:00
Syoyo Fujita
ba28ddcc9e Modify error message. 2018-03-21 20:05:11 +09:00
Syoyo Fujita
8e2c24fb92 Refactor ParseImage function.
Returns error when both `bufferView` and `uri` are defined in Image.
2018-03-21 19:54:38 +09:00
Arthur Brainville
cd366ddd1d
Fix MSVC build: removing static keyowrd befor tinygltf::LoadImageData
This is peculiar:
It looks like MSVC doesn't want to build when multiple compilation units
(e.g. multiple .cc files) uses tiny_gltf and this funciton is static.

The only one file that will build without error is the one that defined
the `TINYGLTF_IMPLEMENTATION` macro.

Removing `static` here solves the issue...

Signed-off-by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
2018-03-19 19:54:05 +01:00
Selmar Kok
85b3cbc44d Merge branch 'devel' into generic_extension_support 2018-03-19 16:15:22 +01:00
Syoyo Fujita
d5b0244e2c Serialize lights under as KHR_lights_cmn extension. 2018-03-17 16:12:42 -05:00
Selmar Kok
2a15f387bc Merge branch 'devel' into generic_extension_support
# Conflicts:
#	tiny_gltf.h
2018-03-16 12:32:52 +01:00
Selmar Kok
5b8eb9b429 Merge branch 'devel' into opt_out_external_image_loading 2018-03-16 12:15:13 +01:00
Selmar
67af3c98aa
Allow opting out of external image loading
We do not require image loading for external files, we have separate texture directories at the moment.

I've also added saving the image->uri when loading a binary gltf.
2018-03-16 11:48:19 +01:00
Syoyo Fujita
580d7c8b9f Parse defaultScene value correcrly. Fixes #47. 2018-03-15 22:09:01 -05:00
Syoyo Fujita
e69069d53c Loading a GLB file without BIN data fails. Fixes #49. 2018-03-15 22:01:18 -05:00
Syoyo Fujita
d42767e63f Store relative URI in Buffer serializer. Fixes #48.
Apply clang-format.
Add simple saver sample.
2018-03-15 21:52:00 -05:00
Selmar
7d8cbba8e4
removed code from another issue 2018-03-15 17:32:27 +01:00
Selmar
09d2ff12d8
generic extension support
Two issues remaining:
- The lights data exists twice on export; once outside of the gltf specification and once in the extensions.
- A lot of objects are still missing the extensions property.
2018-03-15 17:30:42 +01:00
Syoyo Fujita
20244e1e4e Fix storing uri to Buffer.uri. Fixes #50.
Fix decoding DataURI with 'data:application/gltf-buffer;base64' mime.
2018-03-15 11:01:05 -05:00
Squareys
2d3594de22 Allow opting out of STB_IMAGE dependency
Signed-off-by: Squareys <squareys@googlemail.com>
2018-03-13 23:08:03 +01:00
Squareys
ff644d82c9 Allow specifying custom image loader callback
Signed-off-by: Squareys <squareys@googlemail.com>
2018-03-13 23:08:03 +01:00
Squareys
f99f760b07 Clean up obsolete debug output
Signed-off-by: Squareys <squareys@googlemail.com>
2018-03-13 22:29:31 +01:00
Squareys
4337463c79 Remove trailing whitespaces
Signed-off-by: Squareys <squareys@googlemail.com>
2018-03-13 22:20:48 +01:00
Squareys
188965b11e Fix minor typo
Signed-off-by: Squareys <squareys@googlemail.com>
2018-03-13 22:20:01 +01:00
Syoyo Fujita
179edbf054 Fix empty serialization. Fixes #44. 2018-03-06 12:04:51 +09:00
Omar C. F
d492efc38a
Fix return value when error occurs 2018-02-10 09:50:35 +02:00
Omar C. F
f8a8d9caa0
Add missing bmp and gif mimetypes 2018-02-10 09:09:41 +02:00
Syoyo Fujita
89cd83e22f Merge branch 'devel' of github.com:syoyo/tinygltf into devel 2018-01-21 12:20:00 +09:00
Syoyo Fujita
476a8b21b0 Set GL_DOUBLE value from OpenGL spec. Fixes #35. 2018-01-21 12:19:01 +09:00
Syoyo Fujita
05e0bf1cdc Suppress clang warnigns.
Refactor code to use C++11 features.
2018-01-16 18:55:13 +09:00
Arthur Brainville
8ce4e54394
Silence a MSVC warning about narrowing conversion
We actually want to convert a size_t value into an int value in this
return statement.

Fix the annoying MSVC warning by actually casting the bytestride to an
int

Signed-off-by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
2018-01-10 01:27:12 +01:00
Arthur Brainville
9585391311
rename Color to ColorFactor
Signed-off-by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
2018-01-08 18:37:44 +01:00
Arthur Brainville
41fe772058
Const qualify const methods
Signed-off-by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
2018-01-08 18:32:48 +01:00
Arthur Brainville
5845319b1a
Add little utility methods to access the content of a Parameter object
Signed-off-by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
2018-01-08 18:25:52 +01:00
Syoyo Fujita
17cfbcc976 Fix argument to catch claus was wrong.
Add support to compile TinyGLTF with no C++ exception(TINYGLTF_NOEXCEPTION). Fixes #18.
Add initial unit tests.
2018-01-05 20:14:46 +09:00
Syoyo Fujita
584f8c0ddf Add method for computing byteStride to Accessor struct.
This would fix issue #29.
2018-01-03 17:47:08 +09:00
Cemalettin Dervis
246d866961
Fixed typo ("RPEAT") 2017-12-07 20:29:51 +01:00
Syoyo Fujita
836753132b Merge branch 'devel' into jsoncpp 2017-12-02 21:14:13 +09:00
Syoyo Fujita
b23f6fe492 Fix compile on iOS. Fixes #24. 2017-11-15 01:03:09 +09:00
Emanuel Schrade
186322bed6 Parse KHR_Lights_cmn extension 2017-11-06 11:14:49 +01:00
Syoyo Fujita
ef2f49ff19 User lowercase for Windows.h. Fixes #22. 2017-11-05 17:18:46 +09:00
Syoyo Fujita
2e21be7e19 Use json.hpp instead of picojson(W.I.P.) 2017-11-05 17:13:24 +09:00
Syoyo Fujita
57c1018f89 Improve error message. 2017-10-19 18:48:26 +09:00