ruby-opengl 0.50.0 → 0.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. data/Rakefile +15 -11
  2. data/doc/build_install.txt +10 -6
  3. data/doc/extensions.txt.in +348 -0
  4. data/doc/history.txt +4 -0
  5. data/doc/roadmap.txt +4 -6
  6. data/doc/scientific_use.txt +7 -0
  7. data/doc/supplies/page_template.html +2 -1
  8. data/doc/thanks.txt +5 -0
  9. data/doc/tutorial.txt +431 -121
  10. data/examples/NeHe/nehe_lesson02.rb +1 -1
  11. data/examples/NeHe/nehe_lesson03.rb +1 -1
  12. data/examples/NeHe/nehe_lesson04.rb +1 -1
  13. data/examples/NeHe/nehe_lesson05.rb +1 -1
  14. data/examples/NeHe/nehe_lesson36.rb +1 -1
  15. data/examples/OrangeBook/brick.rb +3 -15
  16. data/examples/OrangeBook/particle.rb +2 -20
  17. data/examples/RedBook/aapoly.rb +1 -1
  18. data/examples/RedBook/aargb.rb +2 -2
  19. data/examples/RedBook/accanti.rb +1 -1
  20. data/examples/RedBook/accpersp.rb +1 -1
  21. data/examples/RedBook/alpha.rb +2 -2
  22. data/examples/RedBook/alpha3D.rb +1 -1
  23. data/examples/RedBook/bezcurve.rb +1 -1
  24. data/examples/RedBook/bezmesh.rb +1 -1
  25. data/examples/RedBook/checker.rb +1 -1
  26. data/examples/RedBook/clip.rb +1 -1
  27. data/examples/RedBook/colormat.rb +1 -1
  28. data/examples/RedBook/cube.rb +1 -1
  29. data/examples/RedBook/depthcue.rb +1 -1
  30. data/examples/RedBook/dof.rb +1 -1
  31. data/examples/RedBook/double.rb +1 -1
  32. data/examples/RedBook/drawf.rb +1 -1
  33. data/examples/RedBook/feedback.rb +1 -1
  34. data/examples/RedBook/fog.rb +1 -1
  35. data/examples/RedBook/font.rb +2 -2
  36. data/examples/RedBook/hello.rb +1 -1
  37. data/examples/RedBook/image.rb +4 -4
  38. data/examples/RedBook/lines.rb +1 -1
  39. data/examples/RedBook/list.rb +1 -1
  40. data/examples/RedBook/material.rb +1 -1
  41. data/examples/RedBook/mipmap.rb +1 -1
  42. data/examples/RedBook/model.rb +1 -1
  43. data/examples/RedBook/movelight.rb +1 -1
  44. data/examples/RedBook/pickdepth.rb +1 -1
  45. data/examples/RedBook/planet.rb +5 -5
  46. data/examples/RedBook/quadric.rb +1 -1
  47. data/examples/RedBook/robot.rb +5 -5
  48. data/examples/RedBook/select.rb +1 -1
  49. data/examples/RedBook/smooth.rb +1 -1
  50. data/examples/RedBook/stencil.rb +1 -1
  51. data/examples/RedBook/stroke.rb +2 -2
  52. data/examples/RedBook/surface.rb +1 -1
  53. data/examples/RedBook/teaambient.rb +1 -1
  54. data/examples/RedBook/teapots.rb +1 -1
  55. data/examples/RedBook/tess.rb +1 -1
  56. data/examples/RedBook/texbind.rb +1 -1
  57. data/examples/RedBook/texgen.rb +5 -5
  58. data/examples/RedBook/texturesurf.rb +1 -1
  59. data/examples/RedBook/varray.rb +1 -1
  60. data/examples/RedBook/wrap.rb +5 -5
  61. data/examples/misc/OGLBench.rb +337 -0
  62. data/examples/misc/anisotropic.rb +1 -1
  63. data/examples/misc/fbo_test.rb +356 -0
  64. data/examples/misc/font-glut.rb +1 -1
  65. data/examples/misc/glfwtest.rb +30 -0
  66. data/examples/misc/md2model.rb +15 -0
  67. data/examples/misc/plane.rb +1 -1
  68. data/examples/misc/readpixel.rb +1 -1
  69. data/examples/misc/sdltest.rb +34 -0
  70. data/examples/misc/trislam.rb +828 -0
  71. data/ext/common/common.h +126 -218
  72. data/ext/common/conv.h +244 -0
  73. data/ext/common/funcdef.h +280 -0
  74. data/ext/common/gl-error.h +23 -0
  75. data/ext/common/gl-types.h +14 -0
  76. data/ext/gl/gl-1.0-1.1.c +497 -1255
  77. data/ext/gl/gl-1.2.c +121 -304
  78. data/ext/gl/gl-1.3.c +78 -339
  79. data/ext/gl/gl-1.4.c +102 -164
  80. data/ext/gl/gl-1.5.c +42 -173
  81. data/ext/gl/gl-2.0.c +273 -1039
  82. data/ext/gl/gl-2.1.c +15 -19
  83. data/ext/gl/gl-enums.c +3 -2
  84. data/ext/gl/gl-error.c +104 -0
  85. data/ext/gl/gl-ext-3dfx.c +27 -0
  86. data/ext/gl/gl-ext-arb.c +812 -12
  87. data/ext/gl/gl-ext-ati.c +41 -0
  88. data/ext/gl/gl-ext-ext.c +791 -119
  89. data/ext/gl/gl-ext-gremedy.c +41 -0
  90. data/ext/gl/gl-ext-nv.c +679 -0
  91. data/ext/gl/gl.c +48 -28
  92. data/ext/gl/mkrf_conf.rb +13 -10
  93. data/ext/glu/glu-enums.c +3 -2
  94. data/ext/glu/glu.c +136 -41
  95. data/ext/glu/mkrf_conf.rb +15 -12
  96. data/ext/glut/glut.c +37 -80
  97. data/ext/glut/mkrf_conf.rb +17 -13
  98. data/lib/opengl.rb +29 -53
  99. data/test/tc_common.rb +9 -3
  100. data/test/tc_ext_arb.rb +397 -3
  101. data/test/tc_ext_ati.rb +33 -0
  102. data/test/tc_ext_ext.rb +479 -2
  103. data/test/tc_ext_gremedy.rb +36 -0
  104. data/test/tc_ext_nv.rb +357 -0
  105. data/test/tc_func_10_11.rb +93 -67
  106. data/test/tc_func_12.rb +11 -11
  107. data/test/tc_func_13.rb +38 -18
  108. data/test/tc_func_14.rb +2 -2
  109. data/test/tc_func_15.rb +10 -10
  110. data/test/tc_func_20.rb +20 -20
  111. data/test/tc_func_21.rb +53 -22
  112. data/test/tc_glu.rb +9 -4
  113. data/test/tc_misc.rb +15 -2
  114. metadata +22 -8
  115. data/doc/extensions.txt +0 -361
  116. data/examples/RedBook/aaindex.rb +0 -97
  117. data/examples/misc/smooth.rb +0 -42
  118. data/examples/misc/test.rb +0 -65
