Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Draw-a-pixel/OCaml/draw-a-pixel-1.ocaml
Normal file
8
Task/Draw-a-pixel/OCaml/draw-a-pixel-1.ocaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module G = Graphics
|
||||
|
||||
let () =
|
||||
G.open_graph "";
|
||||
G.resize_window 320 240;
|
||||
G.set_color G.red;
|
||||
G.plot 100 100;
|
||||
ignore (G.read_key ())
|
||||
14
Task/Draw-a-pixel/OCaml/draw-a-pixel-2.ocaml
Normal file
14
Task/Draw-a-pixel/OCaml/draw-a-pixel-2.ocaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
open Sdl
|
||||
|
||||
let () =
|
||||
let width, height = (320, 240) in
|
||||
Sdl.init [`VIDEO];
|
||||
let window, renderer =
|
||||
Render.create_window_and_renderer ~width ~height ~flags:[]
|
||||
in
|
||||
let rgb = (255, 0, 0) and a = 255 in
|
||||
Render.set_draw_color renderer ~rgb ~a;
|
||||
Render.draw_point renderer (100, 100);
|
||||
Render.render_present renderer;
|
||||
Timer.delay 3000;
|
||||
Sdl.quit ()
|
||||
Loading…
Add table
Add a link
Reference in a new issue