opengl-bindings 1.3.4 → 1.3.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c84dcca1003ef8fed28ec487d197a750afbdd012
4
- data.tar.gz: 2518a6b917d2753092c740efea892c0fc7d020ca
3
+ metadata.gz: 34908409a7d97ea590a5958347dd22e11c267b29
4
+ data.tar.gz: e6ebc20fc7c5da5b2a84b915b5dd3fa45740a42f
5
5
  SHA512:
6
- metadata.gz: 14a61dfd9f71e40352c05271a9045c0ce3c2c82056b2698fadddf90d22bd949d2513fb78bfcebf27d15ff3fdd596b9b7c155d29ee430cdb4d5241dbf61220d46
7
- data.tar.gz: 0962150cd7ef652308f8169fbc157051f9df749406fdf2c8fcdd59c4d88f6cc18e1362bb9e4617d00df1940b1e22d27e8c71c714d959381bf7167e5a80a6504b
6
+ metadata.gz: 6c0cb5d24dcd3670070febd324e8a5ccdef393fe17a90b3f195bc89c6420ddcd3731b32e0f9c07c18d43d89d76d352dd58f18f050e2035bda06b942ab2cb9486
7
+ data.tar.gz: e866ea7265fc71f96dab3306f438eb117e7de1bfa2905a09d9ff5ebc7dd35bc681974b0a9d537ba6dd88c9edbba3f7009137764b1caf8ffcdf92fa7269e96714
data/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2014-02-08 vaiorabbit <https://twitter.com/vaiorabbit>
2
+
3
+ * README.md: Added links to freeglut.
4
+ * sample/README.md: Updated.
5
+
6
+ 2014-02-02 vaiorabbit <https://twitter.com/vaiorabbit>
7
+
8
+ * sample/simple_glut.rb: Added.
9
+ * glut.rb: Fixed wrong glutTimerFunc signature.
10
+
1
11
  2014-01-31 vaiorabbit <https://twitter.com/vaiorabbit>
2
12
 
3
13
  * Updated using latest gl.xml.
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ...and wrapper code generator.
6
6
 
7
7
  * Created : 2013-08-28
8
- * Last modified : 2014-01-31
8
+ * Last modified : 2014-02-08
9
9
 
10
10
 
11
11
  ## Features ##
