GithubHelp home page GithubHelp logo

pony-gl's Introduction

Pony GL

Attempt to convert api/GL/glcorearb.h definitions to Pony.

Version used: b9e1d1a1b37bb064a6d0e3fceffa8aeab5713a38.

Warning: experimental and un-tested, suggestions and pull-requests are welcome.

Warning: only tested on Linux, GLlibs.pony might have to be improved to support other platforms.

Usage

Add this repository as a submodule to your application:

git submodule add [email protected]:xpac27/pony-gl.git

Include this package in your Pony application:

use "pony-gl/Gl"

Start calling OpenGL methods from your Pony application:

env.out.print("GL version: " + String.from_cstring(Gl.glGetString(GLVersion())))

Or use provided helpers:

env.out.print("GL version: " + GlHelper.glGetString(GLVersion()))

You might want to using this package together with GLFW3.

Rules applied during conversion

Types

Names are preserved and mapped to Pony types.

  • GLbitfield is U32
  • GLboolean is U32
  • GLbyte is I8
  • GLchar is U8
  • GLdouble is F64
  • GLenum is U32
  • GLfloat is F32
  • GLint is I32
  • GLint64 is I64
  • GLint64EXT is I64
  • GLintptr is ISize
  • GLshort is I16
  • GLsizei is I32
  • GLsizeiptr is ISize
  • GLubyte is U8
  • GLuint is U32
  • GLuint64 is U64
  • GLuint64EXT is U64
  • GLushort is U16

Defines

Names are converted to multicase (GL_VERSION becomes GLVersion). Using primitives of type GLbitfield except for GLTrue and GLFalse that use GLboolean.

The following defines have been renamed because they confilct with the type names.

  • GLByte to GLByteType
  • GLDouble to GLDoubleType
  • GLFloat to GLFloatType
  • GLInt to GLIntType
  • GLShort to GLShortType

Functions

Pointers are treated in the following way:

  • T* arguments are replaced by Pointer[T]
  • T** arguments are replaced by Pointer[Pointer[T]]

Names are preserved but scopped inside a Gl primitive (glGetString becomes Gl.glGetString).

pony-gl's People

Contributors

xpac27 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.