Git Product home page Git Product logo

simple_gl's Introduction

Note: Currently, this project doesn't seem to work, since the OpenGL bindings aren't able to be installed due to rake incompatibilities. The opengl project seems abandoned, so it's unlikely it'll be fixed.

Since the OpenGL functions in the ruby bindings don't seem very ruby-esque, this little project aims to provide a (hopefully) nicer API to drawing with opengl.

Apart from converting camelCased methods to their underscored versions, this gem also provides glut "apps" that can be used to build small applications fairly quickly. A few examples can be found in the examples directory. The fastest way to get something on the screen would be Glut.simple_render:

require 'simple_gl'

SimpleGl::Glut.simple_render do |gl, glut|
  gl.clear
  gl.color 1, 1, 1
  gl.begin :line_loop do |gl|
    gl.vertex 0,  0,  0
    gl.vertex 0,  10, 0
    gl.vertex 10, 10, 0
    gl.vertex 10, 0,  0
  end
  glut.swap_buffers
end

This uses the given block as the OpenGL display callback, sets up some default resize and keyboard functions that should mostly work, and fires up the main loop.

simple_gl's People

Contributors

andrewradev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

brownman

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.