Skip to content

Commit afcfe48

Browse files
author
Frédéric Bour
committed
fix slideshow
1 parent 887720f commit afcfe48

File tree

7 files changed

+19
-42
lines changed

7 files changed

+19
-42
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*.cmx
88
*.cmxs
99
*.cmxa
10+
.merlin
1011

1112
# ocamlbuild working directory
1213
_build/
@@ -27,6 +28,3 @@ node_modules
2728

2829
*.lock
2930
yarn-error.log
30-
31-
example/.merlin
32-
lib/.merlin

.merlin

Lines changed: 0 additions & 1 deletion
This file was deleted.

slideshow/.merlin

Lines changed: 0 additions & 33 deletions
This file was deleted.

slideshow/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
all: driver
22

33
driver:
4-
dune build driver.bc
4+
dune build driver.bc pres_state.cma
55

66
clean:
77
dune clean

slideshow/dune

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(executable
2+
(name driver)
3+
(modules mod_use slideshow driver)
4+
(libraries tgls.tgles2 tsdl findlib.dynload compiler-libs.toplevel wall)
5+
(flags :standard -linkall))
6+
7+
(library
8+
(name pres_state)
9+
(modules pres_state)
10+
(libraries wall))

slideshow/pres_state.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ let background =
44
Paint.linear_gradient ~sx:0.0 ~sy:0.0 ~ex:1024.0 ~ey:0.0
55
~inner:Color.white ~outer:(Color.with_a Color.blue 0.5)
66

7-
let mediabox = Path.make (fun ctx -> Path.rect ctx 0.0 0.0 1024.0 768.0)
7+
let mediabox = Path.make @@ fun t ->
8+
Path.rect t ~x:0.0 ~y:0.0 ~w:1024.0 ~h:768.0
89

910
let load_font name =
1011
let ic = open_in_bin name in
1112
let dim = in_channel_length ic in
1213
let fd = Unix.descr_of_in_channel ic in
1314
let buffer =
14-
Bigarray.Array1.map_file fd Bigarray.int8_unsigned Bigarray.c_layout false dim
15+
Bigarray.array1_of_genarray @@
16+
Unix.map_file fd Bigarray.int8_unsigned Bigarray.c_layout false [|dim|]
1517
in
1618
let offset = List.hd (Stb_truetype.enum buffer) in
1719
match Stb_truetype.init buffer offset with

slideshow/presentation.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[@@@ocaml.warning "-6"]
12
open Wall
23
open Wall_text
34
open Pres_state
@@ -201,7 +202,7 @@ Slideshow.set_slides Slideshow.window [
201202
Transform.scale (1.0 +. f /. 4.0) f)
202203
(Image.paint paint (Image.fill circle)))
203204
]);
204-
(fun st ->
205+
(fun _st ->
205206
let outline = Outline.make ~cap:`ROUND ~width:10.0 () in
206207
let circle = Path.make (fun ctx ->
207208
Path.circle ctx 0.0 0.0 100.0
@@ -454,7 +455,7 @@ Slideshow.set_slides Slideshow.window [
454455
code "Image.transform (skew %a %a) rect" pf sx pf sy;
455456
]);
456457
(fun _ -> api_outline `Composition);
457-
(fun st ->
458+
(fun _st ->
458459
let rect =
459460
Path.make (fun ctx -> Path.rect ctx (-120.0) (-120.0) 240.0 240.0)
460461
in

0 commit comments

Comments
 (0)