opengl-bindings 1.6.15 → 1.6.16
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.
- checksums.yaml +4 -4
- data/ChangeLog +725 -721
- data/LICENSE.txt +1 -1
- data/README.md +767 -731
- data/lib/glfw.rb +766 -766
- data/lib/glfw33.rb +716 -716
- data/lib/glu.rb +366 -366
- data/lib/glut.rb +576 -576
- data/lib/opengl.rb +43 -43
- data/lib/opengl_command.rb +7347 -7347
- data/lib/opengl_common.rb +54 -54
- data/lib/opengl_enum.rb +1818 -1818
- data/lib/opengl_es.rb +31 -31
- data/lib/opengl_es_command.rb +2517 -2517
- data/lib/opengl_es_enum.rb +1011 -1011
- data/lib/opengl_es_ext.rb +28 -28
- data/lib/opengl_es_ext_command.rb +8809 -8698
- data/lib/opengl_es_ext_enum.rb +6497 -6303
- data/lib/opengl_ext.rb +34 -34
- data/lib/opengl_ext_command.rb +30939 -30834
- data/lib/opengl_ext_common.rb +52 -52
- data/lib/opengl_ext_enum.rb +14379 -14164
- data/lib/opengl_linux.rb +63 -63
- data/lib/opengl_macosx.rb +68 -68
- data/lib/opengl_platform.rb +43 -43
- data/lib/opengl_windows.rb +71 -71
- data/sample/README.md +54 -54
- data/sample/glfw_build.bat +0 -0
- data/sample/glfw_build.sh +14 -14
- data/sample/simple.rb +62 -62
- data/sample/simple_glut.rb +70 -70
- metadata +3 -3
data/sample/simple.rb
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
#
|
|
2
|
-
# For more samples, visit https://github.com/vaiorabbit/ruby-opengl/tree/master/sample .
|
|
3
|
-
#
|
|
4
|
-
# Ref.: /glfw-3.0.1/examples/simple.c
|
|
5
|
-
#
|
|
6
|
-
require 'opengl'
|
|
7
|
-
require 'glfw'
|
|
8
|
-
|
|
9
|
-
OpenGL.load_lib()
|
|
10
|
-
GLFW.load_lib()
|
|
11
|
-
|
|
12
|
-
include OpenGL
|
|
13
|
-
include GLFW
|
|
14
|
-
|
|
15
|
-
# Press ESC to exit.
|
|
16
|
-
key_callback = GLFW::create_callback(:GLFWkeyfun) do |window_handle, key, scancode, action, mods|
|
|
17
|
-
if key == GLFW_KEY_ESCAPE && action == GLFW_PRESS
|
|
18
|
-
glfwSetWindowShouldClose(window_handle, 1)
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
if __FILE__ == $0
|
|
23
|
-
glfwInit()
|
|
24
|
-
|
|
25
|
-
window = glfwCreateWindow( 640, 480, "Simple example", nil, nil )
|
|
26
|
-
glfwMakeContextCurrent( window )
|
|
27
|
-
glfwSetKeyCallback( window, key_callback )
|
|
28
|
-
|
|
29
|
-
while glfwWindowShouldClose( window ) == 0
|
|
30
|
-
width_ptr = ' ' * 8
|
|
31
|
-
height_ptr = ' ' * 8
|
|
32
|
-
glfwGetFramebufferSize(window, width_ptr, height_ptr)
|
|
33
|
-
width = width_ptr.unpack('L')[0]
|
|
34
|
-
height = height_ptr.unpack('L')[0]
|
|
35
|
-
ratio = width.to_f / height.to_f
|
|
36
|
-
|
|
37
|
-
glViewport(0, 0, width, height)
|
|
38
|
-
glClear(GL_COLOR_BUFFER_BIT)
|
|
39
|
-
glMatrixMode(GL_PROJECTION)
|
|
40
|
-
glLoadIdentity()
|
|
41
|
-
glOrtho(-ratio, ratio, -1.0, 1.0, 1.0, -1.0)
|
|
42
|
-
glMatrixMode(GL_MODELVIEW)
|
|
43
|
-
|
|
44
|
-
glLoadIdentity()
|
|
45
|
-
glRotatef(glfwGetTime() * 50.0, 0.0, 0.0, 1.0)
|
|
46
|
-
|
|
47
|
-
glBegin(GL_TRIANGLES)
|
|
48
|
-
glColor3f(1.0, 0.0, 0.0)
|
|
49
|
-
glVertex3f(-0.6, -0.4, 0.0)
|
|
50
|
-
glColor3f(0.0, 1.0, 0.0)
|
|
51
|
-
glVertex3f(0.6, -0.4, 0.0)
|
|
52
|
-
glColor3f(0.0, 0.0, 1.0)
|
|
53
|
-
glVertex3f(0.0, 0.6, 0.0)
|
|
54
|
-
glEnd()
|
|
55
|
-
|
|
56
|
-
glfwSwapBuffers( window )
|
|
57
|
-
glfwPollEvents()
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
glfwDestroyWindow( window )
|
|
61
|
-
glfwTerminate()
|
|
62
|
-
end
|
|
1
|
+
#
|
|
2
|
+
# For more samples, visit https://github.com/vaiorabbit/ruby-opengl/tree/master/sample .
|
|
3
|
+
#
|
|
4
|
+
# Ref.: /glfw-3.0.1/examples/simple.c
|
|
5
|
+
#
|
|
6
|
+
require 'opengl'
|
|
7
|
+
require 'glfw'
|
|
8
|
+
|
|
9
|
+
OpenGL.load_lib()
|
|
10
|
+
GLFW.load_lib()
|
|
11
|
+
|
|
12
|
+
include OpenGL
|
|
13
|
+
include GLFW
|
|
14
|
+
|
|
15
|
+
# Press ESC to exit.
|
|
16
|
+
key_callback = GLFW::create_callback(:GLFWkeyfun) do |window_handle, key, scancode, action, mods|
|
|
17
|
+
if key == GLFW_KEY_ESCAPE && action == GLFW_PRESS
|
|
18
|
+
glfwSetWindowShouldClose(window_handle, 1)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
if __FILE__ == $0
|
|
23
|
+
glfwInit()
|
|
24
|
+
|
|
25
|
+
window = glfwCreateWindow( 640, 480, "Simple example", nil, nil )
|
|
26
|
+
glfwMakeContextCurrent( window )
|
|
27
|
+
glfwSetKeyCallback( window, key_callback )
|
|
28
|
+
|
|
29
|
+
while glfwWindowShouldClose( window ) == 0
|
|
30
|
+
width_ptr = ' ' * 8
|
|
31
|
+
height_ptr = ' ' * 8
|
|
32
|
+
glfwGetFramebufferSize(window, width_ptr, height_ptr)
|
|
33
|
+
width = width_ptr.unpack('L')[0]
|
|
34
|
+
height = height_ptr.unpack('L')[0]
|
|
35
|
+
ratio = width.to_f / height.to_f
|
|
36
|
+
|
|
37
|
+
glViewport(0, 0, width, height)
|
|
38
|
+
glClear(GL_COLOR_BUFFER_BIT)
|
|
39
|
+
glMatrixMode(GL_PROJECTION)
|
|
40
|
+
glLoadIdentity()
|
|
41
|
+
glOrtho(-ratio, ratio, -1.0, 1.0, 1.0, -1.0)
|
|
42
|
+
glMatrixMode(GL_MODELVIEW)
|
|
43
|
+
|
|
44
|
+
glLoadIdentity()
|
|
45
|
+
glRotatef(glfwGetTime() * 50.0, 0.0, 0.0, 1.0)
|
|
46
|
+
|
|
47
|
+
glBegin(GL_TRIANGLES)
|
|
48
|
+
glColor3f(1.0, 0.0, 0.0)
|
|
49
|
+
glVertex3f(-0.6, -0.4, 0.0)
|
|
50
|
+
glColor3f(0.0, 1.0, 0.0)
|
|
51
|
+
glVertex3f(0.6, -0.4, 0.0)
|
|
52
|
+
glColor3f(0.0, 0.0, 1.0)
|
|
53
|
+
glVertex3f(0.0, 0.6, 0.0)
|
|
54
|
+
glEnd()
|
|
55
|
+
|
|
56
|
+
glfwSwapBuffers( window )
|
|
57
|
+
glfwPollEvents()
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
glfwDestroyWindow( window )
|
|
61
|
+
glfwTerminate()
|
|
62
|
+
end
|
data/sample/simple_glut.rb
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
#
|
|
2
|
-
# For more samples, visit https://github.com/vaiorabbit/ruby-opengl/tree/master/sample .
|
|
3
|
-
#
|
|
4
|
-
# Ref.: /glfw-3.0.1/examples/simple.c
|
|
5
|
-
#
|
|
6
|
-
require 'opengl'
|
|
7
|
-
require 'glut'
|
|
8
|
-
|
|
9
|
-
OpenGL.load_lib()
|
|
10
|
-
GLUT.load_lib()
|
|
11
|
-
|
|
12
|
-
include OpenGL
|
|
13
|
-
include GLUT
|
|
14
|
-
|
|
15
|
-
$radian = 0
|
|
16
|
-
|
|
17
|
-
def display
|
|
18
|
-
glClear(GL_COLOR_BUFFER_BIT)
|
|
19
|
-
glLoadIdentity()
|
|
20
|
-
glRotatef($radian * 50.0, 0.0, 0.0, 1.0)
|
|
21
|
-
|
|
22
|
-
glBegin(GL_TRIANGLES)
|
|
23
|
-
glColor3f(1.0, 0.0, 0.0)
|
|
24
|
-
glVertex3f(-0.6, -0.4, 0.0)
|
|
25
|
-
glColor3f(0.0, 1.0, 0.0)
|
|
26
|
-
glVertex3f(0.6, -0.4, 0.0)
|
|
27
|
-
glColor3f(0.0, 0.0, 1.0)
|
|
28
|
-
glVertex3f(0.0, 0.6, 0.0)
|
|
29
|
-
glEnd()
|
|
30
|
-
|
|
31
|
-
glutSwapBuffers()
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def reshape( width, height )
|
|
35
|
-
ratio = width.to_f / height.to_f
|
|
36
|
-
glViewport(0, 0, width, height)
|
|
37
|
-
glMatrixMode(GL_PROJECTION)
|
|
38
|
-
glLoadIdentity()
|
|
39
|
-
glOrtho(-ratio, ratio, -1.0, 1.0, 1.0, -1.0)
|
|
40
|
-
glMatrixMode(GL_MODELVIEW)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def keyboard( key, x, y )
|
|
44
|
-
case key
|
|
45
|
-
when 27 # Press ESC to exit.
|
|
46
|
-
exit
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def timer( value )
|
|
51
|
-
$radian += (1.0 * Math::PI / 180.0)
|
|
52
|
-
glutTimerFunc(0, GLUT.create_callback(:GLUTTimerFunc, method(:timer).to_proc), value)
|
|
53
|
-
glutPostRedisplay()
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
if __FILE__ == $0
|
|
57
|
-
glutInit([1].pack('I'), [""].pack('p'))
|
|
58
|
-
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH )
|
|
59
|
-
glutInitWindowSize(640, 480);
|
|
60
|
-
glutInitWindowPosition(100, 100)
|
|
61
|
-
glutCreateWindow("Simple example")
|
|
62
|
-
glutDisplayFunc(GLUT.create_callback(:GLUTDisplayFunc, method(:display).to_proc))
|
|
63
|
-
glutReshapeFunc(GLUT.create_callback(:GLUTReshapeFunc, method(:reshape).to_proc))
|
|
64
|
-
glutKeyboardFunc(GLUT.create_callback(:GLUTKeyboardFunc, method(:keyboard).to_proc))
|
|
65
|
-
glutTimerFunc(0, GLUT.create_callback(:GLUTTimerFunc, method(:timer).to_proc), 0)
|
|
66
|
-
|
|
67
|
-
glClearColor( 0.0, 0.0, 0.0, 1 )
|
|
68
|
-
|
|
69
|
-
glutMainLoop()
|
|
70
|
-
end
|
|
1
|
+
#
|
|
2
|
+
# For more samples, visit https://github.com/vaiorabbit/ruby-opengl/tree/master/sample .
|
|
3
|
+
#
|
|
4
|
+
# Ref.: /glfw-3.0.1/examples/simple.c
|
|
5
|
+
#
|
|
6
|
+
require 'opengl'
|
|
7
|
+
require 'glut'
|
|
8
|
+
|
|
9
|
+
OpenGL.load_lib()
|
|
10
|
+
GLUT.load_lib()
|
|
11
|
+
|
|
12
|
+
include OpenGL
|
|
13
|
+
include GLUT
|
|
14
|
+
|
|
15
|
+
$radian = 0
|
|
16
|
+
|
|
17
|
+
def display
|
|
18
|
+
glClear(GL_COLOR_BUFFER_BIT)
|
|
19
|
+
glLoadIdentity()
|
|
20
|
+
glRotatef($radian * 50.0, 0.0, 0.0, 1.0)
|
|
21
|
+
|
|
22
|
+
glBegin(GL_TRIANGLES)
|
|
23
|
+
glColor3f(1.0, 0.0, 0.0)
|
|
24
|
+
glVertex3f(-0.6, -0.4, 0.0)
|
|
25
|
+
glColor3f(0.0, 1.0, 0.0)
|
|
26
|
+
glVertex3f(0.6, -0.4, 0.0)
|
|
27
|
+
glColor3f(0.0, 0.0, 1.0)
|
|
28
|
+
glVertex3f(0.0, 0.6, 0.0)
|
|
29
|
+
glEnd()
|
|
30
|
+
|
|
31
|
+
glutSwapBuffers()
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def reshape( width, height )
|
|
35
|
+
ratio = width.to_f / height.to_f
|
|
36
|
+
glViewport(0, 0, width, height)
|
|
37
|
+
glMatrixMode(GL_PROJECTION)
|
|
38
|
+
glLoadIdentity()
|
|
39
|
+
glOrtho(-ratio, ratio, -1.0, 1.0, 1.0, -1.0)
|
|
40
|
+
glMatrixMode(GL_MODELVIEW)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def keyboard( key, x, y )
|
|
44
|
+
case key
|
|
45
|
+
when 27 # Press ESC to exit.
|
|
46
|
+
exit
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def timer( value )
|
|
51
|
+
$radian += (1.0 * Math::PI / 180.0)
|
|
52
|
+
glutTimerFunc(0, GLUT.create_callback(:GLUTTimerFunc, method(:timer).to_proc), value)
|
|
53
|
+
glutPostRedisplay()
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
if __FILE__ == $0
|
|
57
|
+
glutInit([1].pack('I'), [""].pack('p'))
|
|
58
|
+
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH )
|
|
59
|
+
glutInitWindowSize(640, 480);
|
|
60
|
+
glutInitWindowPosition(100, 100)
|
|
61
|
+
glutCreateWindow("Simple example")
|
|
62
|
+
glutDisplayFunc(GLUT.create_callback(:GLUTDisplayFunc, method(:display).to_proc))
|
|
63
|
+
glutReshapeFunc(GLUT.create_callback(:GLUTReshapeFunc, method(:reshape).to_proc))
|
|
64
|
+
glutKeyboardFunc(GLUT.create_callback(:GLUTKeyboardFunc, method(:keyboard).to_proc))
|
|
65
|
+
glutTimerFunc(0, GLUT.create_callback(:GLUTTimerFunc, method(:timer).to_proc), 0)
|
|
66
|
+
|
|
67
|
+
glClearColor( 0.0, 0.0, 0.0, 1 )
|
|
68
|
+
|
|
69
|
+
glutMainLoop()
|
|
70
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opengl-bindings
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- vaiorabbit
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: fiddle
|
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '0'
|
|
83
83
|
requirements: []
|
|
84
|
-
rubygems_version:
|
|
84
|
+
rubygems_version: 4.0.3
|
|
85
85
|
specification_version: 4
|
|
86
86
|
summary: "[Attention : Version 2 is now available] Bindings for OpenGL/GLFW/GLUT/GLU"
|
|
87
87
|
test_files: []
|