Permalink
Browse files

Minor edits and jump to 0.60.3

  • Loading branch information...
1 parent 9f3128a commit 8f6a4e66891d524549db83b3652fc71db4864a5b @pbosetti committed Dec 20, 2011
Showing with 20 additions and 369 deletions.
  1. +14 −0 README.txt → README.md
  2. +6 −6 Rakefile
  3. +0 −11 utils/README
  4. +0 −112 utils/enumgen.rb
  5. +0 −90 utils/extlistgen.rb
  6. +0 −59 utils/mkdn2html.rb
  7. +0 −91 utils/post-mkdn2html.rb
View
@@ -1,6 +1,20 @@
ruby-opengl
===========
+Foreword (December 20, 2011)
+--------
+This is a modernization of the glorious but unmaintained ruby-opengl version, aimed at making it compatible with ruby 1.9.x series. At the moment, it successfully compiles on OS X Lion and Debian 6.0.3.
+
+Official ruby-opengl2 page is on [GitHub](https://github.com/pbosetti/ruby-opengl). The library is also available as a gem:
+
+ $ gem install ruby-opengl2
+
+To stay backward-compatible with the old gem, you stiil have to `require "ruby-opengl"`.
+
+Many thanks to the original authors.
+
+Original comments
+-----------------
[ruby-opengl][] consists of Ruby extension modules that are bindings for
the [OpenGL][], GLU, and [GLUT][] libraries. It is intended to be a
replacement for -- and uses the code from -- [Yoshi's ruby-opengl][].
View
@@ -60,17 +60,17 @@ task :test_all => [:test]
# common specification for source and binary gems
spec = Gem::Specification.new do |s|
s.name = "ruby-opengl2"
- s.version = "0.60.2"
- s.authors = [ "Alain Hoang", "Jan Dvorak", "Minh Thu Vo", "James Adam" ]
- s.homepage = "http://ruby-opengl.rubyforge.org"
- s.email = "ruby-opengl-devel@rubyforge.org"
+ s.version = "0.60.3"
+ s.authors = [ "Alain Hoang", "Jan Dvorak", "Minh Thu Vo", "James Adam", "Paolo Bosetti" ]
+ s.homepage = "http://github.com/pbosetti/ruby-opengl"
+ s.email = "p4010@me.com"
s.rubyforge_project = 'ruby-opengl2'
s.platform = Gem::Platform::RUBY
s.summary = "OpenGL Interface for Ruby"
- s.description = "OpenGL Interface for Ruby"
+ s.description = "This is a modernization of the glorious but unmaintained ruby-opengl version, aimed at making it compatible with ruby 1.9.x series. At the moment, it successfully compiles on OS X Lion and Debian 6.0.3"
s.require_path = "lib"
s.has_rdoc = false
- s.files = FileList["{lib,ext,doc,examples,test}/**/*"]
+ s.files = FileList["{lib,ext,examples,test}/**/*"]
s.extensions = ['Rakefile']
end
View
@@ -1,11 +0,0 @@
-The utils directory
--------------------
-
-* For generating website html
- * `mkdn2html.rb` -- for converting the .txt files to html.
- * `post-mkdn2html.rb` -- for the html syntax highlighting.
- * `extlistgen.rb` -- generates supported extension table from extensions.txt.in
-
-* For generating code
- * `enumgen.rb` -- fetches opengl enum .spec files from web and generates
- enumerator lists.
View
@@ -1,112 +0,0 @@
-#
-# Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
-#
-# This program is distributed under the terms of the MIT license.
-# See the included MIT-LICENSE file for the terms of this license.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# enumgen.rb - generates GL/GLU enumerators code based on enum/enumext/gluenum .spec files
-
-require 'open-uri'
-
-def parse_enum_spec(infilename)
- puts "Reading #{infilename} ..."
- enum_list = {}
- f = open(infilename,"r")
- f.each do |line|
- case line
- when /^#|:|^$/ # skip comment, directive or empty line
- next
- when /^\tuse/ # enum alias for organization purpose, we don't need that
- next
- when /^\t|^ / # enum
- # remove trailing comment (if any) and split
- name,equals,value,*rest = line.split("#")[0].split(" ")
- # true/false are special constants
- unless (name=="TRUE" or name=="FALSE")
- enum_list[name] = value
- end
- else
- puts "Unexpected line: #{line}"
- end
- end
- f.close
- enum_list
-end
-
-def write_enums(enum_list, task)
- # .h
- puts "Writing #{task[:h]}"
- File.open(task[:h], "w") do |f|
- f << "/* This file was genereated on #{Time.now}" << "\n"
- task[:sources].each do |source| f << " source: #{source}" << "\n" end
- f << "*/" << "\n\n"
- enum_list.each do |name,value|
- gl_name = task[:prefix] + name
- f << "#ifndef #{gl_name}" << "\n"
- f << "#define #{gl_name} #{value}" << "\n"
- f << "#endif" << "\n"
- end
- end
-
- # .c
- puts "Writing #{task[:c]}"
- File.open(task[:c], "w") do |f|
- f << "/* This file was genereated on #{Time.now}" << "\n"
- task[:sources].each do |source| f << " source: #{source}" << "\n" end
- f << "*/" << "\n\n"
- f << '#include "../common/common.h"' << "\n"
- f << "void #{task[:prefix].downcase}init_enums(VALUE module)" << "\n"
- f << "{" << "\n"
-
- # true/false are special constants
- f << "\trb_define_const(module, \"#{task[:prefix]}TRUE\", Qtrue);" << "\n"
- f << "\trb_define_const(module, \"#{task[:prefix]}FALSE\", Qfalse);" << "\n"
- f << "\n"
-
- enum_list.each do |name,value|
- gl_name = task[:prefix] + name
- f << "\trb_define_const(module, \"#{gl_name}\", INT2NUM(#{gl_name}));" << "\n"
- end
-
- f << "}" << "\n"
- end
-end
-
-
-# main
-begin
- gl_enums = {:c => "../ext/gl/gl-enums.c",:h => "../ext/common/gl-enums.h",
- :sources => ["http://www.opengl.org/registry/api/enum.spec",
- "http://www.opengl.org/registry/api/enumext.spec"],
- :prefix => "GL_"
- }
-
- glu_enums = {:c => "../ext/glu/glu-enums.c",:h => "../ext/common/glu-enums.h",
- :sources => "http://oss.sgi.com/cgi-bin/cvsweb.cgi/~checkout~/projects/ogl-sample/main/doc/registry/specs/enumglu.spec",
- :prefix => "GLU_"
- }
-
- task_list = [gl_enums, glu_enums]
-
- # main loop
- task_list.each do |task|
- enum_list = {}
- # gather enums from each source file/url
- task[:sources].each do |fname|
- enum_list.update(parse_enum_spec(fname))
- end
- # write to files
- write_enums(enum_list.sort,task)
- end
- puts "All OK"
-rescue
- puts $!
-end
View
@@ -1,90 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
-#
-# This program is distributed under the terms of the MIT license.
-# See the included MIT-LICENSE file for the terms of this license.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# extlistgen.rb - generates HTML table of extension support from .in file
-
-# main
-require 'csv'
-
-opengl_extdoc_url = "http://opengl.org/registry/specs/"
-
-# the extension / doc url naming is sometimes inconsistent
-link_exceptions = {
- "GL_SGIX_texture_add_env" => "SGIX/texture_env_add.txt",
- "GL_SUN_multi_draw_arrays" => "EXT/multi_draw_arrays.txt",
- "GL_SGIX_pixel_texture" => "SGIX/sgix_pixel_texture.txt",
- "GL_SGIS_fog_function" => "SGIS/fog_func.txt",
- "GL_SGIX_vertex_preclip_hint" => "SGIX/vertex_preclip.txt"
-}
-
-begin
- if ARGV.size < 3
- puts "Parameters: infile outfile version [version ...]"
- raise
- end
-
- infile,outfile,*versions = ARGV
-
- # read the list
- extensions = []
- CSV.open(infile, 'r') do |row|
- next if row[0][0] == ?# # discard comment line
- extensions << row
- end
- extensions.sort!
-
- # create output
- File.open(outfile, 'w') do |f|
- f << "<table class='extlist'>\n"
- f << "<tr>\n"
-
- # header
- f << "<th>Extension</th>\n"
- versions.each do |ver|
- f << "<th>#{ver}</th>\n"
- end
- f << "</tr>\n"
-
- # content
- extensions.each do |ext|
- next if ext[1]=="NonGL" # skip non-GL (WGL,GLX) extensions
-
- if (link_exceptions[ext[0]])
- link = opengl_extdoc_url + link_exceptions[ext[0]]
- else
- tmp, subdir, *fname = ext[0].split("_")
- link = opengl_extdoc_url + subdir + "/" + fname.join("_") + ".txt"
- end
-
- f << "<tr>\n"
- f << "<td><a href='#{link}'>#{ext[0]}</a></td>"
-
- versions.each do |ver|
- if (ext[1]=="Supported" && (ver>=ext[2]))
- f << "<td class='supported'>YES</td>"
- elsif (ext[1]=="Other")
- f << "<td class='other'>NO</td>"
- else # unsupported
- f << "<td class='unsupported'>NO</td>"
- end
- end
- f << "</tr>\n"
- end
-
- f << "</table>"
- end
-rescue
- puts $!
-end
View
@@ -1,59 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
-#
-# This program is distributed under the terms of the MIT license.
-# See the included MIT-LICENSE file for the terms of this license.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# Don't use -w for now -- too many warning re. the BlueCloth module.
-
-# Converts the named text file (containing plain text marked up with Markdown
-# markup) into a corresponding html file. The user must specify both filenames.
-# If the outfile already exists, it will be written over.
-
-require 'rubygems'
-require 'bluecloth'
-
-if ARGV.size != 2
- puts "Error: please pass exactly two args: the name of the file"
- puts "you want converted to html, and the name of the file:"
- puts "mkdn2html.rb infile.txt outfile.html"
- exit 1
-end
-
-infile_name = ARGV[0]
-outfile_name = ARGV[1]
-
-# Strip the last filename extension so we can use the basename in the
-# title of the page.
-base_filename = File.basename( infile_name, ".*" )
-puts "base_filename = #{base_filename}"
-if base_filename == 'README'
- base_filename = 'Home'
-end
-puts "base_filename = #{base_filename}"
-
-raw_markdown_text = IO.read( infile_name )
-bc = BlueCloth.new( raw_markdown_text )
-html_content = bc.to_html
-
-puts "outfile is #{File.expand_path( outfile_name )}"
-
-template_content = IO.read( './doc/supplies/page_template.html' )
-template_content.sub!( /\{\{content\}\}/, html_content )
-template_content.sub!( /\{\{title\}\}/, base_filename )
-
-
-File.open( outfile_name, 'w' ) do |file|
- file.write template_content
-end
-
-puts "Done creating plain #{base_filename} html file."
Oops, something went wrong.

0 comments on commit 8f6a4e6

Please sign in to comment.