opengl 0.7.0.pre1-x86-mingw32 → 0.7.0.pre2-x86-mingw32
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/opengl.so +0 -0
- 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 -102
- 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/Rakefile.cross
CHANGED
@@ -9,7 +9,7 @@ require 'uri'
|
|
9
9
|
require 'rbconfig'
|
10
10
|
require 'pathname'
|
11
11
|
|
12
|
-
ENV['RUBY_CC_VERSION'] ||= '1.
|
12
|
+
ENV['RUBY_CC_VERSION'] ||= '1.9.3'
|
13
13
|
|
14
14
|
# Cross-compilation constants
|
15
15
|
COMPILE_HOME = Pathname( "build" ).expand_path
|
@@ -94,6 +94,7 @@ end
|
|
94
94
|
task LIBFREEGLUT_A => [LIBFREEGLUT_MAKEFILE] do |t|
|
95
95
|
Dir.chdir( STATIC_LIBFREEGLUT_BUILDDIR ) do
|
96
96
|
sh "make -j#{NUM_CPUS} install"
|
97
|
+
(STATIC_INSTALLDIR + "lib" + "libglut.dll.a").unlink
|
97
98
|
end
|
98
99
|
end
|
99
100
|
|
@@ -101,4 +102,6 @@ desc "compile static libraries"
|
|
101
102
|
task :static_libs => [ LIBFREEGLUT_A ]
|
102
103
|
|
103
104
|
desc 'cross compile required libs for win32'
|
104
|
-
task :cross => [ :static_libs ]
|
105
|
+
task :cross => [ :static_libs ] do
|
106
|
+
ENV['CROSS_COMPILING'] = 'yes'
|
107
|
+
end
|
File without changes
|
File without changes
|
data/{doc → docs}/history.txt
RENAMED
File without changes
|
File without changes
|
data/{doc → docs}/roadmap.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/{doc → docs}/thanks.txt
RENAMED
File without changes
|
data/{doc → docs}/tutorial.txt
RENAMED
File without changes
|
Binary file
|
Binary file
|
Binary file
|
@@ -2,12 +2,10 @@
|
|
2
2
|
# Name: nehe_lesson02.rb
|
3
3
|
# Purpose: An implementation of NeHe's OpenGL Lesson #02
|
4
4
|
# using ruby-opengl (http://nehe.gamedev.net/)
|
5
|
-
#
|
5
|
+
#
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require "glut"
|
10
|
-
require "mathn"
|
7
|
+
require 'opengl'
|
8
|
+
require 'mathn'
|
11
9
|
|
12
10
|
# Add GL and GLUT namespaces in to make porting easier
|
13
11
|
include Gl
|
@@ -15,103 +13,104 @@ include Glu
|
|
15
13
|
include Glut
|
16
14
|
|
17
15
|
# Placeholder for the window object
|
18
|
-
window =
|
19
|
-
|
20
|
-
def init_gl_window
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
16
|
+
window = nil
|
17
|
+
|
18
|
+
def init_gl_window width = 640, height = 480
|
19
|
+
# Background color to black
|
20
|
+
glClearColor 0.0, 0.0, 0.0, 0
|
21
|
+
# Enables clearing of depth buffer
|
22
|
+
glClearDepth 1.0
|
23
|
+
# Set type of depth test
|
24
|
+
glDepthFunc GL_LEQUAL
|
25
|
+
# Enable depth testing
|
26
|
+
glEnable GL_DEPTH_TEST
|
27
|
+
# Enable smooth color shading
|
28
|
+
glShadeModel GL_SMOOTH
|
29
|
+
|
30
|
+
glMatrixMode GL_PROJECTION
|
31
|
+
glLoadIdentity
|
32
|
+
# Calculate aspect ratio of the window
|
33
|
+
gluPerspective 45.0, width / height, 0.1, 100.0
|
34
|
+
|
35
|
+
glMatrixMode GL_MODELVIEW
|
36
|
+
|
37
|
+
draw_gl_scene
|
40
38
|
end
|
41
39
|
|
42
40
|
#reshape = Proc.new do |width, height|
|
43
|
-
def reshape
|
44
|
-
|
41
|
+
def reshape width, height
|
42
|
+
height = 1 if height == 0
|
45
43
|
|
46
|
-
|
47
|
-
|
44
|
+
# Reset current viewpoint and perspective transformation
|
45
|
+
glViewport 0, 0, width, height
|
48
46
|
|
49
|
-
|
50
|
-
|
47
|
+
glMatrixMode GL_PROJECTION
|
48
|
+
glLoadIdentity
|
51
49
|
|
52
|
-
|
50
|
+
gluPerspective 45.0, width / height, 0.1, 100.0
|
53
51
|
end
|
54
52
|
|
55
53
|
#draw_gl_scene = Proc.new do
|
56
54
|
def draw_gl_scene
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
55
|
+
# Clear the screen and depth buffer
|
56
|
+
glClear GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
|
57
|
+
|
58
|
+
# Reset the view
|
59
|
+
glMatrixMode GL_MODELVIEW
|
60
|
+
glLoadIdentity
|
61
|
+
|
62
|
+
# Move left 1.5 units and into the screen 6.0 units
|
63
|
+
glTranslatef -1.5, 0.0, -6.0
|
64
|
+
|
65
|
+
# Draw a triangle
|
66
|
+
glBegin GL_POLYGON do
|
67
|
+
glVertex3f 0.0, 1.0, 0.0
|
68
|
+
glVertex3f 1.0, -1.0, 0.0
|
69
|
+
glVertex3f -1.0, -1.0, 0.0
|
70
|
+
end
|
71
|
+
|
72
|
+
# Move right 3 units
|
73
|
+
glTranslatef 3.0, 0.0, 0.0
|
74
|
+
|
75
|
+
# Draw a rectangle
|
76
|
+
glBegin GL_QUADS do
|
77
|
+
glVertex3f -1.0, 1.0, 0.0
|
78
|
+
glVertex3f 1.0, 1.0, 0.0
|
79
|
+
glVertex3f 1.0, -1.0, 0.0
|
80
|
+
glVertex3f -1.0, -1.0, 0.0
|
81
|
+
end
|
82
|
+
|
83
|
+
# Swap buffers for display
|
84
|
+
glutSwapBuffers
|
87
85
|
end
|
88
86
|
|
89
|
-
# The idle function to handle
|
87
|
+
# The idle function to handle
|
90
88
|
def idle
|
91
|
-
|
89
|
+
glutPostRedisplay
|
92
90
|
end
|
93
91
|
|
94
92
|
# Keyboard handler to exit when ESC is typed
|
95
93
|
keyboard = lambda do |key, x, y|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
94
|
+
case key
|
95
|
+
when ?\e
|
96
|
+
glutDestroyWindow window
|
97
|
+
exit(0)
|
98
|
+
end
|
99
|
+
glutPostRedisplay
|
102
100
|
end
|
103
101
|
|
104
102
|
|
105
103
|
# Initliaze our GLUT code
|
106
|
-
glutInit
|
104
|
+
glutInit
|
107
105
|
# Setup a double buffer, RGBA color, alpha components and depth buffer
|
108
|
-
glutInitDisplayMode
|
109
|
-
glutInitWindowSize
|
110
|
-
glutInitWindowPosition
|
111
|
-
window = glutCreateWindow
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
glutKeyboardFunc
|
116
|
-
init_gl_window
|
117
|
-
glutMainLoop
|
106
|
+
glutInitDisplayMode GLUT_RGB | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH
|
107
|
+
glutInitWindowSize 640, 480
|
108
|
+
glutInitWindowPosition 0, 0
|
109
|
+
window = glutCreateWindow "NeHe Lesson 02 - ruby-opengl version"
|
110
|
+
glutIdleFunc :idle
|
111
|
+
glutDisplayFunc :draw_gl_scene
|
112
|
+
glutReshapeFunc :reshape
|
113
|
+
glutKeyboardFunc keyboard
|
114
|
+
init_gl_window 640, 480
|
115
|
+
glutMainLoop
|
116
|
+
|
@@ -2,12 +2,10 @@
|
|
2
2
|
# Name: nehe_lesson03.rb
|
3
3
|
# Purpose: An implementation of NeHe's OpenGL Lesson #03
|
4
4
|
# using ruby-opengl (http://nehe.gamedev.net/)
|
5
|
-
#
|
5
|
+
#
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require "glut"
|
10
|
-
require "mathn"
|
7
|
+
require 'opengl'
|
8
|
+
require 'mathn'
|
11
9
|
|
12
10
|
# Add GL and GLUT namespaces in to make porting easier
|
13
11
|
include Gl
|
@@ -15,108 +13,110 @@ include Glu
|
|
15
13
|
include Glut
|
16
14
|
|
17
15
|
# Placeholder for the window object
|
18
|
-
window =
|
19
|
-
|
20
|
-
def init_gl_window
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
16
|
+
window = nil
|
17
|
+
|
18
|
+
def init_gl_window width = 640, height = 480
|
19
|
+
# Background color to black
|
20
|
+
glClearColor 0.0, 0.0, 0.0, 0
|
21
|
+
# Enables clearing of depth buffer
|
22
|
+
glClearDepth 1.0
|
23
|
+
# Set type of depth test
|
24
|
+
glDepthFunc GL_LEQUAL
|
25
|
+
# Enable depth testing
|
26
|
+
glEnable GL_DEPTH_TEST
|
27
|
+
# Enable smooth color shading
|
28
|
+
glShadeModel GL_SMOOTH
|
29
|
+
|
30
|
+
glMatrixMode GL_PROJECTION
|
31
|
+
glLoadIdentity
|
32
|
+
# Calculate aspect ratio of the window
|
33
|
+
gluPerspective 45.0, width / height, 0.1, 100.0
|
34
|
+
|
35
|
+
glMatrixMode GL_MODELVIEW
|
36
|
+
|
37
|
+
draw_gl_scene
|
40
38
|
end
|
41
39
|
|
42
40
|
#reshape = Proc.new do |width, height|
|
43
|
-
def reshape
|
44
|
-
|
41
|
+
def reshape width, height
|
42
|
+
height = 1 if height == 0
|
45
43
|
|
46
|
-
|
47
|
-
|
44
|
+
# Reset current viewpoint and perspective transformation
|
45
|
+
glViewport 0, 0, width, height
|
48
46
|
|
49
|
-
|
50
|
-
|
47
|
+
glMatrixMode GL_PROJECTION
|
48
|
+
glLoadIdentity
|
51
49
|
|
52
|
-
|
50
|
+
gluPerspective 45.0, width / height, 0.1, 100.0
|
53
51
|
end
|
54
52
|
|
55
53
|
#draw_gl_scene = Proc.new do
|
56
54
|
def draw_gl_scene
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
55
|
+
# Clear the screen and depth buffer
|
56
|
+
glClear GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
|
57
|
+
|
58
|
+
# Reset the view
|
59
|
+
glMatrixMode GL_MODELVIEW
|
60
|
+
glLoadIdentity
|
61
|
+
|
62
|
+
# Move left 1.5 units and into the screen 6.0 units
|
63
|
+
glTranslatef -1.5, 0.0, -6.0
|
64
|
+
|
65
|
+
# Draw a triangle setting the color to red, green, blue for each respective
|
66
|
+
# vertex
|
67
|
+
glBegin GL_POLYGON do
|
68
|
+
glColor3f 1.0, 0.0, 0.0
|
69
|
+
glVertex3f 0.0, 1.0, 0.0
|
70
|
+
glColor3f 0.0, 1.0, 0.0
|
71
|
+
glVertex3f 1.0, -1.0, 0.0
|
72
|
+
glColor3f 0.0, 0.0, 1.0
|
73
|
+
glVertex3f -1.0, -1.0, 0.0
|
74
|
+
end
|
75
|
+
|
76
|
+
# Move right 3 units
|
77
|
+
glTranslatef 3.0, 0.0, 0.0
|
78
|
+
|
79
|
+
# Set the color to medium blue for all vertexes
|
80
|
+
glColor3f 0.5, 0.5, 1.0
|
81
|
+
# Draw a rectangle
|
82
|
+
glBegin GL_QUADS do
|
83
|
+
glVertex3f -1.0, 1.0, 0.0
|
84
|
+
glVertex3f 1.0, 1.0, 0.0
|
85
|
+
glVertex3f 1.0, -1.0, 0.0
|
86
|
+
glVertex3f -1.0, -1.0, 0.0
|
87
|
+
end
|
88
|
+
|
89
|
+
# Swap buffers for display
|
90
|
+
glutSwapBuffers
|
92
91
|
end
|
93
92
|
|
94
|
-
# The idle function to handle
|
93
|
+
# The idle function to handle
|
95
94
|
def idle
|
96
|
-
|
95
|
+
glutPostRedisplay
|
97
96
|
end
|
98
97
|
|
99
98
|
# Keyboard handler to exit when ESC is typed
|
100
99
|
keyboard = lambda do |key, x, y|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
100
|
+
case key
|
101
|
+
when ?\e
|
102
|
+
glutDestroyWindow window
|
103
|
+
exit(0)
|
104
|
+
end
|
105
|
+
glutPostRedisplay
|
107
106
|
end
|
108
107
|
|
109
108
|
|
110
109
|
# Initliaze our GLUT code
|
111
|
-
glutInit
|
110
|
+
glutInit
|
112
111
|
# Setup a double buffer, RGBA color, alpha components and depth buffer
|
113
|
-
glutInitDisplayMode
|
114
|
-
glutInitWindowSize
|
115
|
-
glutInitWindowPosition
|
116
|
-
window = glutCreateWindow
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
glutKeyboardFunc
|
121
|
-
init_gl_window
|
122
|
-
glutMainLoop
|
112
|
+
glutInitDisplayMode GLUT_RGB | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH
|
113
|
+
glutInitWindowSize 640, 480
|
114
|
+
glutInitWindowPosition 0, 0
|
115
|
+
window = glutCreateWindow "NeHe Lesson 03 - ruby-opengl version"
|
116
|
+
glutIdleFunc :idle
|
117
|
+
glutDisplayFunc :draw_gl_scene
|
118
|
+
glutReshapeFunc :reshape
|
119
|
+
glutKeyboardFunc keyboard
|
120
|
+
init_gl_window 640, 480
|
121
|
+
glutMainLoop
|
122
|
+
|