ruby-opengl 0.33.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +129 -0
- data/doc/build_install.txt +53 -0
- data/doc/history.txt +48 -0
- data/doc/requirements_and_design.txt +131 -0
- data/doc/roadmap.txt +19 -0
- data/doc/scientific_use.txt +28 -0
- data/doc/supplies/page_template.html +63 -0
- data/doc/thanks.txt +23 -0
- data/doc/tutorial.txt +160 -0
- data/examples/README +36 -0
- data/examples/aaindex.rb +97 -0
- data/examples/all_tests.rb +24 -0
- data/examples/plane.rb +161 -0
- data/examples/smooth.rb +40 -0
- data/examples/smooth_prev.rb +40 -0
- data/examples/test.rb +64 -0
- data/ext/common/Rakefile +39 -0
- data/ext/common/gl-enums.h +10349 -0
- data/ext/common/rbogl.c +260 -0
- data/ext/common/rbogl.h +52 -0
- data/ext/gl/gl-1.0-1.1.c +5152 -0
- data/ext/gl/gl-1.2.c +166 -0
- data/ext/gl/gl-enums.c +2905 -0
- data/ext/gl/gl.c +31 -0
- data/ext/gl/mkrf_conf.rb +27 -0
- data/ext/glu/glu.c +1636 -0
- data/ext/glu/mkrf_conf.rb +28 -0
- data/ext/glut/glut.c +1776 -0
- data/ext/glut/mkrf_conf.rb +28 -0
- data/lib/gl_prev.rb +45 -0
- data/lib/glu_prev.rb +45 -0
- data/lib/glut_prev.rb +45 -0
- data/test/README +23 -0
- data/test/runtests.sh +7 -0
- data/test/tc_gl_vertex.rb +180 -0
- data/test/tc_include_gl.rb +35 -0
- data/test/tc_opengl_namespace.rb +40 -0
- data/test/tc_require_gl.rb +34 -0
- metadata +96 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
# extconf.rb for ruby-opengl's glut extension module.
|
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 COPYRIGHT 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
|
+
require 'mkrf'
|
18
|
+
|
19
|
+
Mkrf::Generator.new( 'glut' ) do |g|
|
20
|
+
case RUBY_PLATFORM
|
21
|
+
when /darwin/
|
22
|
+
g.ldshared << ' -framework GLUT -framework OpenGL -framework Cocoa'
|
23
|
+
else
|
24
|
+
g.include_library( 'glut', 'glutSolidTeapot' )
|
25
|
+
g.include_library( 'GLU', 'gluLookAt' )
|
26
|
+
g.include_library( 'GL', 'glVertex3d')
|
27
|
+
end
|
28
|
+
end
|
data/lib/gl_prev.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
|
2
|
+
#
|
3
|
+
# This program is distributed under the terms of the MIT license.
|
4
|
+
# See the included MIT-LICENSE file for the terms of this license.
|
5
|
+
#
|
6
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
7
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
8
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
9
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
10
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
11
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
12
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
13
|
+
|
14
|
+
|
15
|
+
# This module provides access to the GL methods and constants
|
16
|
+
# in the way that they were available in previous versions of ruby-opengl.
|
17
|
+
#
|
18
|
+
# Thanks to Ilmari Heikkinen for a previous "reversed" version of this code,
|
19
|
+
# and to Bill Kelly for a version before that one.
|
20
|
+
|
21
|
+
require '../ext/gl/gl'
|
22
|
+
|
23
|
+
module GL
|
24
|
+
extend self
|
25
|
+
include Gl
|
26
|
+
|
27
|
+
Gl.constants.each do |cn|
|
28
|
+
n = cn.sub(/^GL_/,'')
|
29
|
+
begin
|
30
|
+
const_set( n, Gl.const_get( cn ) )
|
31
|
+
rescue
|
32
|
+
puts "=== #{__FILE__} FAILED on Constant: #{cn} --> #{n}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
Gl.methods( false ).each do |mn|
|
37
|
+
n = mn.sub(/^gl/,'')
|
38
|
+
begin
|
39
|
+
alias_method( n, mn )
|
40
|
+
public( n )
|
41
|
+
rescue
|
42
|
+
puts "=== #{__FILE__} FAILED on Method: #{mn} --> #{n}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/glu_prev.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
|
2
|
+
#
|
3
|
+
# This program is distributed under the terms of the MIT license.
|
4
|
+
# See the included MIT-LICENSE file for the terms of this license.
|
5
|
+
#
|
6
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
7
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
8
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
9
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
10
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
11
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
12
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
13
|
+
|
14
|
+
|
15
|
+
# This module provides access to the GLU methods and constants
|
16
|
+
# in the way that they were available in previous versions of ruby-opengl.
|
17
|
+
#
|
18
|
+
# Thanks to Ilmari Heikkinen for a previous "reversed" version of this code,
|
19
|
+
# and to Bill Kelly for a version before that one.
|
20
|
+
|
21
|
+
require '../ext/glu/glu'
|
22
|
+
|
23
|
+
module GLU
|
24
|
+
extend self
|
25
|
+
include Glu
|
26
|
+
|
27
|
+
Glu.constants.each do |cn|
|
28
|
+
n = cn.sub(/^GLU_/,'')
|
29
|
+
begin
|
30
|
+
const_set( n, Glu.const_get( cn ) )
|
31
|
+
rescue
|
32
|
+
puts "=== #{__FILE__} FAILED on Constant: #{cn} --> #{n}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
Glu.methods( false ).each do |mn|
|
37
|
+
n = mn.sub(/^glu/,'')
|
38
|
+
begin
|
39
|
+
alias_method( n, mn )
|
40
|
+
public( n )
|
41
|
+
rescue
|
42
|
+
puts "=== #{__FILE__} FAILED on Method: #{mn} --> #{n}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/glut_prev.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
|
2
|
+
#
|
3
|
+
# This program is distributed under the terms of the MIT license.
|
4
|
+
# See the included MIT-LICENSE file for the terms of this license.
|
5
|
+
#
|
6
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
7
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
8
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
9
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
10
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
11
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
12
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
13
|
+
|
14
|
+
|
15
|
+
# This module provides access to the GLUT methods and constants
|
16
|
+
# in the way that they were available in previous versions of ruby-opengl.
|
17
|
+
#
|
18
|
+
# Thanks to Ilmari Heikkinen for a previous "reversed" version of this code,
|
19
|
+
# and to Bill Kelly for a version before that one.
|
20
|
+
|
21
|
+
require '../ext/glut/glut'
|
22
|
+
|
23
|
+
module GLUT
|
24
|
+
extend self
|
25
|
+
include Glut
|
26
|
+
|
27
|
+
Glut.constants.each do |cn|
|
28
|
+
n = cn.sub(/^GLUT_/,'')
|
29
|
+
begin
|
30
|
+
const_set( n, Glut.const_get( cn ) )
|
31
|
+
rescue
|
32
|
+
puts "=== #{__FILE__} FAILED on Constant: #{cn} --> #{n}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
Glut.methods( false ).each do |mn|
|
37
|
+
n = mn.sub(/^glut/,'')
|
38
|
+
begin
|
39
|
+
alias_method( n, mn )
|
40
|
+
public( n )
|
41
|
+
rescue
|
42
|
+
puts "=== #{__FILE__} FAILED on Method: #{mn} --> #{n}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/test/README
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
ruby-opengl tests
|
2
|
+
=================
|
3
|
+
|
4
|
+
This directory contains the unit tests for ruby-opengl. You should be able
|
5
|
+
to run the tests directly:
|
6
|
+
|
7
|
+
ruby -rubygems tc_include_gl.rb
|
8
|
+
|
9
|
+
You can also run all the tests by using the runtests.sh
|
10
|
+
|
11
|
+
./runtests.sh
|
12
|
+
|
13
|
+
Note the tests are currently a work in progress. For tc_gl_vertex.rb you
|
14
|
+
will need to press ESC to close each window as it runs through the tests
|
15
|
+
|
16
|
+
TODO
|
17
|
+
=====
|
18
|
+
o Add require 'opengl' so tc_opengl_namespace.rb will pass
|
19
|
+
o Setup a rake task to run the tests so from $RUBY_OPENGL_HOME
|
20
|
+
Example:
|
21
|
+
rake test # to run all tests
|
22
|
+
rake test TEST=tc_gl_vertex.rb # Run just one test
|
23
|
+
|
data/test/runtests.sh
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
|
3
|
+
#
|
4
|
+
# This program is distributed under the terms of the MIT license.
|
5
|
+
# See the included MIT-LICENSE file for the terms of this license.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
8
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
9
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
10
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
11
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
12
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
13
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
14
|
+
#++
|
15
|
+
|
16
|
+
if __FILE__ == $0
|
17
|
+
# If we are being called from the command line, e.g., ruby foo.rb, then
|
18
|
+
# fixup the load path so we can find the OpenGL extension libs
|
19
|
+
$: << File.join(File.dirname(__FILE__), '..', 'ext')
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'test/unit'
|
23
|
+
require 'gl'
|
24
|
+
require 'glut'
|
25
|
+
include Gl
|
26
|
+
include Glut
|
27
|
+
|
28
|
+
|
29
|
+
# Yet to test
|
30
|
+
|
31
|
+
# glVertex2dv
|
32
|
+
# glVertex2fv
|
33
|
+
# glVertex2iv
|
34
|
+
# glVertex2sv
|
35
|
+
|
36
|
+
# glVertex3dv
|
37
|
+
# glVertex3fv
|
38
|
+
# glVertex3iv
|
39
|
+
# glVertex3sv
|
40
|
+
|
41
|
+
# glVertex4dv
|
42
|
+
# glVertex4fv
|
43
|
+
# glVertex4iv
|
44
|
+
# glVertex4sv
|
45
|
+
|
46
|
+
class GlVertexTest < Test::Unit::TestCase
|
47
|
+
|
48
|
+
|
49
|
+
# Test the existence of
|
50
|
+
# glVertex2d
|
51
|
+
# glVertex2f
|
52
|
+
# glVertex2i
|
53
|
+
# glVertex2s
|
54
|
+
def test_gl_vertex2x
|
55
|
+
one_time_glut_init
|
56
|
+
# These parameters define a small box
|
57
|
+
params = [
|
58
|
+
[-1.5, -1.5],
|
59
|
+
[-1.5, 1.5],
|
60
|
+
[ 1.5, 1.5],
|
61
|
+
[ 1.5, -1.5]
|
62
|
+
]
|
63
|
+
run_with(%w( glVertex2d glVertex2f glVertex2i glVertex2s ), params)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Test the existence of
|
67
|
+
# glVertex3d
|
68
|
+
# glVertex3f
|
69
|
+
# glVertex3i
|
70
|
+
# glVertex3s
|
71
|
+
def test_gl_vertex3x
|
72
|
+
one_time_glut_init
|
73
|
+
# These parameters define a small box
|
74
|
+
params = [
|
75
|
+
[-1.5, -1.5, 0],
|
76
|
+
[-1.5, 1.5, 0],
|
77
|
+
[ 1.5, 1.5, 0],
|
78
|
+
[ 1.5, -1.5, 0]
|
79
|
+
]
|
80
|
+
run_with(%w( glVertex3d glVertex3f glVertex3i glVertex3s ), params)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Test the existence of
|
84
|
+
# glVertex4d
|
85
|
+
# glVertex4f
|
86
|
+
# glVertex4i
|
87
|
+
# glVertex4s
|
88
|
+
def test_gl_vertex4x
|
89
|
+
one_time_glut_init
|
90
|
+
# These parameters define a small box
|
91
|
+
params = [
|
92
|
+
[-1.5, -1.5, 0, 1],
|
93
|
+
[-1.5, 1.5, 0, 1],
|
94
|
+
[ 1.5, 1.5, 0, 1],
|
95
|
+
[ 1.5, -1.5, 0, 1]
|
96
|
+
]
|
97
|
+
run_with(%w( glVertex4d glVertex4f glVertex4i glVertex4s ), params)
|
98
|
+
end
|
99
|
+
|
100
|
+
def one_time_glut_init
|
101
|
+
puts "=== one_time_glut_init"
|
102
|
+
glutInit
|
103
|
+
glutInitWindowSize(600, 600)
|
104
|
+
end
|
105
|
+
|
106
|
+
def init
|
107
|
+
puts "=== init"
|
108
|
+
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
|
109
|
+
glMatrixMode(GL_PROJECTION)
|
110
|
+
glLoadIdentity
|
111
|
+
# Give us a 20x20x20 cube to display in centered on the origin
|
112
|
+
glOrtho(-10, 10, -10, 10, -10, 10)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Run several related tests. gl_vertex_methods, is an array of method
|
116
|
+
# names that are appropriate to run against the arity of params. E.g.,
|
117
|
+
# if gl_vertex_methods was ["glVertex2f", "glVertex2d", ... ] and
|
118
|
+
# params was [ [-1.5, -1.5], [-1.5, 1.5], [ 1.5, 1.5], [ 1.5, -1.5] ],
|
119
|
+
# then calling run_with(gl_vertex_methods, params) would be equivalent
|
120
|
+
# to running the following test cases:
|
121
|
+
#
|
122
|
+
# glBegin(GL_POLYGON)
|
123
|
+
# glVertex2f(-1.5, -1.5)
|
124
|
+
# glVertex2f(-1.5, 1.5)
|
125
|
+
# glVertex2f( 1.5, 1.5)
|
126
|
+
# glVertex2f( 1.5, -1.5)
|
127
|
+
# glEnd
|
128
|
+
# ...
|
129
|
+
# glBegin(GL_POLYGON)
|
130
|
+
# glVertex2d(-1.5, -1.5)
|
131
|
+
# glVertex2d(-1.5, 1.5)
|
132
|
+
# glVertex2d( 1.5, 1.5)
|
133
|
+
# glVertex2d( 1.5, -1.5)
|
134
|
+
# glEnd
|
135
|
+
#
|
136
|
+
def run_with(gl_vertex_methods, params)
|
137
|
+
gl_vertex_methods.each do |mn|
|
138
|
+
display = lambda do
|
139
|
+
glColor3f( 1.0, 1.0, 1.0 )
|
140
|
+
|
141
|
+
glBegin(GL_POLYGON)
|
142
|
+
# The send(...) basically do something like:
|
143
|
+
# glVertex2d( -1.5, -1.5 )
|
144
|
+
# or
|
145
|
+
# glVertex3d( -1.5, -1.5, 0 )
|
146
|
+
# or
|
147
|
+
# glVertex4f( -1.5, -1.5, 0, 1 )
|
148
|
+
#
|
149
|
+
params.each {|p| send(mn, *p)}
|
150
|
+
glEnd
|
151
|
+
glFlush
|
152
|
+
end
|
153
|
+
|
154
|
+
keyboard = lambda do |key, x, y|
|
155
|
+
case(key)
|
156
|
+
when 27
|
157
|
+
raise StopGlutMain.new
|
158
|
+
end
|
159
|
+
end
|
160
|
+
glutCreateWindow("#{__FILE__} : #{mn}");
|
161
|
+
init
|
162
|
+
glutDisplayFunc(display);
|
163
|
+
glutKeyboardFunc(keyboard)
|
164
|
+
begin
|
165
|
+
glutMainLoop;
|
166
|
+
rescue StopGlutMain
|
167
|
+
# Ignore
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
class StopGlutMain < RuntimeError
|
174
|
+
# This Exception is just used to break out of the glutMainLoop.
|
175
|
+
#
|
176
|
+
# The Mac OS X version of glut has the glutCheckLoop/glutWMCloseFunc
|
177
|
+
# pair, but in general, we can't rely on something beyond the really
|
178
|
+
# old 98 version of GLUT being installed.
|
179
|
+
end
|
180
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
|
3
|
+
#
|
4
|
+
# This program is distributed under the terms of the MIT license.
|
5
|
+
# See the included MIT-LICENSE file for the terms of this license.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
8
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
9
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
10
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
11
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
12
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
13
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
14
|
+
#++
|
15
|
+
|
16
|
+
if __FILE__ == $0
|
17
|
+
# If we are being called from the command line, e.g., ruby foo.rb, then
|
18
|
+
# fixup the load path so we can find the OpenGL extension libs
|
19
|
+
$: << File.join(File.dirname(__FILE__), '..', 'ext')
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'test/unit'
|
23
|
+
require 'gl'
|
24
|
+
include Gl
|
25
|
+
|
26
|
+
# Test that an include of Gl forces makes the OpenGL namespace available in
|
27
|
+
# the current module.
|
28
|
+
# include Gl
|
29
|
+
# ...
|
30
|
+
# Gl::VERSION exists
|
31
|
+
class GlIncludeTest < Test::Unit::TestCase
|
32
|
+
def test_require_of_gl
|
33
|
+
assert Gl::GL_VERSION
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
|
3
|
+
#
|
4
|
+
# This program is distributed under the terms of the MIT license.
|
5
|
+
# See the included MIT-LICENSE file for the terms of this license.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
8
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
9
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
10
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
11
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
12
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
13
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
14
|
+
#++
|
15
|
+
|
16
|
+
if __FILE__ == $0
|
17
|
+
# If we are being called from the command line, e.g., ruby foo.rb, then
|
18
|
+
# fixup the load path so we can find the OpenGL extension libs
|
19
|
+
$: << File.join(File.dirname(__FILE__), '..', 'ext')
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'test/unit'
|
23
|
+
require 'opengl'
|
24
|
+
|
25
|
+
# Test that a require of the opengl convenience lib requires and includes
|
26
|
+
# the proper OpenGL, GLU and GLUT namespaces.
|
27
|
+
class OpenglTest < Test::Unit::TestCase
|
28
|
+
|
29
|
+
def test_gl_constant
|
30
|
+
assert Gl::VERSION
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_glut_constant
|
34
|
+
assert Glut::GLUT_API_VERSION
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_glu_constant
|
38
|
+
fail "GLU not implemented yet"
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
|
3
|
+
#
|
4
|
+
# This program is distributed under the terms of the MIT license.
|
5
|
+
# See the included MIT-LICENSE file for the terms of this license.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
8
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
9
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
10
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
11
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
12
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
13
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
14
|
+
#++
|
15
|
+
|
16
|
+
if __FILE__ == $0
|
17
|
+
# If we are being called from the command line, e.g., ruby foo.rb, then
|
18
|
+
# fixup the load path so we can find the OpenGL extension libs
|
19
|
+
$: << File.join(File.dirname(__FILE__), '..', 'ext')
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'test/unit'
|
23
|
+
require 'gl'
|
24
|
+
|
25
|
+
# Test that a require but not include of GL forces the use of the full
|
26
|
+
# namespace qualifiers:
|
27
|
+
# require Gl
|
28
|
+
# ...
|
29
|
+
# Gl::VERSION exists
|
30
|
+
class GLRequireTest < Test::Unit::TestCase
|
31
|
+
def test_require_of_gl
|
32
|
+
assert Gl::GL_VERSION
|
33
|
+
end
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.1
|
3
|
+
specification_version: 1
|
4
|
+
name: ruby-opengl
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.33.0
|
7
|
+
date: 2007-02-21 00:00:00 +09:00
|
8
|
+
summary: OpenGL Interface for Ruby
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email:
|
12
|
+
homepage: http://opengl-ruby.rubyforge.org
|
13
|
+
rubyforge_project:
|
14
|
+
description:
|
15
|
+
autorequire: gl
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: false
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- John Gabriele
|
31
|
+
- Minh Thu Vo
|
32
|
+
files:
|
33
|
+
- lib/gl_prev.rb
|
34
|
+
- lib/glu_prev.rb
|
35
|
+
- lib/glut_prev.rb
|
36
|
+
- ext/common
|
37
|
+
- ext/gl
|
38
|
+
- ext/glu
|
39
|
+
- ext/glut
|
40
|
+
- ext/common/gl-enums.h
|
41
|
+
- ext/common/Rakefile
|
42
|
+
- ext/common/rbogl.c
|
43
|
+
- ext/common/rbogl.h
|
44
|
+
- ext/gl/mkrf_conf.rb
|
45
|
+
- ext/gl/gl-1.2.c
|
46
|
+
- ext/gl/gl.c
|
47
|
+
- ext/gl/gl-enums.c
|
48
|
+
- ext/gl/gl-1.0-1.1.c
|
49
|
+
- ext/glu/mkrf_conf.rb
|
50
|
+
- ext/glu/glu.c
|
51
|
+
- ext/glut/mkrf_conf.rb
|
52
|
+
- ext/glut/glut.c
|
53
|
+
- doc/supplies
|
54
|
+
- doc/requirements_and_design.txt
|
55
|
+
- doc/build_install.txt
|
56
|
+
- doc/history.txt
|
57
|
+
- doc/scientific_use.txt
|
58
|
+
- doc/roadmap.txt
|
59
|
+
- doc/thanks.txt
|
60
|
+
- doc/tutorial.txt
|
61
|
+
- doc/supplies/page_template.html
|
62
|
+
- examples/aaindex.rb
|
63
|
+
- examples/README
|
64
|
+
- examples/smooth_prev.rb
|
65
|
+
- examples/all_tests.rb
|
66
|
+
- examples/plane.rb
|
67
|
+
- examples/smooth.rb
|
68
|
+
- examples/test.rb
|
69
|
+
- test/tc_gl_vertex.rb
|
70
|
+
- test/README
|
71
|
+
- test/tc_opengl_namespace.rb
|
72
|
+
- test/tc_include_gl.rb
|
73
|
+
- test/tc_require_gl.rb
|
74
|
+
- test/runtests.sh
|
75
|
+
test_files: []
|
76
|
+
|
77
|
+
rdoc_options: []
|
78
|
+
|
79
|
+
extra_rdoc_files: []
|
80
|
+
|
81
|
+
executables: []
|
82
|
+
|
83
|
+
extensions:
|
84
|
+
- Rakefile
|
85
|
+
requirements: []
|
86
|
+
|
87
|
+
dependencies:
|
88
|
+
- !ruby/object:Gem::Dependency
|
89
|
+
name: mkrf
|
90
|
+
version_requirement:
|
91
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.2.0
|
96
|
+
version:
|