Skip to content

Commit

Permalink
Added example renders
Browse files Browse the repository at this point in the history
  • Loading branch information
kunitoki committed Apr 30, 2024
1 parent 384823d commit e75001d
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file added docs/demos/web_render_2/example_render.data
Binary file not shown.
1 change: 1 addition & 0 deletions docs/demos/web_render_2/example_render.js

Large diffs are not rendered by default.

Binary file added docs/demos/web_render_2/example_render.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions docs/demos/web_render_2/index.html

Large diffs are not rendered by default.

Binary file added docs/demos/web_render_3/example_render.data
Binary file not shown.
1 change: 1 addition & 0 deletions docs/demos/web_render_3/example_render.js

Large diffs are not rendered by default.

Binary file added docs/demos/web_render_3/example_render.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions docs/demos/web_render_3/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/render/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set (target_name example_render)

set (link_options "")
if ("${yup_platform}" MATCHES "^(emscripten)$")
set (link_options --preload-file ${CMAKE_CURRENT_LIST_DIR}/data/car_interface.riv@data/car_interface.riv)
set (link_options --preload-file ${CMAKE_CURRENT_LIST_DIR}/data/alien.riv@data/alien.riv)
endif()

yup_standalone_app (
Expand Down
6 changes: 3 additions & 3 deletions examples/render/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class CustomWindow : public juce::DocumentWindow, public juce::Timer
#else
juce::File riveFilePath = juce::File (__FILE__).getParentDirectory().getSiblingFile("data");
#endif
riveFilePath = riveFilePath.getChildFile("car_interface.riv");
riveFilePath = riveFilePath.getChildFile("alien.riv");

if (riveFilePath.existsAsFile())
{
Expand Down Expand Up @@ -282,7 +282,7 @@ class CustomWindow : public juce::DocumentWindow, public juce::Timer

std::unique_ptr<rive::Scene> scene;

//scene = artboard->defaultStateMachine();
scene = artboard->defaultStateMachine();
if (scene == nullptr)
{
if (stateMachine >= 0)
Expand Down Expand Up @@ -420,7 +420,7 @@ class CustomWindow : public juce::DocumentWindow, public juce::Timer
bool disableFill = false;
bool disableStroke = false;

float framerate = 30.0f;
float framerate = 60.0f;

API api =
#if JUCE_MAC || JUCE_IOS
Expand Down
Binary file added images/web_render_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/web_render_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/web_render_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e75001d

Please sign in to comment.