package graphics

All checked builds pass
  1. Overview
  2. Docs
The OCaml graphics library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

5.2.0.tar.gz
sha256=baa99f5316c26df0844ee68921f531e554aab7ea2a1c881f30bd8365309077b0
sha512=3a9a534b438aff86fd7ac83b394ae118e79538dcce7787e587039310b6e8fd9b352cadd54392c6190bbf8127e227bcefec1902c714ed2dc987a6e5694170b6b4

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.

Added to opam-repository:

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.

Screenshot

Documentation

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

On Linux, macOS, and other Unix systems

The Graphics library uses the X11 windows system. macOS users need to install XQuartz.

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, the Graphics library uses the native Win32 API.

Examples

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

  • dune exec examples/sorts.exe
  • dune exec examples/graph_example.exe
  • dune exec examples/graph_test.exe
  • dune exec examples/fonts.exe

Dependencies (6)

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

Dev Dependencies

None

Optional Dependencies

None

Conflicts

None

Build status

Results of building graphics with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
5.2.0 (this version) n/a good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure