All Projects → ogaml → ogaml

ogaml / ogaml

Licence: MIT license
Ocaml multimedia library

Programming Languages

ocaml
1615 projects
c
50402 projects - #5 most used programming language
objective c
16641 projects - #2 most used programming language
Makefile
30231 projects
CSS
56736 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to ogaml

VoxelGamesLib
Multi-platform, fully-featured, data-driven, abstract and expendable minecraft minigames framework
Stars: ✭ 15 (-46.43%)
Mutual labels:  multi-platform
turaku-client
Web / Electron client application for Turaku
Stars: ✭ 27 (-3.57%)
Mutual labels:  reasonml
reason-react-lazy-loading
Example project to show how to use components lazy loading in ReasonReact
Stars: ✭ 41 (+46.43%)
Mutual labels:  reasonml
refabricator
Static Site Generator for/in ReasonML
Stars: ✭ 31 (+10.71%)
Mutual labels:  reasonml
re-cite
Manage citations from your colleagues , friends, movies, your cat or even yourself.
Stars: ✭ 20 (-28.57%)
Mutual labels:  reasonml
Examples FLTK
Shows how to use Fltk controls only by programming code (c++17).
Stars: ✭ 28 (+0%)
Mutual labels:  multi-platform
pdfdir
PDF导航(大纲/目录)添加工具
Stars: ✭ 195 (+596.43%)
Mutual labels:  multi-platform
rx-reason
Reactive programming library for ReasonML/OCaml
Stars: ✭ 49 (+75%)
Mutual labels:  reasonml
bacen-exchange-rates
Reason API to fetch the daily reports from BACEN PTAX exchanges
Stars: ✭ 16 (-42.86%)
Mutual labels:  reasonml
samba
A Dockerfile to build multi-architecture images of Samba, which is the standard Windows interoperability suite of programs for Linux and Unix. This is my personal docker recipe.
Stars: ✭ 60 (+114.29%)
Mutual labels:  multi-platform
ts2re
Convert TypeScript type declarations to Reason
Stars: ✭ 32 (+14.29%)
Mutual labels:  reasonml
qompoter
Dependency manager for Qt / C++.
Stars: ✭ 19 (-32.14%)
Mutual labels:  multi-platform
reason-rust-scraper
🦀 Scraping & crawling websites using Rust, and ReasonML
Stars: ✭ 21 (-25%)
Mutual labels:  reasonml
markdown-reason-react
Generate ReasonReact Pages from Markdown
Stars: ✭ 17 (-39.29%)
Mutual labels:  reasonml
bs-dynamic-import
📦🚀 BuckleScript dynamic import interop on JavaScript environment
Stars: ✭ 31 (+10.71%)
Mutual labels:  reasonml
HitNotes
Rhythm-based mobile game
Stars: ✭ 24 (-14.29%)
Mutual labels:  multi-platform
rekernel
A minimal setup for writing Unikernels in ReasonML
Stars: ✭ 28 (+0%)
Mutual labels:  reasonml
ideas-for-project-names-starting-with-re
No description or website provided.
Stars: ✭ 27 (-3.57%)
Mutual labels:  reasonml
remachine
[WIP] Reason pattern matching viz
Stars: ✭ 44 (+57.14%)
Mutual labels:  reasonml
react-rules-of-hooks-ppx
This ppx validates the rules of React hooks.
Stars: ✭ 40 (+42.86%)
Mutual labels:  reasonml

OGaml

OCaml Game And Multimedia Library

Build Status

DISCLAIMER: This library is only in early stages and some features will probably change or be removed.

NOTE: When developping OGaml, we try to enforce the absence of undefined behaviours. We also try to hide most low-level functions, even though there are cases where we need to expose them (such as texture binding functions). If you find an error that is not catched, an undefined behaviour, or a low-level function that could have been hidden, please open an issue :-)

Presentation:

OGaml is a fast and cross-platform multimedia library for OCaml, currently supporting Windows, OSX and Linux (X11 only). It provides the following modules:

  • OgamlMath - provides mathematical functions and structures such as vectors, matrices, quaternion and polygons. This module is particularly helpful for 3D rendering (projection matrices, polygon generation, etc...).

  • OgamlCore - provides high-level window and event management and encapsulates the low-level bindings to the various window libraries (Xlib, Cocoa, etc...). Also provides various functionalities such as a logging system and manipulation of UTF8-encoded strings.

  • OgamlGraphics - provides 2D and 3D rendering functions. The aim of this module is to provide high-level, type-safe and modular bindings for most OpenGL functions, while hiding all the error-prone OpenGL API. A rule of thumb for this module is "all OpenGL errors or undefined behaviors should be catched by the type system (at best) or raise an exception". OpenGL state changes are optimised (no redundant changes) and most of the state mutability is hidden behind wrappers.

  • OgamlUtils (WIP) - provides several useful functions and data structures for game development, such as interpolators, graphs or UTF8-encoded strings.

You can find some examples in the corresponding directory as well as on the documentation http://ogaml.github.io.

Upcoming features:

  • Batch drawing optimisation

  • More image and textures types

Our ultimate goal is to add access to music, network, and to implement more helpers to make games (like physics, lighting, etc...).

Why use OGaml (rather than raw OpenGL for example)?

OGaml is safe and easy to use:

  • The functions are high-level and the API tries to be as functional as possible. This should help to avoid bugs due to mutable values, pointers, or untyped enumerations.

  • OGaml provides everything necessary to do 2D/3D rendering from window management to text rendering and vertex arrays.

  • OpenGL structures such as vertex arrays are hidden behind functional and easy to understand types that are easier to manipulate. Structures such as vertex buffers and samplers are hidden and don't have to be allocated manually.

  • OpenGL enumerations (GLenum) are binded to variant types (rather then simple integers) to provide more type safety. You should not be able to pass invalid enumerations to OpenGL functions.

  • The OpenGL state is hidden and does not have to be modified manually (no glEnable). Everything is done via function parameters such that calling the same function twice with the same parameters should give the same result (independently of what has been executed between the two calls). Moreover, all state changes are optimised such that no redundant changes are performed.

  • OGaml should detect any error or undefined behavior and at least raise an exception before it happens. This means that you don't need to call glGetError (which is quite costly).

OGaml provides advanced functionalities:

  • The module VertexArray provides a high-level and easy to use wrapper around OpenGL's vertex arrays. Unfortunately, this comes at a cost: those arrays cannot contain custom data. But you can use the module VertexMap that provides the same functionnality for custom data.

  • The module Shape provides easy manipulation of 2D shapes such as rectangles, circles or regular polygons. The module Sprite provides functions to render 2D sprites and apply various transformations to them.

  • It is easy to render 2D text of any color and size using the module Text. It also provides a way to add effects (such as moving letters, changing color, etc...) in a modular and functional way.

  • If you want to make an AAA-looking game with dozens of post-processing effects, the modules Framebuffer and Renderbuffer provide a high-level and safe way to create off-screen render targets. All the rendering functions make use of first-class modules to provide some polymorphism. This allows you to easily switch between rendering to a window or to a framebuffer.

Building and installing OGaml (OSX/Linux only):

You will need the following dependancies:

  • cppo (preprocessor, available on Opam)

  • x11 (Linux)

  • OpenGL libraries (3.0 minimum)

Then make install should do the trick. You can test it on some examples make examples or on Travis' tests make tests.

Building and installing OGaml (Windows, MSVC):

You will need the following dependencies :

  • GNU Make for Windows

  • OpenGL headers and libraries - opengl32.dll (3.0 minimum)

  • GLEW headers and libraries - glew32.dll

  • gdi32.dll and user32.dll, although these should be available by default

  • Microsoft Windows SDK

You will also need to install and configure OCaml to work with MSVC.

Finally, you will need to compile cppo (from the sources) and place the resulting .exe in your PATH, so that the compiler can access it.

Executing make install will then compile OGaml and install the library in OCaml's path. make examples will compile the examples, and make tests will run Travis's tests.

Unfortunately, make uninstall is not working on Windows (yet), so uninstalling the library should be done manually.

Redistributing OGaml executables

OGaml executables are almost standalone !

If you want to redistribute an executable, you only have to provide all the required assets (shader sources, textures, fonts, ...), and GLEW's DLL (glew32.dll) if you're redistributing a Windows executable. That's as simple as that !

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].