@@ -1,97 +0,0 @@
1
- #!/usr/bin/env ruby -rubygems
2
- require 'opengl'
3
- require 'rational'
4
- include Gl,Glu,Glut
5
-
6
-
7
- RAMPSIZE=16
8
- RAMP1START=32
9
- RAMP2START=48
10
-
11
- STDOUT.sync = TRUE
12
- $rotAngle = 0
13
-
14
- # Initialize antialiasing for color index mode,
15
- # including loading a green color ramp starting
16
- # at RAMP1START, and a blue color ramp starting
17
- # at RAMP2START. The ramps must be a multiple of 16.
18
- def myinit
19
- for i in (0..RAMPSIZE)
20
- shade = i.to_f/RAMPSIZE.to_f
21
- glutSetColor(RAMP1START+i, 0, shade, 0.0)
22
- glutSetColor(RAMP2START+i, 0, 0, shade)
23
- end
24
-
25
- glEnable(GL_LINE_SMOOTH)
26
- glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE)
27
- glLineWidth(1.5)
28
-
29
- glClearIndex(RAMP1START)
30
- end
31
-
32
- display = Proc.new do
33
- glClear(GL_COLOR_BUFFER_BIT)
34
-
35
- glIndexi(RAMP1START)
36
- glPushMatrix()
37
- glRotate(-$rotAngle, 0.0, 0.0, 0.1)
38
- glBegin(GL_LINES)
39
- glVertex(-0.5, 0.5)
40
- glVertex(0.5, -0.5)
41
- glEnd
42
- glPopMatrix()
43
-
44
- # glIndexi(RAMP2START)
45
- glPushMatrix()
46
- glRotate($rotAngle, 0.0, 0.0, 0.1)
47
- glBegin(GL_LINES)
48
- glVertex(0.5, 0.5)
49
- glVertex(-0.5, -0.5)
50
- glEnd
51
- glPopMatrix()
52
-
53
- glutSwapBuffers()
54
- end
55
-
56
- reshape = Proc.new do |w, h|
57
- glViewport(0, 0, w, h)
58
- glMatrixMode(GL_PROJECTION)
59
- glLoadIdentity()
60
- if (w <= h)
61
- gluOrtho2D(-1.0, 1.0, -h.to_f/w.to_f, h.to_f/w.to_f)
62
- else
63
- gluOrtho2D(w.to_f/h.to_f, w.to_f/h.to_f, -1.0, 1.0)
64
- end
65
- glMatrixMode(GL_MODELVIEW)
66
- glLoadIdentity()
67
- end
68
-
69
- keyboard = Proc.new do |key, x, y|
70
- case (key)
71
- when 'r'[0]
72
- $rotAngle += 20
73
- $rotAngle = 0 if ($rotAngle >= 360)
74
- glutPostRedisplay()
75
- when 'R'[0]
76
- $rotAngle -= 20
77
- $rotAngle = 360 if ($rotAngle <= 0)
78
- glutPostRedisplay()
79
- when 27
80
- exit(0)
81
- end
82
- end
83
-
84
- # Main Loop
85
- # Open window with initial window size, title bar,
86
- # color index display mode, and handle input events.
87
- #
88
- glutInit
89
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_INDEX)
90
- glutInitWindowSize(500, 500)
91
- glutInitWindowPosition(100, 100)
92
- glutCreateWindow($0)
93
- myinit
94
- glutReshapeFunc(reshape)
95
- glutKeyboardFunc(keyboard)
96
- glutDisplayFunc(display)
97
- glutMainLoop
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env ruby -rubygems
2
-
3
- require "gl"
4
- require "glut"
5
-
6
- STDOUT.sync=TRUE
7
- disp = Proc.new {
8
- Gl.glClear(Gl::GL_COLOR_BUFFER_BIT)
9
- Gl.glBegin(Gl::GL_TRIANGLES)
10
- Gl.glColor(0.0, 0.0, 1.0)
11
- Gl.glVertex(0, 0)
12
- Gl.glColor(0.0, 1.0, 0.0)
13
- Gl.glVertex(200, 200)
14
- Gl.glColor(1.0, 0.0, 0.0)
15
- Gl.glVertex(20, 200)
16
- Gl.glEnd
17
- Gl.glFlush
18
- }
19
-
20
- reshape = Proc.new {|w, h|
21
- Gl.glViewport(0, 0, w, h)
22
- Gl.glMatrixMode(Gl::GL_PROJECTION)
23
- Gl.glLoadIdentity
24
- Gl.glOrtho(0, w, 0, h, -1, 1)
25
- Gl.glScale(1, -1, 1)
26
- Gl.glTranslate(0, -h, 0)
27
- }
28
-
29
- # Keyboard handler to exit when ESC is typed
30
- keyboard = lambda do |key, x, y|
31
- case(key)
32
- when 27
33
- exit(0)
34
- end
35
- end
36
-
37
- Glut.glutInit
38
- a = Glut.glutCreateWindow("single triangle");
39
- Glut.glutDisplayFunc(disp);
40
- Glut.glutReshapeFunc(reshape);
41
- Glut.glutKeyboardFunc( keyboard )
42
- Glut.glutMainLoop;
@@ -1,65 +0,0 @@
1
- #!/usr/bin/env ruby -rubygems
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
- require 'glut'
16
- require 'gl'
17
-
18
- class GlutTest
19
-
20
- def initialize
21
- puts "=== GlutTest.initialize ==="
22
- # Setup the GLUT display loop callback
23
- @display = lambda do
24
- puts "=== In display routine"
25
- Gl.glClear( Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT )
26
- Gl.glColor3f( 1.0, 1.0, 1.0 )
27
-
28
- Gl.glBegin( Gl::GL_POLYGON )
29
-
30
- Gl.glVertex2f( -0.5, -0.5 )
31
- Gl.glVertex2f( -0.5, 0.5 )
32
- Gl.glVertex2f( 0.5, 0.5 )
33
- Gl.glVertex2f( 0.5, -0.5 )
34
-
35
- Gl.glEnd
36
-
37
- Gl.glFlush
38
- end
39
-
40
- # Keyboard handler to exit when ESC is typed
41
- @keyboard = lambda do |key, x, y|
42
- case(key)
43
- when 27
44
- exit(0)
45
- end
46
- end
47
- end
48
-
49
- def show
50
- puts "=== GlutTest.show ==="
51
- Glut.glutInit
52
- Glut.glutInitDisplayMode( Glut::GLUT_DOUBLE | Glut::GLUT_RGB | Glut::GLUT_DEPTH )
53
- Glut.glutCreateWindow( 'pbm' )
54
- Glut.glutDisplayFunc( @display )
55
- #Glut.glutReshapeFunc( @reshape )
56
- Glut.glutKeyboardFunc( @keyboard ) if @keyboard
57
- Glut.glutMainLoop
58
- end
59
- end
60
-
61
- if __FILE__ == $0
62
- gt = GlutTest.new
63
- gt.show
64
- end
65
-