VIDEO sample: Putting a red pixel |
open Sdl;;
open Sdlvideo;;
init [`VIDEO];; (* only video *)
(* opening a windows 320x200 16 bpp *)
let (bpp, w, h) = (16, 320, 200);;
let screen = set_video_mode ~w ~h ~bpp [`HWSURFACE];; (* define some colors *)
(* fill screen with white color
putting a pixel in center of screen *)
fill_rect screen (map_RGB screen white);;
put_pixel screen ~x:160 ~y:100 red;;
flip screen;;
quit();;
|
|
|