Skip to content

Commit

Permalink
Merge pull request #37 from mortennobel/develop
Browse files Browse the repository at this point in the history
1.1.2
  • Loading branch information
mortennobel authored Jul 19, 2018
2 parents a7228be + 9898f0b commit 7e52507
Show file tree
Hide file tree
Showing 63 changed files with 1,116 additions and 3,102 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "submodules/picojson"]
path = submodules/picojson
url = https://github.com/kazuho/picojson.git
[submodule "submodules/ImGuiColorTextEdit"]
path = submodules/ImGuiColorTextEdit
url = https://github.com/mortennobel/ImGuiColorTextEdit.git
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ set(CMAKE_CXX_EXTENSIONS OFF)

set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")


find_package(SDL2 REQUIRED)
set(SRE_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ API documentation is defined in header files.

* https://www.libsdl.org Simple Direct Layer 2.x
* https://www.libsdl.org/projects/SDL_image/ Simple Direct Layer Image 2.x
* http://glm.g-truc.net/ OpenGL Mathematics (bundled)
* http://glm.g-truc.net/ OpenGL Mathematics (bundled as submodule)
* https://www.opengl.org/registry/ OpenGL Registry
* https://github.com/ocornut/imgui ImGui 1.60 (bundled)
* https://github.com/BalazsJako/ImGuiColorTextEdit ImGuiColorTextEdit (bundled)
* https://github.com/kazuho/picojson PicoJSON(bundled)
* https://github.com/ocornut/imgui ImGui 1.60 (submodule)
* https://github.com/BalazsJako/ImGuiColorTextEdit ImGuiColorTextEdit (bundled as submodule)
* https://github.com/kazuho/picojson PicoJSON (bundled as submodule)

Binary file modified docs/examples/07_matcap.html.mem
Binary file not shown.
60 changes: 30 additions & 30 deletions docs/examples/07_matcap.js

Large diffs are not rendered by default.

Binary file modified docs/examples/09_picking.html.mem
Binary file not shown.
56 changes: 28 additions & 28 deletions docs/examples/09_picking.js

Large diffs are not rendered by default.

Binary file modified docs/examples/10_skybox-example.html.mem
Binary file not shown.
59 changes: 30 additions & 29 deletions docs/examples/10_skybox-example.js

Large diffs are not rendered by default.

Binary file modified docs/examples/12_render-to-texture.html.mem
Binary file not shown.
56 changes: 28 additions & 28 deletions docs/examples/12_render-to-texture.js

Large diffs are not rendered by default.

Binary file modified docs/examples/15_cloth_simulation.html.mem
Binary file not shown.
57 changes: 29 additions & 28 deletions docs/examples/15_cloth_simulation.js

Large diffs are not rendered by default.

Binary file modified docs/examples/16_shadows.html.mem
Binary file not shown.
57 changes: 29 additions & 28 deletions docs/examples/16_shadows.js

Large diffs are not rendered by default.

168 changes: 96 additions & 72 deletions em-build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,165 +8,189 @@ fi

source ${EMSDK}/emsdk_env.sh

emcc -Iinclude src/imgui/imgui.cpp \
src/imgui/imgui_draw.cpp \
src/imgui/imgui_sre.cpp \
src/imgui/TextEditor.cpp \
emcc -Iinclude -Isubmodules/imgui -Isubmodules/glm -Isubmodules/picojson -Isubmodules/ImGuiColorTextEdit \
submodules/imgui/imgui.cpp \
submodules/imgui/imgui_draw.cpp \
submodules/ImGuiColorTextEdit/TextEditor.cpp \
src/sre/Camera.cpp \
src/sre/Color.cpp \
src/sre/Framebuffer.cpp \
src/sre/imgui_sre.cpp \
src/sre/Inspector.cpp \
src/sre/Light.cpp \
src/sre/Log.cpp \
src/sre/Material.cpp \
src/sre/Mesh.cpp \
src/sre/ModelImporter.cpp \
src/sre/Renderer.cpp \
src/sre/RenderPass.cpp \
src/sre/Resource.cpp \
src/sre/SDLRenderer.cpp \
src/sre/Shader.cpp \
src/sre/Texture.cpp \
src/sre/WorldLights.cpp \
src/sre/Framebuffer.cpp \
src/sre/ModelImporter.cpp \
src/sre/Skybox.cpp \
src/sre/Sprite.cpp \
src/sre/SpriteBatch.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/Skybox.cpp \
src/sre/SpriteBatch.cpp \
src/sre/Texture.cpp \
src/sre/VR.cpp \
src/sre/WorldLights.cpp \
src/sre/impl/GL.cpp \
src/sre/impl/UniformSet.cpp \
examples/10_skybox-example.cpp \
-O2 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' --embed-file examples_data/cube-negx.png --embed-file examples_data/cube-negy.png --embed-file examples_data/cube-negz.png --embed-file examples_data/cube-posx.png --embed-file examples_data/cube-posy.png --embed-file examples_data/cube-posz.png -s USE_SDL=2 -o docs/examples/10_skybox-example.html


emcc -Iinclude src/imgui/imgui.cpp \
src/imgui/imgui_draw.cpp \
src/imgui/imgui_sre.cpp \
src/imgui/TextEditor.cpp \
emcc -Iinclude -Isubmodules/imgui -Isubmodules/glm -Isubmodules/picojson -Isubmodules/ImGuiColorTextEdit \
submodules/imgui/imgui.cpp \
submodules/imgui/imgui_draw.cpp \
submodules/ImGuiColorTextEdit/TextEditor.cpp \
src/sre/Camera.cpp \
src/sre/Color.cpp \
src/sre/Framebuffer.cpp \
src/sre/imgui_sre.cpp \
src/sre/Inspector.cpp \
src/sre/Light.cpp \
src/sre/Log.cpp \
src/sre/Material.cpp \
src/sre/Mesh.cpp \
src/sre/ModelImporter.cpp \
src/sre/Renderer.cpp \
src/sre/RenderPass.cpp \
src/sre/Resource.cpp \
src/sre/SDLRenderer.cpp \
src/sre/Shader.cpp \
src/sre/Texture.cpp \
src/sre/WorldLights.cpp \
src/sre/Framebuffer.cpp \
src/sre/ModelImporter.cpp \
src/sre/Skybox.cpp \
src/sre/Sprite.cpp \
src/sre/SpriteBatch.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/Skybox.cpp \
src/sre/SpriteBatch.cpp \
src/sre/Texture.cpp \
src/sre/VR.cpp \
src/sre/WorldLights.cpp \
src/sre/impl/GL.cpp \
src/sre/impl/UniformSet.cpp \
examples/12_render-to-texture.cpp \
-O2 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[]' -s USE_SDL=2 -o docs/examples/12_render-to-texture.html

emcc -Iinclude src/imgui/imgui.cpp \
src/imgui/imgui_draw.cpp \
src/imgui/imgui_sre.cpp \
src/imgui/TextEditor.cpp \
emcc -Iinclude -Isubmodules/imgui -Isubmodules/glm -Isubmodules/picojson -Isubmodules/ImGuiColorTextEdit \
submodules/imgui/imgui.cpp \
submodules/imgui/imgui_draw.cpp \
submodules/ImGuiColorTextEdit/TextEditor.cpp \
src/sre/Camera.cpp \
src/sre/Color.cpp \
src/sre/Framebuffer.cpp \
src/sre/imgui_sre.cpp \
src/sre/Inspector.cpp \
src/sre/Light.cpp \
src/sre/Log.cpp \
src/sre/Material.cpp \
src/sre/Mesh.cpp \
src/sre/ModelImporter.cpp \
src/sre/Renderer.cpp \
src/sre/RenderPass.cpp \
src/sre/Resource.cpp \
src/sre/SDLRenderer.cpp \
src/sre/Shader.cpp \
src/sre/Texture.cpp \
src/sre/WorldLights.cpp \
src/sre/Framebuffer.cpp \
src/sre/ModelImporter.cpp \
src/sre/Skybox.cpp \
src/sre/Sprite.cpp \
src/sre/SpriteBatch.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/Skybox.cpp \
src/sre/SpriteBatch.cpp \
src/sre/Texture.cpp \
src/sre/VR.cpp \
src/sre/WorldLights.cpp \
src/sre/impl/GL.cpp \
src/sre/impl/UniformSet.cpp \
examples/07_matcap.cpp \
-O2 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' --embed-file examples_data/suzanne.obj --embed-file examples_data/matcap_00001.png --embed-file examples_data/matcap_00002.png --embed-file examples_data/matcap_00003.png --embed-file examples_data/matcap_00004.png -s USE_SDL=2 -o docs/examples/07_matcap.html

emcc -Iinclude src/imgui/imgui.cpp \
src/imgui/imgui_draw.cpp \
src/imgui/imgui_sre.cpp \
src/imgui/TextEditor.cpp \
emcc -Iinclude -Isubmodules/imgui -Isubmodules/glm -Isubmodules/picojson -Isubmodules/ImGuiColorTextEdit \
submodules/imgui/imgui.cpp \
submodules/imgui/imgui_draw.cpp \
submodules/ImGuiColorTextEdit/TextEditor.cpp \
src/sre/Camera.cpp \
src/sre/Color.cpp \
src/sre/Framebuffer.cpp \
src/sre/imgui_sre.cpp \
src/sre/Inspector.cpp \
src/sre/Light.cpp \
src/sre/Log.cpp \
src/sre/Material.cpp \
src/sre/Mesh.cpp \
src/sre/ModelImporter.cpp \
src/sre/Renderer.cpp \
src/sre/RenderPass.cpp \
src/sre/Resource.cpp \
src/sre/SDLRenderer.cpp \
src/sre/Shader.cpp \
src/sre/Texture.cpp \
src/sre/WorldLights.cpp \
src/sre/Framebuffer.cpp \
src/sre/ModelImporter.cpp \
src/sre/Skybox.cpp \
src/sre/Sprite.cpp \
src/sre/SpriteBatch.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/Skybox.cpp \
src/sre/SpriteBatch.cpp \
src/sre/Texture.cpp \
src/sre/VR.cpp \
src/sre/WorldLights.cpp \
src/sre/impl/GL.cpp \
src/sre/impl/UniformSet.cpp \
examples/09_picking.cpp \
-O2 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[]' -s USE_SDL=2 -o docs/examples/09_picking.html

emcc -Iinclude src/imgui/imgui.cpp \
src/imgui/imgui_draw.cpp \
src/imgui/imgui_sre.cpp \
src/imgui/TextEditor.cpp \
emcc -Iinclude -Isubmodules/imgui -Isubmodules/glm -Isubmodules/picojson -Isubmodules/ImGuiColorTextEdit \
submodules/imgui/imgui.cpp \
submodules/imgui/imgui_draw.cpp \
submodules/ImGuiColorTextEdit/TextEditor.cpp \
src/sre/Camera.cpp \
src/sre/Color.cpp \
src/sre/Framebuffer.cpp \
src/sre/imgui_sre.cpp \
src/sre/Inspector.cpp \
src/sre/Light.cpp \
src/sre/Log.cpp \
src/sre/Material.cpp \
src/sre/Mesh.cpp \
src/sre/ModelImporter.cpp \
src/sre/Renderer.cpp \
src/sre/RenderPass.cpp \
src/sre/Resource.cpp \
src/sre/SDLRenderer.cpp \
src/sre/Shader.cpp \
src/sre/Texture.cpp \
src/sre/WorldLights.cpp \
src/sre/Framebuffer.cpp \
src/sre/ModelImporter.cpp \
src/sre/Skybox.cpp \
src/sre/Sprite.cpp \
src/sre/SpriteBatch.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/Skybox.cpp \
src/sre/SpriteBatch.cpp \
src/sre/Texture.cpp \
src/sre/VR.cpp \
src/sre/WorldLights.cpp \
src/sre/impl/GL.cpp \
src/sre/impl/UniformSet.cpp \
examples/15_cloth_simulation.cpp \
-O2 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[]' -s USE_SDL=2 -o docs/examples/15_cloth_simulation.html

emcc -Iinclude src/imgui/imgui.cpp \
src/imgui/imgui_draw.cpp \
src/imgui/imgui_sre.cpp \
src/imgui/TextEditor.cpp \
emcc -Iinclude -Isubmodules/imgui -Isubmodules/glm -Isubmodules/picojson -Isubmodules/ImGuiColorTextEdit \
submodules/imgui/imgui.cpp \
submodules/imgui/imgui_draw.cpp \
submodules/ImGuiColorTextEdit/TextEditor.cpp \
src/sre/Camera.cpp \
src/sre/Color.cpp \
src/sre/Framebuffer.cpp \
src/sre/imgui_sre.cpp \
src/sre/Inspector.cpp \
src/sre/Light.cpp \
src/sre/Log.cpp \
src/sre/Material.cpp \
src/sre/Mesh.cpp \
src/sre/ModelImporter.cpp \
src/sre/Renderer.cpp \
src/sre/RenderPass.cpp \
src/sre/Resource.cpp \
src/sre/SDLRenderer.cpp \
src/sre/Shader.cpp \
src/sre/Texture.cpp \
src/sre/WorldLights.cpp \
src/sre/Framebuffer.cpp \
src/sre/ModelImporter.cpp \
src/sre/Skybox.cpp \
src/sre/Sprite.cpp \
src/sre/SpriteBatch.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/Skybox.cpp \
src/sre/SpriteBatch.cpp \
src/sre/Texture.cpp \
src/sre/VR.cpp \
src/sre/WorldLights.cpp \
src/sre/impl/GL.cpp \
src/sre/impl/UniformSet.cpp \
examples/16_shadows.cpp \
-O2 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=33554432 --embed-file examples_data/suzanne.obj -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[]' -s USE_SDL=2 -o docs/examples/16_shadows.html
56 changes: 32 additions & 24 deletions em-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,33 @@ source ${EMSDK}/emsdk_env.sh
for FILENAME in stencil_test custom-mesh-layout-ints benchmark64k-heavy matrix-uniforms multiple-materials multiple-lights imgui-color-test pbr-test custom-mesh-layout-default-values imgui_demo multi-cameras particle-sprite particle-test polygon-offset-example spinning-sphere-cubemap sprite-test static_vertex_attribute texture-test
do
echo $FILENAME
emcc -Iinclude src/imgui/imgui.cpp \
src/imgui/imgui_draw.cpp \
src/imgui/imgui_sre.cpp \
src/imgui/TextEditor.cpp \
emcc -Iinclude -Isubmodules/imgui -Isubmodules/glm -Isubmodules/picojson -Isubmodules/ImGuiColorTextEdit \
submodules/imgui/imgui.cpp \
submodules/imgui/imgui_draw.cpp \
submodules/ImGuiColorTextEdit/TextEditor.cpp \
src/sre/Camera.cpp \
src/sre/Color.cpp \
src/sre/Framebuffer.cpp \
src/sre/imgui_sre.cpp \
src/sre/Inspector.cpp \
src/sre/Light.cpp \
src/sre/Log.cpp \
src/sre/Material.cpp \
src/sre/Mesh.cpp \
src/sre/ModelImporter.cpp \
src/sre/Renderer.cpp \
src/sre/RenderPass.cpp \
src/sre/Resource.cpp \
src/sre/SDLRenderer.cpp \
src/sre/Shader.cpp \
src/sre/Texture.cpp \
src/sre/WorldLights.cpp \
src/sre/Framebuffer.cpp \
src/sre/ModelImporter.cpp \
src/sre/Skybox.cpp \
src/sre/Sprite.cpp \
src/sre/SpriteBatch.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/Skybox.cpp \
src/sre/SpriteBatch.cpp \
src/sre/Texture.cpp \
src/sre/VR.cpp \
src/sre/WorldLights.cpp \
src/sre/impl/GL.cpp \
src/sre/impl/UniformSet.cpp \
test/$FILENAME.cpp \
-O2 -s ASSERTIONS=1 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=67108864 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' --preload-file test_data -s USE_SDL=2 -o html/$FILENAME.html
Expand All @@ -43,29 +47,33 @@ done
for FILENAME in 00_hello-engine 01_hello-engine-raw 02_spheres 03_spinning-cube 04_spinning-primitives-tex 05_obj-viewer 06_custom-mesh-layout 07_matcap 08_gui 09_picking 10_skybox-example 11_sprite-example 12_render-to-texture 13_benchmark64k 14_spinning-primitives-openvr 15_cloth_simulation 16_shadows
do
echo $FILENAME
emcc -Iinclude src/imgui/imgui.cpp \
src/imgui/imgui_draw.cpp \
src/imgui/imgui_sre.cpp \
src/imgui/TextEditor.cpp \
emcc -Iinclude -Isubmodules/imgui -Isubmodules/glm -Isubmodules/picojson -Isubmodules/ImGuiColorTextEdit \
submodules/imgui/imgui.cpp \
submodules/imgui/imgui_draw.cpp \
submodules/ImGuiColorTextEdit/TextEditor.cpp \
src/sre/Camera.cpp \
src/sre/Color.cpp \
src/sre/Framebuffer.cpp \
src/sre/imgui_sre.cpp \
src/sre/Inspector.cpp \
src/sre/Light.cpp \
src/sre/Log.cpp \
src/sre/Material.cpp \
src/sre/Mesh.cpp \
src/sre/ModelImporter.cpp \
src/sre/Renderer.cpp \
src/sre/RenderPass.cpp \
src/sre/Resource.cpp \
src/sre/SDLRenderer.cpp \
src/sre/Shader.cpp \
src/sre/Texture.cpp \
src/sre/WorldLights.cpp \
src/sre/Framebuffer.cpp \
src/sre/ModelImporter.cpp \
src/sre/Skybox.cpp \
src/sre/Sprite.cpp \
src/sre/SpriteBatch.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/Skybox.cpp \
src/sre/SpriteBatch.cpp \
src/sre/Texture.cpp \
src/sre/VR.cpp \
src/sre/WorldLights.cpp \
src/sre/impl/GL.cpp \
src/sre/impl/UniformSet.cpp \
examples/$FILENAME.cpp \
-O2 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' --preload-file examples_data -s USE_SDL=2 -o html/$FILENAME.html
Expand Down
4 changes: 4 additions & 0 deletions examples/05_obj-viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "sre/Material.hpp"
#include "sre/SDLRenderer.hpp"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-security"
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/euler_angles.hpp>
#include <glm/gtx/transform.hpp>
Expand Down Expand Up @@ -250,3 +252,5 @@ int main() {
std::make_unique<ObjViewerExample>();
return 0;
}

#pragma clang diagnostic pop
Loading

0 comments on commit 7e52507

Please sign in to comment.