opengl 0.7.0.pre1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/.gitignore +8 -0
- data/History.txt +36 -0
- data/MIT-LICENSE +18 -0
- data/Manifest.txt +140 -0
- data/README.rdoc +51 -0
- data/Rakefile +129 -0
- data/Rakefile.cross +104 -0
- data/doc/build_install.txt +119 -0
- data/doc/extensions.txt.in +348 -0
- data/doc/history.txt +66 -0
- data/doc/requirements_and_design.txt +117 -0
- data/doc/roadmap.txt +28 -0
- data/doc/scientific_use.txt +35 -0
- data/doc/supplies/page_template.html +71 -0
- data/doc/thanks.txt +29 -0
- data/doc/tutorial.txt +469 -0
- data/examples/NeHe/nehe_lesson02.rb +117 -0
- data/examples/NeHe/nehe_lesson03.rb +122 -0
- data/examples/NeHe/nehe_lesson04.rb +133 -0
- data/examples/NeHe/nehe_lesson05.rb +186 -0
- data/examples/NeHe/nehe_lesson36.rb +303 -0
- data/examples/OrangeBook/3Dlabs-License.txt +33 -0
- data/examples/OrangeBook/brick.frag +36 -0
- data/examples/OrangeBook/brick.rb +376 -0
- data/examples/OrangeBook/brick.vert +41 -0
- data/examples/OrangeBook/particle.frag +17 -0
- data/examples/OrangeBook/particle.rb +406 -0
- data/examples/OrangeBook/particle.vert +38 -0
- data/examples/README +16 -0
- data/examples/RedBook/aapoly.rb +142 -0
- data/examples/RedBook/aargb.rb +119 -0
- data/examples/RedBook/accanti.rb +162 -0
- data/examples/RedBook/accpersp.rb +215 -0
- data/examples/RedBook/alpha.rb +123 -0
- data/examples/RedBook/alpha3D.rb +158 -0
- data/examples/RedBook/bezcurve.rb +105 -0
- data/examples/RedBook/bezmesh.rb +137 -0
- data/examples/RedBook/checker.rb +124 -0
- data/examples/RedBook/clip.rb +95 -0
- data/examples/RedBook/colormat.rb +135 -0
- data/examples/RedBook/cube.rb +69 -0
- data/examples/RedBook/depthcue.rb +99 -0
- data/examples/RedBook/dof.rb +205 -0
- data/examples/RedBook/double.rb +105 -0
- data/examples/RedBook/drawf.rb +91 -0
- data/examples/RedBook/feedback.rb +145 -0
- data/examples/RedBook/fog.rb +167 -0
- data/examples/RedBook/font.rb +151 -0
- data/examples/RedBook/hello.rb +79 -0
- data/examples/RedBook/image.rb +137 -0
- data/examples/RedBook/jitter.rb +207 -0
- data/examples/RedBook/lines.rb +128 -0
- data/examples/RedBook/list.rb +111 -0
- data/examples/RedBook/material.rb +275 -0
- data/examples/RedBook/mipmap.rb +156 -0
- data/examples/RedBook/model.rb +113 -0
- data/examples/RedBook/movelight.rb +132 -0
- data/examples/RedBook/pickdepth.rb +179 -0
- data/examples/RedBook/planet.rb +108 -0
- data/examples/RedBook/quadric.rb +158 -0
- data/examples/RedBook/robot.rb +115 -0
- data/examples/RedBook/select.rb +196 -0
- data/examples/RedBook/smooth.rb +95 -0
- data/examples/RedBook/stencil.rb +163 -0
- data/examples/RedBook/stroke.rb +167 -0
- data/examples/RedBook/surface.rb +166 -0
- data/examples/RedBook/teaambient.rb +132 -0
- data/examples/RedBook/teapots.rb +182 -0
- data/examples/RedBook/tess.rb +183 -0
- data/examples/RedBook/texbind.rb +147 -0
- data/examples/RedBook/texgen.rb +169 -0
- data/examples/RedBook/texturesurf.rb +128 -0
- data/examples/RedBook/varray.rb +159 -0
- data/examples/RedBook/wrap.rb +148 -0
- data/examples/misc/OGLBench.rb +337 -0
- data/examples/misc/anisotropic.rb +194 -0
- data/examples/misc/fbo_test.rb +356 -0
- data/examples/misc/font-glut.rb +46 -0
- data/examples/misc/glfwtest.rb +30 -0
- data/examples/misc/plane.rb +161 -0
- data/examples/misc/readpixel.rb +65 -0
- data/examples/misc/sdltest.rb +34 -0
- data/examples/misc/trislam.rb +828 -0
- data/ext/common/common.h +448 -0
- data/ext/common/conv.h +234 -0
- data/ext/common/funcdef.h +280 -0
- data/ext/common/gl-enums.h +10031 -0
- data/ext/common/gl-error.h +23 -0
- data/ext/common/gl-types.h +67 -0
- data/ext/common/glu-enums.h +463 -0
- data/ext/gl/extconf.rb +43 -0
- data/ext/gl/gl-1.0-1.1.c +2811 -0
- data/ext/gl/gl-1.2.c +814 -0
- data/ext/gl/gl-1.3.c +443 -0
- data/ext/gl/gl-1.4.c +348 -0
- data/ext/gl/gl-1.5.c +225 -0
- data/ext/gl/gl-2.0.c +657 -0
- data/ext/gl/gl-2.1.c +57 -0
- data/ext/gl/gl-enums.c +3354 -0
- data/ext/gl/gl-error.c +104 -0
- data/ext/gl/gl-ext-3dfx.c +27 -0
- data/ext/gl/gl-ext-arb.c +866 -0
- data/ext/gl/gl-ext-ati.c +41 -0
- data/ext/gl/gl-ext-ext.c +889 -0
- data/ext/gl/gl-ext-gremedy.c +41 -0
- data/ext/gl/gl-ext-nv.c +679 -0
- data/ext/gl/gl.c +216 -0
- data/ext/glu/extconf.rb +51 -0
- data/ext/glu/glu-enums.c +164 -0
- data/ext/glu/glu.c +1530 -0
- data/ext/glut/extconf.rb +67 -0
- data/ext/glut/glut.c +1624 -0
- data/lib/opengl.rb +89 -0
- data/test/README +10 -0
- data/test/tc_common.rb +98 -0
- data/test/tc_ext_arb.rb +467 -0
- data/test/tc_ext_ati.rb +33 -0
- data/test/tc_ext_ext.rb +551 -0
- data/test/tc_ext_gremedy.rb +36 -0
- data/test/tc_ext_nv.rb +357 -0
- data/test/tc_func_10_11.rb +1281 -0
- data/test/tc_func_12.rb +186 -0
- data/test/tc_func_13.rb +229 -0
- data/test/tc_func_14.rb +197 -0
- data/test/tc_func_15.rb +270 -0
- data/test/tc_func_20.rb +346 -0
- data/test/tc_func_21.rb +541 -0
- data/test/tc_glu.rb +310 -0
- data/test/tc_include_gl.rb +35 -0
- data/test/tc_misc.rb +54 -0
- data/test/tc_require_gl.rb +34 -0
- data/utils/README +11 -0
- data/utils/enumgen.rb +112 -0
- data/utils/extlistgen.rb +90 -0
- data/utils/mkdn2html.rb +59 -0
- data/utils/post-mkdn2html.rb +91 -0
- data/website/images/ogl.jpg +0 -0
- data/website/images/tab_bottom.gif +0 -0
- data/website/style.css +198 -0
- metadata +274 -0
data/.gemtest
ADDED
File without changes
|
data/.gitignore
ADDED
data/History.txt
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
=== 0.7.0 / HEAD
|
2
|
+
|
3
|
+
* Switch to Hoe and rake-compiler
|
4
|
+
* Add cross compilation of fat binary gems for Windows with freeglut
|
5
|
+
* Replace mkrf with extconf.rb
|
6
|
+
* Add the proper conversions from 64 bit types to 32 bit types, or uses 64 bit types
|
7
|
+
when no conversion to 32 bits is required
|
8
|
+
* Replace version checks for feature checks. No more -DRUBY_VERSION or -DWIN32
|
9
|
+
* Removes redefinition of NUM2* in ext/common/common.h
|
10
|
+
* Switch to dlopen() from deprecated NSAddImage() and friends for OS X
|
11
|
+
* Fix bug in glut_TabletButtonFuncCallback that did not include the function to call
|
12
|
+
* Fix bug in ARY2CMAT macro which wanted 5 arguments but only used and was called with 4
|
13
|
+
|
14
|
+
=== 0.60.1 / 2009-02-16
|
15
|
+
|
16
|
+
This is maintenance release.
|
17
|
+
|
18
|
+
* Bugfixes
|
19
|
+
* Proper support for ruby 1.9/1.9.1+
|
20
|
+
* Updated OpenGL enumerators in preparation for OpenGL 3.0
|
21
|
+
|
22
|
+
=== 0.60.0 / 2008-01-06
|
23
|
+
|
24
|
+
* Automatic error checking for GL/GLU calls, enabled by default (see doc/tutorial)
|
25
|
+
* Added support for many more OpenGL extensions
|
26
|
+
* Support for Ruby 1.9.0+ (requires mkrf 0.2.3)
|
27
|
+
* Ton of bugfixes.<br><br>
|
28
|
+
|
29
|
+
==== API Changes
|
30
|
+
* Boolean functions/parameters was changed to ruby true/false instead of GL\_TRUE / GL\_FALSE, which remains for compatibility
|
31
|
+
* glGet\* functions now returns x instead of [x] when returning only one value
|
32
|
+
* Functions operating on packed strings (glTexture, gl\*Pointer etc.) now also accepts ruby arrays directly
|
33
|
+
* Matrix handling functions now also accepts instances of Matrix class, or any class that can be converted to array
|
34
|
+
* glUniform\*v and glUniformmatrix\*v now does not require 'count' parameter, they will calculate it from length of passed array
|
35
|
+
* glCallLists needs type specifier (previously was forced to GL_BYTE)
|
36
|
+
* On ruby 1.9, glut keyboard callback returns char ("x") instead of integer so using 'if key == ?x' works on both 1.8 and 1.9
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
3
|
+
copy of this software and associated documentation files (the "Software"),
|
4
|
+
to deal in the Software without restriction, including without limitation
|
5
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
6
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
7
|
+
Software is furnished to do so, subject to the following conditions:
|
8
|
+
|
9
|
+
The above copyright notice and this permission notice shall be included in
|
10
|
+
all copies or substantial portions of the Software.
|
11
|
+
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
17
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
18
|
+
DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
.gemtest
|
2
|
+
.gitignore
|
3
|
+
History.txt
|
4
|
+
MIT-LICENSE
|
5
|
+
Manifest.txt
|
6
|
+
README.rdoc
|
7
|
+
Rakefile
|
8
|
+
Rakefile.cross
|
9
|
+
doc/build_install.txt
|
10
|
+
doc/extensions.txt.in
|
11
|
+
doc/history.txt
|
12
|
+
doc/requirements_and_design.txt
|
13
|
+
doc/roadmap.txt
|
14
|
+
doc/scientific_use.txt
|
15
|
+
doc/supplies/page_template.html
|
16
|
+
doc/thanks.txt
|
17
|
+
doc/tutorial.txt
|
18
|
+
examples/NeHe/nehe_lesson02.rb
|
19
|
+
examples/NeHe/nehe_lesson03.rb
|
20
|
+
examples/NeHe/nehe_lesson04.rb
|
21
|
+
examples/NeHe/nehe_lesson05.rb
|
22
|
+
examples/NeHe/nehe_lesson36.rb
|
23
|
+
examples/OrangeBook/3Dlabs-License.txt
|
24
|
+
examples/OrangeBook/brick.frag
|
25
|
+
examples/OrangeBook/brick.rb
|
26
|
+
examples/OrangeBook/brick.vert
|
27
|
+
examples/OrangeBook/particle.frag
|
28
|
+
examples/OrangeBook/particle.rb
|
29
|
+
examples/OrangeBook/particle.vert
|
30
|
+
examples/README
|
31
|
+
examples/RedBook/aapoly.rb
|
32
|
+
examples/RedBook/aargb.rb
|
33
|
+
examples/RedBook/accanti.rb
|
34
|
+
examples/RedBook/accpersp.rb
|
35
|
+
examples/RedBook/alpha.rb
|
36
|
+
examples/RedBook/alpha3D.rb
|
37
|
+
examples/RedBook/bezcurve.rb
|
38
|
+
examples/RedBook/bezmesh.rb
|
39
|
+
examples/RedBook/checker.rb
|
40
|
+
examples/RedBook/clip.rb
|
41
|
+
examples/RedBook/colormat.rb
|
42
|
+
examples/RedBook/cube.rb
|
43
|
+
examples/RedBook/depthcue.rb
|
44
|
+
examples/RedBook/dof.rb
|
45
|
+
examples/RedBook/double.rb
|
46
|
+
examples/RedBook/drawf.rb
|
47
|
+
examples/RedBook/feedback.rb
|
48
|
+
examples/RedBook/fog.rb
|
49
|
+
examples/RedBook/font.rb
|
50
|
+
examples/RedBook/hello.rb
|
51
|
+
examples/RedBook/image.rb
|
52
|
+
examples/RedBook/jitter.rb
|
53
|
+
examples/RedBook/lines.rb
|
54
|
+
examples/RedBook/list.rb
|
55
|
+
examples/RedBook/material.rb
|
56
|
+
examples/RedBook/mipmap.rb
|
57
|
+
examples/RedBook/model.rb
|
58
|
+
examples/RedBook/movelight.rb
|
59
|
+
examples/RedBook/pickdepth.rb
|
60
|
+
examples/RedBook/planet.rb
|
61
|
+
examples/RedBook/quadric.rb
|
62
|
+
examples/RedBook/robot.rb
|
63
|
+
examples/RedBook/select.rb
|
64
|
+
examples/RedBook/smooth.rb
|
65
|
+
examples/RedBook/stencil.rb
|
66
|
+
examples/RedBook/stroke.rb
|
67
|
+
examples/RedBook/surface.rb
|
68
|
+
examples/RedBook/teaambient.rb
|
69
|
+
examples/RedBook/teapots.rb
|
70
|
+
examples/RedBook/tess.rb
|
71
|
+
examples/RedBook/texbind.rb
|
72
|
+
examples/RedBook/texgen.rb
|
73
|
+
examples/RedBook/texturesurf.rb
|
74
|
+
examples/RedBook/varray.rb
|
75
|
+
examples/RedBook/wrap.rb
|
76
|
+
examples/misc/OGLBench.rb
|
77
|
+
examples/misc/anisotropic.rb
|
78
|
+
examples/misc/fbo_test.rb
|
79
|
+
examples/misc/font-glut.rb
|
80
|
+
examples/misc/glfwtest.rb
|
81
|
+
examples/misc/plane.rb
|
82
|
+
examples/misc/readpixel.rb
|
83
|
+
examples/misc/sdltest.rb
|
84
|
+
examples/misc/trislam.rb
|
85
|
+
ext/common/common.h
|
86
|
+
ext/common/conv.h
|
87
|
+
ext/common/funcdef.h
|
88
|
+
ext/common/gl-enums.h
|
89
|
+
ext/common/gl-error.h
|
90
|
+
ext/common/gl-types.h
|
91
|
+
ext/common/glu-enums.h
|
92
|
+
ext/gl/extconf.rb
|
93
|
+
ext/gl/gl-1.0-1.1.c
|
94
|
+
ext/gl/gl-1.2.c
|
95
|
+
ext/gl/gl-1.3.c
|
96
|
+
ext/gl/gl-1.4.c
|
97
|
+
ext/gl/gl-1.5.c
|
98
|
+
ext/gl/gl-2.0.c
|
99
|
+
ext/gl/gl-2.1.c
|
100
|
+
ext/gl/gl-enums.c
|
101
|
+
ext/gl/gl-error.c
|
102
|
+
ext/gl/gl-ext-3dfx.c
|
103
|
+
ext/gl/gl-ext-arb.c
|
104
|
+
ext/gl/gl-ext-ati.c
|
105
|
+
ext/gl/gl-ext-ext.c
|
106
|
+
ext/gl/gl-ext-gremedy.c
|
107
|
+
ext/gl/gl-ext-nv.c
|
108
|
+
ext/gl/gl.c
|
109
|
+
ext/glu/extconf.rb
|
110
|
+
ext/glu/glu-enums.c
|
111
|
+
ext/glu/glu.c
|
112
|
+
ext/glut/extconf.rb
|
113
|
+
ext/glut/glut.c
|
114
|
+
lib/opengl.rb
|
115
|
+
test/README
|
116
|
+
test/tc_common.rb
|
117
|
+
test/tc_ext_arb.rb
|
118
|
+
test/tc_ext_ati.rb
|
119
|
+
test/tc_ext_ext.rb
|
120
|
+
test/tc_ext_gremedy.rb
|
121
|
+
test/tc_ext_nv.rb
|
122
|
+
test/tc_func_10_11.rb
|
123
|
+
test/tc_func_12.rb
|
124
|
+
test/tc_func_13.rb
|
125
|
+
test/tc_func_14.rb
|
126
|
+
test/tc_func_15.rb
|
127
|
+
test/tc_func_20.rb
|
128
|
+
test/tc_func_21.rb
|
129
|
+
test/tc_glu.rb
|
130
|
+
test/tc_include_gl.rb
|
131
|
+
test/tc_misc.rb
|
132
|
+
test/tc_require_gl.rb
|
133
|
+
utils/README
|
134
|
+
utils/enumgen.rb
|
135
|
+
utils/extlistgen.rb
|
136
|
+
utils/mkdn2html.rb
|
137
|
+
utils/post-mkdn2html.rb
|
138
|
+
website/images/ogl.jpg
|
139
|
+
website/images/tab_bottom.gif
|
140
|
+
website/style.css
|
data/README.rdoc
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
= Ruby-OpenGL
|
2
|
+
|
3
|
+
* http://github.com/larskanis
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Ruby-OpenGL consists of Ruby extension modules that are bindings for
|
8
|
+
the OpenGL, GLU, and GLUT libraries.
|
9
|
+
|
10
|
+
|
11
|
+
== FEATURES/PROBLEMS:
|
12
|
+
|
13
|
+
* available for Windows, Linux, OS-X
|
14
|
+
* supports Ruby MRI 1.8/1.9 and Rubinius
|
15
|
+
|
16
|
+
== SYNOPSIS:
|
17
|
+
|
18
|
+
require 'opengl'
|
19
|
+
|
20
|
+
|
21
|
+
== REQUIREMENTS:
|
22
|
+
|
23
|
+
* proper OpenGL, GLU and (free-)GLUT development files installed
|
24
|
+
|
25
|
+
== INSTALL:
|
26
|
+
|
27
|
+
* gem install opengl
|
28
|
+
|
29
|
+
== LICENSE:
|
30
|
+
|
31
|
+
The MIT License
|
32
|
+
|
33
|
+
ruby-opengl
|
34
|
+
===========
|
35
|
+
|
36
|
+
[ruby-opengl][] consists of Ruby extension modules that are bindings for
|
37
|
+
the [OpenGL][], GLU, and [GLUT][] libraries. It is intended to be a
|
38
|
+
replacement for -- and uses the code from -- [Yoshi's ruby-opengl][].
|
39
|
+
|
40
|
+
It's licensed under the MIT license. Please see the included MIT-LICENSE
|
41
|
+
file for the terms of the license.
|
42
|
+
|
43
|
+
|
44
|
+
[ruby-opengl]: http://rubyforge.org/projects/ruby-opengl/
|
45
|
+
[OpenGL]: http://www.opengl.org/
|
46
|
+
[GLUT]: http://www.opengl.org/documentation/specs/glut/spec3/spec3.html
|
47
|
+
|
48
|
+
|
49
|
+
[Yoshi's ruby-opengl]: http://www2.giganet.net/~yoshi/
|
50
|
+
|
51
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
#-*-ruby-*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
|
4
|
+
#
|
5
|
+
# This program is distributed under the terms of the MIT license.
|
6
|
+
# See the included MIT-LICENSE file for the terms of this license.
|
7
|
+
#
|
8
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
9
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
10
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
11
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
12
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
13
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
14
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
15
|
+
|
16
|
+
require 'rubygems'
|
17
|
+
|
18
|
+
require 'rake'
|
19
|
+
require 'rake/extensiontask'
|
20
|
+
require 'rake/clean'
|
21
|
+
require 'rubygems/package_task'
|
22
|
+
require 'rake/testtask'
|
23
|
+
require 'hoe'
|
24
|
+
load 'Rakefile.cross'
|
25
|
+
|
26
|
+
# Generate html docs from the markdown source and upload to the site.
|
27
|
+
# All doc files that are destined for the website have filenames that
|
28
|
+
# end in .txt.
|
29
|
+
|
30
|
+
WEBSITE_MKDN = FileList['./doc/*.txt'] << 'README.txt'
|
31
|
+
NICE_HTML_DOCS = WEBSITE_MKDN.ext('html')
|
32
|
+
|
33
|
+
# defines columns in the HTML extension list
|
34
|
+
GLEXT_VERSIONS = ["svn","0.60","0.50"]
|
35
|
+
|
36
|
+
CLEAN.include("ext/gl*/Rakefile", "ext/*/mkrf.log", "ext/*/*.so",
|
37
|
+
"ext/**/*.bundle", "lib/*.so", "lib/*.bundle", "ext/*/*.o{,bj}",
|
38
|
+
"ext/*/*.lib", "ext/*/*.exp", "ext/*/*.pdb",
|
39
|
+
"pkg")
|
40
|
+
CLOBBER.include("*.plain", "doc/*.plain", "doc/*.snip", "*.html",
|
41
|
+
"doc/*.html", "website/*.html", "website/images/*")
|
42
|
+
# Make sure these files aren't deleted in a clobber op
|
43
|
+
CLOBBER.exclude("website/images/tab_bottom.gif")
|
44
|
+
CLOBBER.exclude("website/images/*.jpg")
|
45
|
+
|
46
|
+
desc 'Show contents of some variables related to website doc generation.'
|
47
|
+
task :explain_website do
|
48
|
+
puts "WEBSITE_MKDN:"
|
49
|
+
WEBSITE_MKDN.each do |doc|
|
50
|
+
puts "\t#{doc}"
|
51
|
+
end
|
52
|
+
puts "NICE_HTML_DOCS:"
|
53
|
+
NICE_HTML_DOCS.each do |doc|
|
54
|
+
puts "\t#{doc}"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
desc 'Generate supported extension list.'
|
59
|
+
task :gen_glext_list do
|
60
|
+
sh "./utils/extlistgen.rb doc/extensions.txt.in doc/extensions.txt " + GLEXT_VERSIONS.join(" ")
|
61
|
+
end
|
62
|
+
|
63
|
+
desc 'Generate website html.'
|
64
|
+
task :gen_website => [:gen_glext_list] + NICE_HTML_DOCS do
|
65
|
+
# Now that the website docs have been generated, copy them to ./website.
|
66
|
+
puts
|
67
|
+
sh "cp README.html website/index.html"
|
68
|
+
sh "cp doc/*.html website"
|
69
|
+
end
|
70
|
+
|
71
|
+
# You'll see some intermediate .plain files get generated. These are html,
|
72
|
+
# but don't yet have their code snippets syntax highlighted.
|
73
|
+
rule '.html' => '.plain' do |t|
|
74
|
+
puts "Turning #{t.source} into #{t.name} ..."
|
75
|
+
sh "./utils/post-mkdn2html.rb #{t.source} #{t.name}"
|
76
|
+
end
|
77
|
+
|
78
|
+
# Process the markdown docs into plain html.
|
79
|
+
rule '.plain' => '.txt' do |t|
|
80
|
+
puts
|
81
|
+
puts "Turning #{t.source} into #{t.name} ..."
|
82
|
+
sh "./utils/mkdn2html.rb #{t.source} #{t.name}"
|
83
|
+
end
|
84
|
+
|
85
|
+
desc 'Upload the newly-built site to RubyForge.'
|
86
|
+
task :upload_website => [:gen_website] do
|
87
|
+
sh "scp website/*.html hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl"
|
88
|
+
sh "scp website/images/* hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl/images/"
|
89
|
+
end
|
90
|
+
|
91
|
+
desc 'Upload entire site, including stylesheet and the images directory.'
|
92
|
+
task :upload_entire_website => [:gen_website] do
|
93
|
+
sh "scp website/*.html hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl"
|
94
|
+
sh "scp website/*.css hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl"
|
95
|
+
sh "scp -r website/images hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl"
|
96
|
+
end
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
############# gems #############
|
102
|
+
|
103
|
+
|
104
|
+
hoe = Hoe.spec "opengl" do
|
105
|
+
self.author = [ "Alain Hoang", "Jan Dvorak", "Minh Thu Vo", "James Adam" ]
|
106
|
+
self.email = "ruby-opengl-devel@rubyforge.org"
|
107
|
+
self.url = "http://ruby-opengl.rubyforge.org"
|
108
|
+
self.rubyforge_name = 'ruby-opengl'
|
109
|
+
self.version = IO.read("ext/gl/gl.c")[/VERSION += +([\"\'])([\d][\w\.]+)\1/] && $2
|
110
|
+
self.local_rdoc_dir = 'rdoc'
|
111
|
+
self.readme_file = 'README.rdoc'
|
112
|
+
self.extra_rdoc_files << self.readme_file
|
113
|
+
|
114
|
+
spec_extras[:extensions] = ['ext/gl/extconf.rb', 'ext/glu/extconf.rb', 'ext/glut/extconf.rb']
|
115
|
+
extra_dev_deps << ['rake-compiler', '>= 0.8']
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
ext_block = proc do |ext|
|
120
|
+
ext.cross_compile = true
|
121
|
+
ext.cross_platform = ['i386-mingw32']
|
122
|
+
ext.cross_config_options += [
|
123
|
+
"--with-installed-dir=#{STATIC_INSTALLDIR}",
|
124
|
+
]
|
125
|
+
end
|
126
|
+
|
127
|
+
Rake::ExtensionTask.new 'gl', hoe.spec, &ext_block
|
128
|
+
Rake::ExtensionTask.new 'glu', hoe.spec, &ext_block
|
129
|
+
Rake::ExtensionTask.new 'glut', hoe.spec, &ext_block
|
data/Rakefile.cross
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# -*- ruby -*-
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
require 'hoe'
|
6
|
+
require 'rake/extensiontask'
|
7
|
+
require 'rake/extensioncompiler'
|
8
|
+
require 'uri'
|
9
|
+
require 'rbconfig'
|
10
|
+
require 'pathname'
|
11
|
+
|
12
|
+
ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3'
|
13
|
+
|
14
|
+
# Cross-compilation constants
|
15
|
+
COMPILE_HOME = Pathname( "build" ).expand_path
|
16
|
+
STATIC_SOURCESDIR = COMPILE_HOME + 'sources'
|
17
|
+
STATIC_BUILDDIR = COMPILE_HOME + 'builds'
|
18
|
+
STATIC_INSTALLDIR = COMPILE_HOME + 'install'
|
19
|
+
RUBY_BUILD = RbConfig::CONFIG["host"]
|
20
|
+
CROSS_PREFIX = begin
|
21
|
+
Rake::ExtensionCompiler.mingw_host
|
22
|
+
rescue => err
|
23
|
+
$stderr.puts "Cross-compilation disabled -- %s" % [ err.message ]
|
24
|
+
'unknown'
|
25
|
+
end
|
26
|
+
|
27
|
+
NUM_CPUS = if File.exist?('/proc/cpuinfo')
|
28
|
+
File.read('/proc/cpuinfo').scan('processor').length
|
29
|
+
elsif RUBY_PLATFORM.include?( 'darwin' )
|
30
|
+
`system_profiler SPHardwareDataType | grep 'Cores' | awk '{print $5}'`.chomp
|
31
|
+
else
|
32
|
+
1
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
# Fetch libfreeglut tarball
|
37
|
+
LIBFREEGLUT_VERSION = ENV['LIBFREEGLUT_VERSION'] || '2.8.0'
|
38
|
+
LIBFREEGLUT_SOURCE_URI = URI( "http://downloads.sourceforge.net/project/freeglut/freeglut/#{LIBFREEGLUT_VERSION}/freeglut-#{LIBFREEGLUT_VERSION}.tar.gz" )
|
39
|
+
LIBFREEGLUT_TARBALL = STATIC_SOURCESDIR + File.basename( LIBFREEGLUT_SOURCE_URI.path )
|
40
|
+
STATIC_LIBFREEGLUT_BUILDDIR = STATIC_BUILDDIR + LIBFREEGLUT_TARBALL.basename(".tar.gz")
|
41
|
+
LIBFREEGLUT_MAKEFILE = STATIC_LIBFREEGLUT_BUILDDIR + 'Makefile'
|
42
|
+
LIBFREEGLUT_A = STATIC_INSTALLDIR + 'lib' + 'libglut.a'
|
43
|
+
|
44
|
+
|
45
|
+
# clean intermediate files and folders
|
46
|
+
CLEAN.include( STATIC_BUILDDIR.to_s )
|
47
|
+
|
48
|
+
#####################################################################
|
49
|
+
### C R O S S - C O M P I L A T I O N - T A S K S
|
50
|
+
#####################################################################
|
51
|
+
|
52
|
+
|
53
|
+
directory STATIC_SOURCESDIR.to_s
|
54
|
+
|
55
|
+
#
|
56
|
+
# Static libfreeglut build tasks
|
57
|
+
#
|
58
|
+
directory STATIC_LIBFREEGLUT_BUILDDIR.to_s
|
59
|
+
|
60
|
+
# libfreeglut source file should be stored there
|
61
|
+
file LIBFREEGLUT_TARBALL => STATIC_SOURCESDIR do |t|
|
62
|
+
# download the source file using wget or curl
|
63
|
+
chdir File.dirname(t.name) do
|
64
|
+
sh "wget '#{LIBFREEGLUT_SOURCE_URI}' -O #{LIBFREEGLUT_TARBALL}"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Extract the libfreeglut builds
|
69
|
+
file STATIC_LIBFREEGLUT_BUILDDIR => LIBFREEGLUT_TARBALL do |t|
|
70
|
+
sh 'tar', '-xzf', LIBFREEGLUT_TARBALL.to_s, '-C', STATIC_LIBFREEGLUT_BUILDDIR.parent.to_s
|
71
|
+
end
|
72
|
+
|
73
|
+
LIBFREEGLUT_ENV = [
|
74
|
+
"'CPPFLAGS=-I#{STATIC_INSTALLDIR}/include'",
|
75
|
+
"'LDFLAGS=-L#{STATIC_INSTALLDIR}/lib'",
|
76
|
+
]
|
77
|
+
# generate the makefile in a clean build location
|
78
|
+
file LIBFREEGLUT_MAKEFILE => [STATIC_LIBFREEGLUT_BUILDDIR] do |t|
|
79
|
+
Dir.chdir( STATIC_LIBFREEGLUT_BUILDDIR ) do
|
80
|
+
options = [
|
81
|
+
"--target=#{CROSS_PREFIX}",
|
82
|
+
"--host=#{CROSS_PREFIX}",
|
83
|
+
"--build=#{RUBY_BUILD}",
|
84
|
+
"--prefix=#{STATIC_INSTALLDIR}",
|
85
|
+
"--enable-static",
|
86
|
+
]
|
87
|
+
|
88
|
+
configure_path = STATIC_LIBFREEGLUT_BUILDDIR + 'configure'
|
89
|
+
sh "env #{[LIBFREEGLUT_ENV, configure_path.to_s, *options].join(" ")}"
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# generate the makefile in a clean build location
|
94
|
+
task LIBFREEGLUT_A => [LIBFREEGLUT_MAKEFILE] do |t|
|
95
|
+
Dir.chdir( STATIC_LIBFREEGLUT_BUILDDIR ) do
|
96
|
+
sh "make -j#{NUM_CPUS} install"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
desc "compile static libraries"
|
101
|
+
task :static_libs => [ LIBFREEGLUT_A ]
|
102
|
+
|
103
|
+
desc 'cross compile required libs for win32'
|
104
|
+
task :cross => [ :static_libs ]
|