opengl 0.7.0.pre1 → 0.7.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +29 -0
- data/.gitignore +5 -8
- data/History.rdoc +33 -0
- data/Manifest.txt +72 -57
- data/README.rdoc +72 -25
- data/Rakefile +60 -72
- data/Rakefile.cross +5 -2
- data/{doc → docs}/build_install.txt +0 -0
- data/{doc → docs}/extensions.txt.in +0 -0
- data/{doc → docs}/history.txt +0 -0
- data/{doc → docs}/requirements_and_design.txt +0 -0
- data/{doc → docs}/roadmap.txt +0 -0
- data/{doc → docs}/scientific_use.txt +0 -0
- data/{doc → docs}/supplies/page_template.html +0 -0
- data/{doc → docs}/thanks.txt +0 -0
- data/{doc → docs}/tutorial.txt +0 -0
- data/examples/NeHe/NeHe.png +0 -0
- data/examples/NeHe/crate.png +0 -0
- data/examples/NeHe/glass.png +0 -0
- data/examples/NeHe/nehe_lesson02.rb +82 -83
- data/examples/NeHe/nehe_lesson03.rb +88 -88
- data/examples/NeHe/nehe_lesson04.rb +93 -96
- data/examples/NeHe/nehe_lesson05.rb +137 -144
- data/examples/NeHe/nehe_lesson06.rb +183 -0
- data/examples/NeHe/nehe_lesson07.rb +237 -0
- data/examples/NeHe/nehe_lesson08.rb +252 -0
- data/examples/NeHe/nehe_lesson09.rb +199 -0
- data/examples/NeHe/nehe_lesson11.rb +173 -0
- data/examples/NeHe/nehe_lesson12.rb +200 -0
- data/examples/NeHe/nehe_lesson16.rb +208 -0
- data/examples/NeHe/nehe_lesson19.rb +206 -0
- data/examples/NeHe/particle.png +0 -0
- data/examples/NeHe/star.png +0 -0
- data/examples/NeHe/tim.png +0 -0
- data/examples/RedBook/light.rb +154 -0
- data/examples/misc/OGLBench.rb +2 -2
- data/examples/misc/trislam.rb +2 -2
- data/ext/{common → opengl}/common.h +2 -11
- data/ext/{common → opengl}/conv.h +43 -31
- data/ext/{glut → opengl}/extconf.rb +14 -7
- data/ext/{common → opengl}/funcdef.h +155 -125
- data/ext/{gl → opengl}/gl-1.0-1.1.c +426 -162
- data/ext/{gl → opengl}/gl-1.2.c +70 -66
- data/ext/{gl → opengl}/gl-1.3.c +19 -19
- data/ext/{gl → opengl}/gl-1.4.c +23 -23
- data/ext/{gl → opengl}/gl-1.5.c +46 -47
- data/ext/{gl → opengl}/gl-2.0.c +66 -60
- data/ext/{gl → opengl}/gl-2.1.c +4 -4
- data/ext/{gl → opengl}/gl-enums.c +2 -1
- data/ext/{common → opengl}/gl-enums.h +0 -0
- data/ext/{gl → opengl}/gl-error.c +12 -4
- data/ext/{common → opengl}/gl-error.h +7 -2
- data/ext/{gl → opengl}/gl-ext-3dfx.c +1 -1
- data/ext/{gl → opengl}/gl-ext-arb.c +75 -70
- data/ext/{gl → opengl}/gl-ext-ati.c +3 -3
- data/ext/{gl → opengl}/gl-ext-ext.c +54 -54
- data/ext/{gl → opengl}/gl-ext-gremedy.c +3 -3
- data/ext/{gl → opengl}/gl-ext-nv.c +49 -48
- data/ext/{common → opengl}/gl-types.h +0 -0
- data/ext/{gl → opengl}/gl.c +8 -10
- data/ext/{glu → opengl}/glu-enums.c +1 -1
- data/ext/{common → opengl}/glu-enums.h +0 -0
- data/ext/{glu → opengl}/glu.c +7 -3
- data/ext/{glut → opengl}/glut.c +98 -48
- data/ext/opengl/opengl.c +11 -0
- data/lib/gl.rb +1 -0
- data/lib/glu.rb +1 -0
- data/lib/glut.rb +1 -0
- data/lib/opengl.rb +13 -14
- data/lib/opengl/test_case.rb +87 -0
- data/test/{tc_misc.rb → test_gl.rb} +2 -14
- data/test/test_gl_10_11.rb +1363 -0
- data/test/test_gl_12.rb +182 -0
- data/test/{tc_func_13.rb → test_gl_13.rb} +14 -14
- data/test/test_gl_14.rb +221 -0
- data/test/test_gl_15.rb +260 -0
- data/test/test_gl_20.rb +430 -0
- data/test/test_gl_21.rb +553 -0
- data/test/test_gl_ext_arb.rb +526 -0
- data/test/{tc_ext_ati.rb → test_gl_ext_ati.rb} +11 -14
- data/test/test_gl_ext_ext.rb +608 -0
- data/test/{tc_ext_gremedy.rb → test_gl_ext_gremedy.rb} +6 -6
- data/test/test_gl_ext_nv.rb +352 -0
- data/test/test_glu.rb +309 -0
- metadata +159 -99
- data/History.txt +0 -36
- data/ext/gl/extconf.rb +0 -43
- data/ext/glu/extconf.rb +0 -51
- data/test/README +0 -10
- data/test/tc_common.rb +0 -98
- data/test/tc_ext_arb.rb +0 -467
- data/test/tc_ext_ext.rb +0 -551
- data/test/tc_ext_nv.rb +0 -357
- data/test/tc_func_10_11.rb +0 -1281
- data/test/tc_func_12.rb +0 -186
- data/test/tc_func_14.rb +0 -197
- data/test/tc_func_15.rb +0 -270
- data/test/tc_func_20.rb +0 -346
- data/test/tc_func_21.rb +0 -541
- data/test/tc_glu.rb +0 -310
- data/test/tc_include_gl.rb +0 -35
- data/test/tc_require_gl.rb +0 -34
data/.autotest
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'autotest/restart'
|
2
|
+
|
3
|
+
Autotest.add_hook :initialize do |at|
|
4
|
+
at.add_exception /\.git/
|
5
|
+
at.add_exception /doc/
|
6
|
+
at.add_exception /examples/
|
7
|
+
at.add_exception /utils/
|
8
|
+
at.add_exception /website/
|
9
|
+
|
10
|
+
at.add_mapping(/^lib\/.*(\.bundle|so|dll)$/) do |filename, match|
|
11
|
+
possible = File.basename(filename, match[1])
|
12
|
+
at.files_matching %r%^test/test_#{possible}%
|
13
|
+
end
|
14
|
+
|
15
|
+
def at.path_to_classname s
|
16
|
+
sep = File::SEPARATOR
|
17
|
+
n = s.sub(/^test#{sep}test_(.*)\.rb/, '\1')
|
18
|
+
c = if n =~ /^(glu?)_?(.*)/ then
|
19
|
+
"#{$1.capitalize}#{$2.split(/_|(\d+)/).map { |seg| seg.capitalize }.join}"
|
20
|
+
end
|
21
|
+
|
22
|
+
"Test#{c}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
Autotest.add_hook :run_command do |at|
|
27
|
+
at.unit_diff = 'cat'
|
28
|
+
system Gem.ruby, Gem.bin_path('rake', 'rake'), 'compile'
|
29
|
+
end
|
data/.gitignore
CHANGED
data/History.rdoc
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
=== 0.8 / master HEAD
|
2
|
+
|
3
|
+
* drop support for Ruby 1.8
|
4
|
+
|
5
|
+
=== 0.60.1 / 2009-02-16
|
6
|
+
|
7
|
+
* Bugfixes
|
8
|
+
* Proper support for ruby 1.9/1.9.1+
|
9
|
+
* Updated OpenGL enumerators in preparation for OpenGL 3.0
|
10
|
+
|
11
|
+
=== 0.60.0 / 2008-01-06
|
12
|
+
|
13
|
+
* Automatic error checking for GL/GLU calls, enabled by default (see
|
14
|
+
doc/tutorial)
|
15
|
+
* Added support for many more OpenGL extensions
|
16
|
+
* Support for Ruby 1.9.0+ (requires mkrf 0.2.3)
|
17
|
+
* Ton of bugfixes.
|
18
|
+
|
19
|
+
* API Changes:
|
20
|
+
* Boolean functions/parameters was changed to ruby true/false instead of
|
21
|
+
GL_TRUE / GL_FALSE, which remains for compatibility
|
22
|
+
* glGet\* functions now returns +x+ instead of <code>[x]</code> when
|
23
|
+
returning only one value
|
24
|
+
* Functions operating on packed strings (glTexture, glPointer etc.) now
|
25
|
+
also accepts ruby arrays directly
|
26
|
+
* Matrix handling functions now also accepts instances of Matrix class, or
|
27
|
+
any class that can be converted to array
|
28
|
+
* glUniform*v and glUniformmatrix*v now does not require 'count'
|
29
|
+
parameter, they will calculate it from length of passed array
|
30
|
+
* glCallLists needs type specifier (previously was forced to GL_BYTE)
|
31
|
+
* On ruby 1.9, glut keyboard callback returns char ("x") instead of integer
|
32
|
+
so using 'if key == ?x' works on both 1.8 and 1.9
|
33
|
+
|
data/Manifest.txt
CHANGED
@@ -1,25 +1,40 @@
|
|
1
|
+
.autotest
|
1
2
|
.gemtest
|
2
3
|
.gitignore
|
3
|
-
History.
|
4
|
+
History.rdoc
|
4
5
|
MIT-LICENSE
|
5
6
|
Manifest.txt
|
6
7
|
README.rdoc
|
7
8
|
Rakefile
|
8
9
|
Rakefile.cross
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
docs/build_install.txt
|
11
|
+
docs/extensions.txt.in
|
12
|
+
docs/history.txt
|
13
|
+
docs/requirements_and_design.txt
|
14
|
+
docs/roadmap.txt
|
15
|
+
docs/scientific_use.txt
|
16
|
+
docs/supplies/page_template.html
|
17
|
+
docs/thanks.txt
|
18
|
+
docs/tutorial.txt
|
19
|
+
examples/NeHe/NeHe.png
|
20
|
+
examples/NeHe/crate.png
|
21
|
+
examples/NeHe/glass.png
|
18
22
|
examples/NeHe/nehe_lesson02.rb
|
19
23
|
examples/NeHe/nehe_lesson03.rb
|
20
24
|
examples/NeHe/nehe_lesson04.rb
|
21
25
|
examples/NeHe/nehe_lesson05.rb
|
26
|
+
examples/NeHe/nehe_lesson06.rb
|
27
|
+
examples/NeHe/nehe_lesson07.rb
|
28
|
+
examples/NeHe/nehe_lesson08.rb
|
29
|
+
examples/NeHe/nehe_lesson09.rb
|
30
|
+
examples/NeHe/nehe_lesson11.rb
|
31
|
+
examples/NeHe/nehe_lesson12.rb
|
32
|
+
examples/NeHe/nehe_lesson16.rb
|
33
|
+
examples/NeHe/nehe_lesson19.rb
|
22
34
|
examples/NeHe/nehe_lesson36.rb
|
35
|
+
examples/NeHe/particle.png
|
36
|
+
examples/NeHe/star.png
|
37
|
+
examples/NeHe/tim.png
|
23
38
|
examples/OrangeBook/3Dlabs-License.txt
|
24
39
|
examples/OrangeBook/brick.frag
|
25
40
|
examples/OrangeBook/brick.rb
|
@@ -50,6 +65,7 @@ examples/RedBook/font.rb
|
|
50
65
|
examples/RedBook/hello.rb
|
51
66
|
examples/RedBook/image.rb
|
52
67
|
examples/RedBook/jitter.rb
|
68
|
+
examples/RedBook/light.rb
|
53
69
|
examples/RedBook/lines.rb
|
54
70
|
examples/RedBook/list.rb
|
55
71
|
examples/RedBook/material.rb
|
@@ -82,54 +98,53 @@ examples/misc/plane.rb
|
|
82
98
|
examples/misc/readpixel.rb
|
83
99
|
examples/misc/sdltest.rb
|
84
100
|
examples/misc/trislam.rb
|
85
|
-
ext/
|
86
|
-
ext/
|
87
|
-
ext/
|
88
|
-
ext/
|
89
|
-
ext/
|
90
|
-
ext/
|
91
|
-
ext/
|
92
|
-
ext/gl
|
93
|
-
ext/
|
94
|
-
ext/
|
95
|
-
ext/
|
96
|
-
ext/
|
97
|
-
ext/
|
98
|
-
ext/
|
99
|
-
ext/
|
100
|
-
ext/
|
101
|
-
ext/
|
102
|
-
ext/
|
103
|
-
ext/
|
104
|
-
ext/
|
105
|
-
ext/
|
106
|
-
ext/
|
107
|
-
ext/
|
108
|
-
ext/
|
109
|
-
ext/glu
|
110
|
-
ext/
|
111
|
-
ext/
|
112
|
-
ext/
|
113
|
-
|
101
|
+
ext/opengl/common.h
|
102
|
+
ext/opengl/conv.h
|
103
|
+
ext/opengl/extconf.rb
|
104
|
+
ext/opengl/funcdef.h
|
105
|
+
ext/opengl/gl-1.0-1.1.c
|
106
|
+
ext/opengl/gl-1.2.c
|
107
|
+
ext/opengl/gl-1.3.c
|
108
|
+
ext/opengl/gl-1.4.c
|
109
|
+
ext/opengl/gl-1.5.c
|
110
|
+
ext/opengl/gl-2.0.c
|
111
|
+
ext/opengl/gl-2.1.c
|
112
|
+
ext/opengl/gl-enums.c
|
113
|
+
ext/opengl/gl-enums.h
|
114
|
+
ext/opengl/gl-error.c
|
115
|
+
ext/opengl/gl-error.h
|
116
|
+
ext/opengl/gl-ext-3dfx.c
|
117
|
+
ext/opengl/gl-ext-arb.c
|
118
|
+
ext/opengl/gl-ext-ati.c
|
119
|
+
ext/opengl/gl-ext-ext.c
|
120
|
+
ext/opengl/gl-ext-gremedy.c
|
121
|
+
ext/opengl/gl-ext-nv.c
|
122
|
+
ext/opengl/gl-types.h
|
123
|
+
ext/opengl/gl.c
|
124
|
+
ext/opengl/glu-enums.c
|
125
|
+
ext/opengl/glu-enums.h
|
126
|
+
ext/opengl/glu.c
|
127
|
+
ext/opengl/glut.c
|
128
|
+
ext/opengl/opengl.c
|
129
|
+
lib/gl.rb
|
130
|
+
lib/glu.rb
|
131
|
+
lib/glut.rb
|
114
132
|
lib/opengl.rb
|
115
|
-
|
116
|
-
test/
|
117
|
-
test/
|
118
|
-
test/
|
119
|
-
test/
|
120
|
-
test/
|
121
|
-
test/
|
122
|
-
test/
|
123
|
-
test/
|
124
|
-
test/
|
125
|
-
test/
|
126
|
-
test/
|
127
|
-
test/
|
128
|
-
test/
|
129
|
-
test/
|
130
|
-
test/tc_include_gl.rb
|
131
|
-
test/tc_misc.rb
|
132
|
-
test/tc_require_gl.rb
|
133
|
+
lib/opengl/test_case.rb
|
134
|
+
test/test_gl.rb
|
135
|
+
test/test_gl_10_11.rb
|
136
|
+
test/test_gl_12.rb
|
137
|
+
test/test_gl_13.rb
|
138
|
+
test/test_gl_14.rb
|
139
|
+
test/test_gl_15.rb
|
140
|
+
test/test_gl_20.rb
|
141
|
+
test/test_gl_21.rb
|
142
|
+
test/test_gl_ext_arb.rb
|
143
|
+
test/test_gl_ext_ati.rb
|
144
|
+
test/test_gl_ext_ext.rb
|
145
|
+
test/test_gl_ext_gremedy.rb
|
146
|
+
test/test_gl_ext_nv.rb
|
147
|
+
test/test_glu.rb
|
133
148
|
utils/README
|
134
149
|
utils/enumgen.rb
|
135
150
|
utils/extlistgen.rb
|
data/README.rdoc
CHANGED
@@ -1,51 +1,98 @@
|
|
1
|
-
=
|
1
|
+
= opengl
|
2
2
|
|
3
|
-
|
3
|
+
source :: https://github.com/larskanis/opengl/tree/0.7
|
4
|
+
docs :: http://ruby-opengl.rubyforge.org
|
5
|
+
bugs :: https://github.com/drbrain/opengl/issues
|
6
|
+
email :: mailto:ruby-opengl-devel@rubyforge.org
|
4
7
|
|
5
|
-
==
|
8
|
+
== Description
|
6
9
|
|
7
|
-
|
8
|
-
|
10
|
+
An OpenGL wrapper for Ruby. ruby-opengl contains bindings for OpenGL and the
|
11
|
+
GLU and GLUT libraries.
|
9
12
|
|
13
|
+
* This branch is for compatibility with Ruby 1.8. Latest development is for
|
14
|
+
Ruby 1.9.2+ only, on master branch: https://github.com/larskanis/opengl
|
10
15
|
|
11
|
-
==
|
16
|
+
== Features and Problems
|
12
17
|
|
13
18
|
* available for Windows, Linux, OS-X
|
14
|
-
* supports Ruby MRI 1.8/1.9 and Rubinius
|
15
19
|
|
16
|
-
==
|
20
|
+
== Synopsis
|
17
21
|
|
18
22
|
require 'opengl'
|
23
|
+
FIX (code sample of usage)
|
19
24
|
|
25
|
+
== Requirements
|
20
26
|
|
21
|
-
|
22
|
-
|
27
|
+
* Ruby 1.8.7+
|
23
28
|
* proper OpenGL, GLU and (free-)GLUT development files installed
|
24
29
|
|
25
|
-
==
|
30
|
+
== Install
|
31
|
+
|
32
|
+
gem install opengl -v "~>0.7.0" --pre
|
33
|
+
|
34
|
+
== Developers
|
35
|
+
|
36
|
+
After checking out the source, run:
|
37
|
+
|
38
|
+
$ rake newb
|
39
|
+
|
40
|
+
This task will install any missing dependencies, run the tests/specs,
|
41
|
+
and generate the RDoc.
|
42
|
+
|
43
|
+
== Cross compiling for Windows
|
44
|
+
|
45
|
+
Using rake-compiler a cross compiled opengl gem can be build on a Linux or MacOS X
|
46
|
+
host for the win32 platform. The generated gem is statically linked against
|
47
|
+
libfreeglut. Freeglut is downloaded and compiled from the sources.
|
48
|
+
There are no runtime dependencies to any but the standard Windows
|
49
|
+
DLLs.
|
50
|
+
|
51
|
+
Install mingw32 or w64 using the instructions in rake-compiler's README.
|
52
|
+
For Debian/Ubuntu it is <tt>apt-get install gcc-mingw-w64</tt> .
|
53
|
+
|
54
|
+
Download and cross compile ruby 1.9 for win32 with:
|
55
|
+
|
56
|
+
rake-compiler cross-ruby VERSION=1.9.3-p0
|
57
|
+
|
58
|
+
Download and cross compile opengl for win32:
|
26
59
|
|
27
|
-
|
60
|
+
rake cross native gem
|
28
61
|
|
29
|
-
|
62
|
+
or with custom versions:
|
30
63
|
|
31
|
-
|
64
|
+
rake cross native gem RUBY_CC_VERSION=1.9.3 LIBFREEGLUT_VERSION=2.8.0
|
32
65
|
|
33
|
-
ruby-opengl
|
34
|
-
|
66
|
+
If everything works, there should be ruby-opengl-VERSION-x86-mingw32.gem in the pkg
|
67
|
+
directory.
|
35
68
|
|
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
69
|
|
40
|
-
|
41
|
-
file for the terms of the license.
|
70
|
+
== License
|
42
71
|
|
72
|
+
(The MIT License)
|
43
73
|
|
44
|
-
|
45
|
-
|
46
|
-
|
74
|
+
Copyright (c) Eric Hodel (current maintainer)
|
75
|
+
Copyright (c) Alain Hoang (previous maintainer)
|
76
|
+
Copyright (c) Jan Dvorak (contributor)
|
77
|
+
Copyright (c) Minh Thu Vo (contributor)
|
78
|
+
Copyright (c) James Adam (contributor)
|
47
79
|
|
80
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
81
|
+
a copy of this software and associated documentation files (the
|
82
|
+
'Software'), to deal in the Software without restriction, including
|
83
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
84
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
85
|
+
permit persons to whom the Software is furnished to do so, subject to
|
86
|
+
the following conditions:
|
48
87
|
|
49
|
-
|
88
|
+
The above copyright notice and this permission notice shall be
|
89
|
+
included in all copies or substantial portions of the Software.
|
50
90
|
|
91
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
92
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
93
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
94
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
95
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
96
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
97
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
51
98
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#-*-ruby-*-
|
2
2
|
#
|
3
3
|
# Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
|
4
|
+
# Copyright (C) Eric Hodel <drbrain@segment7.net>
|
4
5
|
#
|
5
6
|
# This program is distributed under the terms of the MIT license.
|
6
7
|
# See the included MIT-LICENSE file for the terms of this license.
|
@@ -15,115 +16,102 @@
|
|
15
16
|
|
16
17
|
require 'rubygems'
|
17
18
|
|
18
|
-
require 'rake'
|
19
|
-
require 'rake/extensiontask'
|
20
|
-
require 'rake/clean'
|
21
|
-
require 'rubygems/package_task'
|
22
|
-
require 'rake/testtask'
|
23
19
|
require 'hoe'
|
20
|
+
require 'rake/extensiontask'
|
24
21
|
load 'Rakefile.cross'
|
25
22
|
|
23
|
+
hoe = Hoe.spec 'opengl' do
|
24
|
+
developer 'Eric Hodel', 'drbrain@segment7.net'
|
25
|
+
developer 'Alain Hoang', ''
|
26
|
+
developer 'Jan Dvorak', ''
|
27
|
+
developer 'Minh Thu Vo', ''
|
28
|
+
developer 'James Adam', ''
|
29
|
+
|
30
|
+
self.readme_file = 'README.rdoc'
|
31
|
+
self.history_file = 'History.rdoc'
|
32
|
+
self.extra_rdoc_files = FileList['*.rdoc']
|
33
|
+
|
34
|
+
extra_dev_deps << ['rake-compiler', '~> 0.7', '>= 0.7.9']
|
35
|
+
extra_dev_deps << ['minitest', '~> 3.0']
|
36
|
+
|
37
|
+
self.spec_extras = {
|
38
|
+
:extensions => %w[ext/opengl/extconf.rb],
|
39
|
+
:required_ruby_version => '>= 1.8.7',
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
Rake::ExtensionTask.new 'opengl', hoe.spec do |ext|
|
44
|
+
ext.lib_dir = 'lib/opengl'
|
45
|
+
|
46
|
+
ext.cross_compile = true
|
47
|
+
ext.cross_platform = ['i386-mingw32']
|
48
|
+
ext.cross_config_options += [
|
49
|
+
"--with-installed-dir=#{STATIC_INSTALLDIR}",
|
50
|
+
]
|
51
|
+
end
|
52
|
+
|
53
|
+
task :test => :compile
|
54
|
+
|
26
55
|
# Generate html docs from the markdown source and upload to the site.
|
27
56
|
# All doc files that are destined for the website have filenames that
|
28
57
|
# end in .txt.
|
29
58
|
|
30
|
-
WEBSITE_MKDN = FileList['./
|
59
|
+
WEBSITE_MKDN = FileList['./docs/*.txt'] << 'README.txt'
|
31
60
|
NICE_HTML_DOCS = WEBSITE_MKDN.ext('html')
|
32
61
|
|
33
62
|
# defines columns in the HTML extension list
|
34
|
-
GLEXT_VERSIONS = [
|
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")
|
63
|
+
GLEXT_VERSIONS = %w[svn 0.60 0.50]
|
45
64
|
|
46
65
|
desc 'Show contents of some variables related to website doc generation.'
|
47
66
|
task :explain_website do
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
67
|
+
puts "WEBSITE_MKDN:"
|
68
|
+
WEBSITE_MKDN.each do |doc|
|
69
|
+
puts "\t#{doc}"
|
70
|
+
end
|
71
|
+
|
72
|
+
puts "NICE_HTML_DOCS:"
|
73
|
+
NICE_HTML_DOCS.each do |doc|
|
74
|
+
puts "\t#{doc}"
|
75
|
+
end
|
56
76
|
end
|
57
77
|
|
58
78
|
desc 'Generate supported extension list.'
|
59
79
|
task :gen_glext_list do
|
60
|
-
sh "./utils/extlistgen.rb doc/extensions.txt.in doc/extensions.txt
|
80
|
+
sh "./utils/extlistgen.rb", "doc/extensions.txt.in", "doc/extensions.txt", *GLEXT_VERSIONS
|
61
81
|
end
|
62
82
|
|
63
83
|
desc 'Generate website html.'
|
64
84
|
task :gen_website => [:gen_glext_list] + NICE_HTML_DOCS do
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
sh "cp doc/*.html website"
|
85
|
+
# Now that the website docs have been generated, copy them to ./website.
|
86
|
+
cp "README.html", "website/index.html"
|
87
|
+
cp "doc/*.html", "ebsite"
|
69
88
|
end
|
70
89
|
|
71
90
|
# You'll see some intermediate .plain files get generated. These are html,
|
72
91
|
# but don't yet have their code snippets syntax highlighted.
|
73
92
|
rule '.html' => '.plain' do |t|
|
74
|
-
|
75
|
-
|
93
|
+
puts "Turning #{t.source} into #{t.name} ..."
|
94
|
+
sh "./utils/post-mkdn2html.rb", t.source, t.name
|
76
95
|
end
|
77
96
|
|
78
97
|
# Process the markdown docs into plain html.
|
79
98
|
rule '.plain' => '.txt' do |t|
|
80
|
-
|
81
|
-
|
82
|
-
sh "./utils/mkdn2html.rb #{t.source} #{t.name}"
|
99
|
+
puts "Turning #{t.source} into #{t.name} ..."
|
100
|
+
sh "./utils/mkdn2html.rb", t.source, t.name
|
83
101
|
end
|
84
102
|
|
103
|
+
RUBYFORGE = "rubyforge.org:/var/www/gforge-projects/ruby-opengl"
|
104
|
+
|
85
105
|
desc 'Upload the newly-built site to RubyForge.'
|
86
106
|
task :upload_website => [:gen_website] do
|
87
|
-
|
88
|
-
|
107
|
+
sh "scp", "website/*.html", RUBYFORGE
|
108
|
+
sh "scp", "website/images/*", "#{RUBYFORGE}/images/"
|
89
109
|
end
|
90
110
|
|
91
111
|
desc 'Upload entire site, including stylesheet and the images directory.'
|
92
112
|
task :upload_entire_website => [:gen_website] do
|
93
|
-
|
94
|
-
|
95
|
-
|
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
|
-
]
|
113
|
+
sh "scp", "website/*.html", RUBYFORGE
|
114
|
+
sh "scp", "website/*.css", RUBYFORGE
|
115
|
+
sh "scp", "-r", "website", "images", RUBYFORGE
|
125
116
|
end
|
126
117
|
|
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
|