Current section
14 Versions
Jump to
Current section
14 Versions
Compare versions
38
files changed
+177
additions
-166
deletions
| @@ -1,5 +1,23 @@ | |
| 1 1 | # Changelog |
| 2 2 | |
| 3 | + ## 0.11.2 |
| 4 | + |
| 5 | + * Variety of minor updates, bug fixes, and doc updates |
| 6 | + * `Scenic.Scene.assign/2` now accepts a map by @amclain in https://github.com/ScenicFramework/scenic/pull/291 |
| 7 | + * Allow `Scenic.Scene.assign_new/2` and `Scenic.Driver.assign_new/2` to take a map of values by @adkron in https://github.com/ScenicFramework/scenic/pull/293 |
| 8 | + * Update nimble_options by @axelson in https://github.com/ScenicFramework/scenic/pull/300 |
| 9 | + * Improve static assets otp_app error message by @axelson in https://github.com/ScenicFramework/scenic/pull/305 |
| 10 | + * Upgrade elixir_make and ssl_verify_fun by @ohrite in https://github.com/ScenicFramework/scenic/pull/321 |
| 11 | + |
| 12 | + ### New Contributors |
| 13 | + * @amclain made their first contribution in https://github.com/ScenicFramework/scenic/pull/291 |
| 14 | + * @adkron made their first contribution in https://github.com/ScenicFramework/scenic/pull/293 |
| 15 | + * @seb3s made their first contribution in https://github.com/ScenicFramework/scenic/pull/294 |
| 16 | + * @rkenzhebekov made their first contribution in https://github.com/ScenicFramework/scenic/pull/303 |
| 17 | + * @ohrite made their first contribution in https://github.com/ScenicFramework/scenic/pull/321 |
| 18 | + |
| 19 | + **Full Changelog**: https://github.com/ScenicFramework/scenic/compare/v0.11.1...v0.11.2 |
| 20 | + |
| 3 21 | ## 0.11.1 |
| 4 22 | * A variety of minor documentation and spec bug fixes. The most important one |
| 5 23 | fixes the docs for Primitives.arc and Primitives.sector, which did not reflect |
| @@ -354,7 +354,7 @@ nif_multiply_list(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) { | |
| 354 354 | // get the length of the list. Bail early if this fails (not a list) |
| 355 355 | if ( !enif_get_list_length(env, tail_term, &list_len) ) {return enif_make_badarg(env);} |
| 356 356 | |
| 357 | - // initilize c to identity |
| 357 | + // initialize c to identity |
| 358 358 | memcpy( product[0], matrix_identity, MATRIX_SIZE ); |
| 359 359 | |
| 360 360 | // loop the list, multiplying each array into c |
| @@ -22,7 +22,7 @@ mix archive.install hex scenic_new | |
| 22 22 | ## Build the Basic App |
| 23 23 | |
| 24 24 | First, navigate the command-line to the directory where you want to create your |
| 25 | - new Scenic app. Then run the following commands: (change `my_app` to the name |
| 25 | + new Scenic app. Then run the following commands: (change `my_app` to the name |
| 26 26 | of your app...) |
| 27 27 | |
| 28 28 | ```bash |
| @@ -36,7 +36,7 @@ If you want to explore the more full-on example, then follow the instructions be | |
| 36 36 | ## Build the Example App |
| 37 37 | |
| 38 38 | First, navigate the command-line to the directory where you want to create your |
| 39 | - new Scenic app. Then run the following commands: (change `my_app` to the name |
| 39 | + new Scenic app. Then run the following commands: (change `my_app` to the name |
| 40 40 | of your app...) |
| 41 41 | |
| 42 42 | ```bash |
| @@ -56,18 +56,18 @@ configurations should live in your app's config.exs file. | |
| 56 56 | import Config |
| 57 57 | |
| 58 58 | # Configure the main viewport for the Scenic application |
| 59 | - config :my_app, :viewport, %{ |
| 59 | + config :my_app, :viewport, [ |
| 60 60 | name: :main_viewport, |
| 61 61 | size: {700, 600}, |
| 62 62 | default_scene: MyApp.Scene.Example, |
| 63 63 | drivers: [ |
| 64 | - %{ |
| 65 | - module: Scenic.Driver.Glfw, |
| 66 | - name: :glfw, |
| 67 | - opts: [resizeable: false, title: "Example Application"], |
| 68 | - } |
| 64 | + [ |
| 65 | + module: Scenic.Driver.Local, |
| 66 | + name: :local, |
| 67 | + window: [resizeable: false, title: "Example Application"], |
| 68 | + ] |
| 69 69 | ] |
| 70 | - } |
| 70 | + ] |
| 71 71 | |
| 72 72 | Then use that config to start your supervisor with the `Scenic` supervisor. |
| @@ -105,18 +105,18 @@ configuration of a ViewPort from the config.exs file... | |
| 105 105 | import Config |
| 106 106 | |
| 107 107 | # Configure the main viewport for the Scenic application |
| 108 | - config :my_app, :viewport, %{ |
| 108 | + config :my_app, :viewport, [ |
| 109 109 | name: :main_viewport, |
| 110 110 | size: {700, 600}, |
| 111 111 | default_scene: {MyApp.Scene.Example, :scene_init_data}, |
| 112 112 | drivers: [ |
| 113 | - %{ |
| 114 | - module: Scenic.Driver.Glfw, |
| 115 | - name: :glfw, |
| 116 | - opts: [resizeable: false, title: "Example Application"], |
| 117 | - } |
| 113 | + [ |
| 114 | + module: Scenic.Driver.Local, |
| 115 | + name: :local, |
| 116 | + window: [resizeable: false, title: "Example Application"], |
| 117 | + ] |
| 118 118 | ] |
| 119 | - } |
| 119 | + ] |
| 120 120 | |
| 121 121 | The line `default_scene: {MyApp.Scene.Example, :scene_init_data}` |
| 122 122 | configures the ViewPort to always start the scene defined by the |
| @@ -33,40 +33,6 @@ At some point, depending on your target processor, you will start to have perfor | |
| 33 33 | |
| 34 34 | The good news is that as you switch away to different root scenes, all the old components are automatically cleaned up for you. |
| 35 35 | |
| 36 | - |
| 37 | - ## App Supervised Scenes |
| 38 | - |
| 39 | - If you have a component scene that is used by may other scenes, or even in multiple ViewPorts at the same time, you can save memory and reduce load by supervising those scenes yourself. |
| 40 | - |
| 41 | - To do this, create a supervisor in your application and start one or more scenes under it. You can give these scenes names, which is how you will reference them from your graphs. |
| 42 | - |
| 43 | - defmodule MyApp.Scene.Supervisor do |
| 44 | - use Supervisor |
| 45 | - |
| 46 | - def start_link() do |
| 47 | - Supervisor.start_link(__MODULE__, :ok) |
| 48 | - end |
| 49 | - |
| 50 | - def init(:ok) do |
| 51 | - children = [ |
| 52 | - {MyApp.Scene.AppScene, {:some_init_data, [name: :app_scene]}}, |
| 53 | - {Scenic.Clock.Digital, {[], [name: :clock]}} |
| 54 | - ] |
| 55 | - Supervisor.init(children, strategy: :one_for_one) |
| 56 | - end |
| 57 | - end |
| 58 | - |
| 59 | - When you build your graphs, you can now use this statically supervised scene directly through the `scene_ref/3` helper in `Scenic.Primitives`. |
| 60 | - |
| 61 | - @graph Graph.build() |
| 62 | - |> scene_ref(:app_scene, translate: {300, 300}) |
| 63 | - |> scene_ref(:clock, translate: {400, 20}) |
| 64 | - |
| 65 | - The main trade-off you make when you supervise a scene yourself is that the scene no longer knows which ViewPort it is running in. It could be several at the same time! You will not be able to use functions like `ViewPort.set_root` from these scenes. |
| 66 | - |
| 67 | - The second trade-off is that if the root scene _doesn't_ reference a scene you are supervising yourself, then that scene is still taking up memory in both the scene and the driver even though it isn't being drawn. |
| 68 | - |
| 69 | - |
| 70 36 | ## What to read next? |
| 71 37 | |
| 72 38 | If you are exploring Scenic, then you should read the [Graph Overview](overview_graph.html) next. |
Loading more files…