@@ -31,7 +31,7 @@ Or grab all library codes (`lib/*.rb') and use them by adding as one of the load
31
31
 
32
32
  ## How to use ##
33
33
 
34
- See sample/simple.rb.
34
+ See sample/simple.rb or sample/simple_glut.rb.
35
35
 
36
36
  To get more samples and generator scripts, please visit:
37
37
  https://github.com/vaiorabbit/ruby-opengl
@@ -86,10 +86,16 @@ https://github.com/vaiorabbit/ruby-opengl
86
86
 
87
87
  ### For sample ###
88
88
 
89
+ Use GLFW or GLUT for creating windows and OpenGL rendering contexts.
90
+
89
91
  * GLFW
90
92
  * http://www.glfw.org/
91
93
  * http://www.glfw.org/download.html
92
94
 
95
+ * freeglut
96
+ * http://freeglut.sourceforge.net
97
+ * http://freeglut.sourceforge.net/index.php#download
98
+
93
99
  ### For generator ###
94
100
 
95
101
  * nokogiri XML parser
@@ -260,10 +266,16 @@ https://github.com/vaiorabbit/ruby-opengl
260
266
 
261
267
  ### サンプル用 ###
262
268
 
269
+ GLFW か GLUT を用意してください。ウィンドウやレンダリングコンテキストの管理に必要です。
270
+
263
271
  * GLFW
264
272
  * http://www.glfw.org/
265
273
  * http://www.glfw.org/download.html
266
274
 
275
+ * freeglut
276
+ * http://freeglut.sourceforge.net
277
+ * http://freeglut.sourceforge.net/index.php#download
278
+
267
279
  ### 自動生成スクリプト用 ###
268
280
 
269
281
  * nokogiri XML パーサー
data/lib/glut.rb CHANGED
@@ -354,7 +354,7 @@ module GLUT
354
354
  extern 'void glutAttachMenu(int)'
355
355
  extern 'void glutDetachMenu(int)'
356
356
 
357
- extern 'void glutTimerFunc(unsigned int, void *)'
357
+ extern 'void glutTimerFunc(unsigned int, void *, int)'
358
358
  extern 'void glutIdleFunc(void *)'
359
359
 
360
360
  extern 'void glutKeyboardFunc(void *)'
data/sample/README.md CHANGED
@@ -1,7 +1,52 @@
1
- ### Getting GLFW (http://www.glfw.org) ###
1
+ For more samples, visit https://github.com/vaiorabbit/ruby-opengl/tree/master/sample .
2
+
3
+ ## Getting GLFW (http://www.glfw.org) ##
2
4
 
3
5
  * Windows
4
6
  * Put glfw3.dll here.
7
+ * Windows pre-compiled binaries:
8
+ * http://www.glfw.org/download.html
5
9
 
6
10
  * Mac OS X
7
11
  * run ./glfw_build_dylib.sh to get ./libglfw.dylib.
12
+
13
+ ## Getting GLUT ##
14
+
15
+ * Windows
16
+ * Use freeglut (http://freeglut.sourceforge.net).
17
+ * Put freeglut.dll here.
18
+ * Windows pre-compiled binaries:
19
+ * http://www.transmissionzero.co.uk/software/freeglut-devel/
20
+
21
+ * Mac OS X
22
+ * glut.rb refers /System/Library/Frameworks/GLUT.framework by default.
23
+ * If you want to use other GLUT dll, specify the dll path and file name
24
+ via the arguments of 'GLUT.load_dll'.
25
+ * See util/setup_dll.rb for example.
26
+ * https://github.com/vaiorabbit/ruby-opengl/blob/master/sample/util/setup_dll.rb
27
+
28
+ -------------------------------------------------------------------------------
29
+
30
+ ## GLFW�Υ��åȥ��å� (http://www.glfw.org) ##
31
+
32
+ * Windows
33
+ * glfw3.dll �򤳤������֤��Ƥ���������
34
+ * ����ѥ���ѤߥХ��ʥ�Ϥ�����:
35
+ * http://www.glfw.org/download.html
36
+
37
+ * Mac OS X
38
+ * ./glfw_build_dylib.sh ��¹Ԥ���� ./libglfw.dylib ���Ǥ�������ޤ���
39
+
40
+ ## GLUT�Υ��åȥ��å� ##
41
+
42
+ * Windows
43
+ * freeglut ��ȤäƤ������� (http://freeglut.sourceforge.net).
44
+ * freeglut.dll �򤳤������֤��Ƥ���������
45
+ * ����ѥ���ѤߥХ��ʥ�Ϥ�����:
46
+ * http://www.transmissionzero.co.uk/software/freeglut-devel/
47
+
48
+ * Mac OS X
49
+ * glut.rb �ϥǥե���Ȥ� /System/Library/Frameworks/GLUT.framework ��Ȥ��ޤ���
50
+ * �⤷����Ȥ��̤�GLUT��Ȥ��������� 'GLUT.load_dll' �ΰ����ǻ��ꤷ�Ƥ���������
51
+ * util/setup_dll.rb ��������ȤʤäƤ��ޤ���
52
+ * https://github.com/vaiorabbit/ruby-opengl/blob/master/sample/util/setup_dll.rb
@@ -0,0 +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_dll()
10
+ GLUT.load_dll()
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opengl-bindings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaiorabbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-31 00:00:00.000000000 Z
11
+ date: 2014-02-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Ruby bindings for OpenGL 1.0-4.4, OpenGL ES 2.0/3.0 and all extensions using Fiddle (For MRI >= 2.0.0).
@@ -45,6 +45,7 @@ files:
45
45
  - sample/report_env.rb
46
46
  - sample/report_env_es.rb
47
47
  - sample/simple.rb
48
+ - sample/simple_glut.rb
48
49
  homepage: https://github.com/vaiorabbit/ruby-opengl
49
50
  licenses:
50
51
  - zlib/libpng