Skip to content

Commit

Permalink
Merge pull request #76 from crertel/v0.12.0-rc.0
Browse files Browse the repository at this point in the history
V0.12.0 rc.0
  • Loading branch information
crertel authored Jun 25, 2024
2 parents 5e2ac3f + bc54c81 commit afec655
Show file tree
Hide file tree
Showing 10 changed files with 223 additions and 153 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- elixir: '1.12.3'
otp: '24.2'
include:
- elixir: '1.16.0'
otp: '26.2'

steps:
- uses: actions/checkout@v3
Expand Down
39 changes: 37 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
## Unreleased
* Added Cairo support - @ringlej
## 0.12.0-rc.0

**Note: as of v0.12.0 we'll be requiring at least Elixir 1.16**

This is a major update that adds support for Cairo and makes Cairo the default renderer:

* Add Cairo support - @ringlej
* Restructure C code - @ringlej
* Add CI - @axelson
* Updat README for 0.12 - @axelson
* Improve text handling - @JediLuke
* Better control of scene element opacity with `:clear` background - @seb3s
* Add `input_blacklist` options to remove `InputEvent` streams - @ringlej
* Fix `script_opts_draw_line` to handle stroke properly - @ringlej
* Add arc script command - @GPrimola
* Fix `LINE_CAP_ROUND -> LINE_JOIN_ROUND` in nanovg backend - @ringlej
* Fix extra `free` in image code - @ringlej
* Fix hidden cursor on refocus and repaint for nanovg backend - @mneumann
* Fix readme typo - @seb3s
* Add FPS and debug logging - @ringlej
* Add alpha channel support for sprites - @seb3s
* Add support for rounded rectangles - @GPrimola
* Add configurable framebuffer device for cairo - @jimsynz
* Assorted updates for deprecations and warnings





Note: for Nerves setups you may need additional configuration for your display
to work as expected. If you're using an RPI3 you may want to add an `erlinit`
configuration so that your IEx output isn't displayed on the screen. To do so in your `config/target.exs` add:
```
# From: https://hexdocs.pm/nerves/1.10.5/connecting-to-a-nerves-target.html#hdmi-cable
`config :nerves, :erlinit, ctty: "ttyAMA0"`
```



## 0.11.0
Very minor fixes
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ This driver replaces both `:scenic_driver_glfw` and `:scenic_driver_nerves_rpi`

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `scenic_driver_local` to your list of dependencies in `mix.exs`:
scenic_driver_local can be installed by adding `scenic_driver_local` to your
list of dependencies in `mix.exs`:

```elixir
def deps do
[
{:scenic_driver_local, "~> 0.11.0"}
{:scenic_driver_local, "~> 0.12.0"}
]
end
```
Expand All @@ -35,9 +35,9 @@ Example:

There are quite a few new options as well. It uses `NimbleOptions` to confirm them, so look at the `Scenic.Driver.Local` module for details.

## Targets
## Targets (Nerves)

This driver figures out what underlying graphics technology to use depending on what your MIX_TARGET is set to.
This driver figures out what underlying graphics technology to use depending on what your `MIX_TARGET` environment variable is set to.

For example, for apps running on a Mac/PC/Linux, it is usually set to `host`, which causes the driver to use `cairo-gtk` as the underlying tech.

Expand All @@ -49,7 +49,10 @@ Previous versions of `scenic_driver_local` would use `bcm` (Broadcom Manager) fo
You can explicitly use these by setting `SCENIC_LOCAL_TARGET=bcm` or `SCENIC_LOCAL_TARGET=drm`, **but these options are being deprecated**.
Please try the default of `SCENIC_LOCAL_TARGET=cairo-fb` as this should work universally on any Nerves target.

`cairo-fb` will require that your `nerves_system_*` has the `cairo` library selected.
`cairo-fb` will require that your `nerves_system_*` has the `cairo` library
selected via the `BR2_PACKAGE_CAIRO=y` buildroot configuration. If you're using
one of the official nerves systems then `BR2_PACKAGE_CAIRO=y` is configured by
default if you're using 1.25.0 or greater.

## Prerequisites

Expand Down Expand Up @@ -108,6 +111,9 @@ Lastly, install the GLEW package. Find the packaged `include` folder and extract

Once these components have been installed, you should be able to build the `scenic_driver_local` driver.

### Installing on Nerves

See the "Targets" section above

## Documentation

Expand Down
54 changes: 37 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,47 @@
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (pkgs.lib) optional optionals;
pkgs = import nixpkgs { inherit system; };
let
inherit (pkgs.lib) optional optionals;
pkgs = import nixpkgs { inherit system; };

elixir = pkgs.beam.packages.erlang.elixir;
in
with pkgs;
{
devShell = pkgs.mkShell {
buildInputs = [
elixir_1_16
elixir_ls
glibcLocales
glew glfw pkg-config
xorg.libX11 xorg.libXau xorg.libXdmcp
] ++ optional stdenv.isLinux inotify-tools
elixir = pkgs.beam.packages.erlang.elixir;
in
with pkgs;
{
devShell = pkgs.mkShell {
buildInputs = [
util-linux
libselinux
libthai
libdatrie
libsepol
libxkbcommon
libepoxy
pcre
pcre2
xorg.libXtst
cairo
gtk3
freeglut
elixir_1_16
elixir_ls
glibcLocales
glew
glfw
pkg-config
xorg.libX11
xorg.libXau
xorg.libXdmcp
xorg.libX11
xorg.libXau
xorg.libXdmcp
] ++ optional stdenv.isLinux inotify-tools
++ optional stdenv.isDarwin terminal-notifier
++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
CoreFoundation
CoreServices
]);
};
});
};
});
}
18 changes: 10 additions & 8 deletions lib/callbacks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,18 @@ defmodule Scenic.Driver.Local.Callbacks do
# --------------------------------------------------------
defp do_put_scripts(%{assigns: %{port: port}, viewport: vp} = driver, ids) do
Enum.reduce(ids, driver, fn id, driver ->
with {:ok, script} <- ViewPort.get_script(vp, id) do
driver = ensure_media(script, driver)
case ViewPort.get_script(vp, id) do
{:ok, script} ->
driver = ensure_media(script, driver)

script
|> Script.serialize()
|> ToPort.put_script(id, port)
script
|> Script.serialize()
|> ToPort.put_script(id, port)

driver
else
_ -> driver
driver

_ ->
driver
end
end)
end
Expand Down
Loading

0 comments on commit afec655

Please sign in to comment.