package graphics

  1. Overview
  2. Docs
The OCaml graphics library

Install

Dune Dependency

Authors

Maintainers

Sources

graphics-5.1.1.tbz
sha256=286c83e3ded9287036c5e5c77b39a1dcfd73a1296b7b587937dce3900166328e
sha512=15adbe03211e7392a2fded2d9fd5e0cc2c532b4a1de3b6c90945e9e99cc4f419583a204f357f8c9fd92d1ffce48e13e1f146da1f009eb4645150b7394f799e0a

Description

The graphics library provides a set of portable drawing primitives. Drawing takes place in a separate window that is created when Graphics.open_graph is called.

This library used to be distributed with OCaml up to OCaml 4.08.

Published: 02 Feb 2021

README

Graphics

The graphics library provides a set of portable drawing primitives. Drawing takes place in a separate window that is created when Graphics.open_graph is called. It used to be distributed with OCaml up to OCaml 4.08.

Documentation

The API is documented here and as comments in the source file src/graphics.mli.

On Unix

On Unix graphics uses the X11 windows system.

Here are the graphics mode specifications supported by Graphics.open_graph on the X11 implementation of this library: the argument to Graphics.open_graph has the format "display-name geometry", where display-name is the name of the X-windows display to connect to, and geometry is a standard X-windows geometry specification. The two components are separated by a space. Either can be omitted, or both. Examples:

  • Graphics.open_graph "foo:0": connects to the display foo:0 and creates a window with the default geometry

  • Graphics.open_graph "foo:0 300x100+50-0" connects to the display foo:0 and creates a window 300 pixels wide by 100 pixels tall, at location (50,0)

  • Graphics.open_graph " 300x100+50-0" connects to the default display and creates a window 300 pixels wide by 100 pixels tall, at location (50,0)

  • Graphics.open_graph "" connects to the default display and creates a window with the default geometry.

On Windows

On Windows graphics uses the native Win32 API.

Examples

The examples/ directory contains a few examples. You can run them with:

  • dune exec examples/graph_example.exe

  • dune exec examples/graph_test.exe

  • dune exec examples/sorts.exe

Dependencies (5)

  1. ocaml >= "4.09.0~~"
  2. conf-pkg-config os != "win32"
  3. conf-libX11 os != "win32"
  4. dune-configurator
  5. dune >= "2.1"

Dev Dependencies

None

Conflicts

None