rubygl 0.1.0 → 0.2.1

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 (38) hide show
  1. checksums.yaml +13 -5
  2. data/.travis/push-rdoc-to-gh-pages.sh +22 -0
  3. data/.travis.yml +18 -0
  4. data/Gemfile +7 -0
  5. data/Gemfile.lock +12 -0
  6. data/LICENSE +21 -21
  7. data/README.md +40 -0
  8. data/Rakefile +98 -83
  9. data/bin/ffi_code_gen.rb +166 -166
  10. data/bin/gl_code_gen.rb +458 -458
  11. data/examples/faceted_example.rb +71 -64
  12. data/examples/instanced_example.rb +135 -127
  13. data/examples/phong_example.rb +80 -71
  14. data/ext/windows/RubyGL.so +0 -0
  15. data/lib/rubygl/event.rb +64 -0
  16. data/lib/{RubyGL → rubygl}/geometry.rb +216 -211
  17. data/lib/{RubyGL → rubygl}/math.rb +300 -300
  18. data/lib/{RubyGL → rubygl}/memory.rb +125 -121
  19. data/lib/rubygl/native/all_enums.rb +641 -0
  20. data/lib/{RubyGL/Native → rubygl/native}/glcontext.rb +23 -47
  21. data/lib/{RubyGL/Native → rubygl/native}/include/GLContext.h +36 -36
  22. data/lib/{RubyGL/Native → rubygl/native}/include/Input.h +15 -15
  23. data/lib/{RubyGL/Native → rubygl/native}/include/Window.h +27 -27
  24. data/lib/rubygl/native/input.rb +247 -0
  25. data/lib/{RubyGL/Native → rubygl/native}/opengl.rb +2808 -2032
  26. data/lib/{RubyGL/Native → rubygl/native}/src/GLContext.c +72 -72
  27. data/lib/{RubyGL/Native → rubygl/native}/src/Input.c +25 -25
  28. data/lib/{RubyGL/Native → rubygl/native}/src/Window.c +57 -57
  29. data/lib/{RubyGL/Native → rubygl/native}/window.rb +24 -24
  30. data/lib/{RubyGL → rubygl}/setup.rb +50 -50
  31. data/lib/{RubyGL → rubygl}/shader.rb +203 -203
  32. data/lib/{RubyGL → rubygl}/util.rb +77 -77
  33. data/lib/rubygl.rb +49 -48
  34. data/{RubyGL.gemspec → rubygl.gemspec} +20 -23
  35. data/test/test_util.rb +19 -0
  36. metadata +36 -33
  37. data/lib/RubyGL/Native/input.rb +0 -13
  38. data/lib/RubyGL/callback.rb +0 -10
@@ -1,23 +1,20 @@
1
- # coding: utf-8
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = 'rubygl'
5
- spec.version = '0.1.0'
6
- spec.authors = ["Andrew Miller"]
7
- spec.email = ["millera9@seattleu.edu"]
8
- spec.summary = %q{A Complete Solution For Graphics Programming In Ruby}
9
- spec.description = %q{This library provides you with all of the essentials for
10
- doing graphics programming in Ruby including windowing, context management,
11
- 1:1 mapping of OpenGL calls, and input handling. The backend of this library
12
- consists of FFI functions with 1:1 mapping to the C code that makes all of this
13
- possible. The frontend of this library provides abstractions for interacting with
14
- the backend functionality so that you do not have to deal with the manual memory
15
- management from within Ruby that the backend requires.}
16
- spec.homepage = "https://github.com/GGist/RubyGL"
17
- spec.license = "MIT"
18
-
19
- spec.files = `git ls-files`.split($/)
20
- spec.require_paths = ["lib"]
21
-
22
- spec.add_dependency 'ffi'
23
- end
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.authors = ["Andrew Miller"]
5
+ spec.email = ["millera9@seattleu.edu"]
6
+ spec.homepage = "https://github.com/GGist/RubyGL"
7
+
8
+ spec.summary = %q{A Complete Solution For Graphics Programming In Ruby.}
9
+ spec.description = %q{This library provides you with all of the essentials for
10
+ doing graphics programming in Ruby including windowing, context management,
11
+ 1:1 mapping of OpenGL calls, and input handling.}
12
+
13
+ spec.files = `git ls-files`.split($/)
14
+ spec.name = 'rubygl'
15
+ spec.version = '0.2.1'
16
+ spec.require_paths = ["lib"]
17
+ spec.license = "MIT"
18
+
19
+ spec.add_runtime_dependency 'ffi', '~> 0'
20
+ end
data/test/test_util.rb ADDED
@@ -0,0 +1,19 @@
1
+ require 'test/unit'
2
+ require 'rubygl/util'
3
+
4
+ class TestUtil < Test::Unit::TestCase
5
+
6
+ def test_overflow_wrap
7
+ data = [1, 2, 3, 4, 5]
8
+
9
+ normal_entry = RubyGL::Util.overflow_wrap(data, 1)
10
+ assert_equal(2, normal_entry)
11
+
12
+ underflow_entry = RubyGL::Util.overflow_wrap(data, -1)
13
+ assert_equal(5, underflow_entry)
14
+
15
+ overflow_entry = RubyGL::Util.overflow_wrap(data, 5)
16
+ assert_equal(1, overflow_entry)
17
+ end
18
+
19
+ end
metadata CHANGED
@@ -1,45 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Miller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-22 00:00:00.000000000 Z
11
+ date: 2014-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: "This library provides you with all of the essentials for \n doing graphics
28
- programming in Ruby including windowing, context management, \n 1:1 mapping of
29
- OpenGL calls, and input handling. The backend of this library \n consists of FFI
30
- functions with 1:1 mapping to the C code that makes all of this \n possible. The
31
- frontend of this library provides abstractions for interacting with\n the backend
32
- functionality so that you do not have to deal with the manual memory\n management
33
- from within Ruby that the backend requires."
27
+ description: ! "This library provides you with all of the essentials for \n doing
28
+ graphics programming in Ruby including windowing, context management, \n 1:1 mapping
29
+ of OpenGL calls, and input handling."
34
30
  email:
35
31
  - millera9@seattleu.edu
36
32
  executables: []
37
33
  extensions: []
38
34
  extra_rdoc_files: []
39
35
  files:
36
+ - .travis.yml
37
+ - .travis/push-rdoc-to-gh-pages.sh
38
+ - Gemfile
39
+ - Gemfile.lock
40
40
  - LICENSE
41
+ - README.md
41
42
  - Rakefile
42
- - RubyGL.gemspec
43
43
  - bin/ffi_code_gen.rb
44
44
  - bin/gl_code_gen.rb
45
45
  - examples/faceted_example.rb
@@ -47,24 +47,27 @@ files:
47
47
  - examples/phong_example.rb
48
48
  - ext/windows/RubyGL.so
49
49
  - ext/windows/SDL2.dll
50
- - lib/RubyGL/Native/glcontext.rb
51
- - lib/RubyGL/Native/include/GLContext.h
52
- - lib/RubyGL/Native/include/Input.h
53
- - lib/RubyGL/Native/include/Window.h
54
- - lib/RubyGL/Native/input.rb
55
- - lib/RubyGL/Native/opengl.rb
56
- - lib/RubyGL/Native/src/GLContext.c
57
- - lib/RubyGL/Native/src/Input.c
58
- - lib/RubyGL/Native/src/Window.c
59
- - lib/RubyGL/Native/window.rb
60
- - lib/RubyGL/callback.rb
61
- - lib/RubyGL/geometry.rb
62
- - lib/RubyGL/math.rb
63
- - lib/RubyGL/memory.rb
64
- - lib/RubyGL/setup.rb
65
- - lib/RubyGL/shader.rb
66
- - lib/RubyGL/util.rb
67
50
  - lib/rubygl.rb
51
+ - lib/rubygl/event.rb
52
+ - lib/rubygl/geometry.rb
53
+ - lib/rubygl/math.rb
54
+ - lib/rubygl/memory.rb
55
+ - lib/rubygl/native/all_enums.rb
56
+ - lib/rubygl/native/glcontext.rb
57
+ - lib/rubygl/native/include/GLContext.h
58
+ - lib/rubygl/native/include/Input.h
59
+ - lib/rubygl/native/include/Window.h
60
+ - lib/rubygl/native/input.rb
61
+ - lib/rubygl/native/opengl.rb
62
+ - lib/rubygl/native/src/GLContext.c
63
+ - lib/rubygl/native/src/Input.c
64
+ - lib/rubygl/native/src/Window.c
65
+ - lib/rubygl/native/window.rb
66
+ - lib/rubygl/setup.rb
67
+ - lib/rubygl/shader.rb
68
+ - lib/rubygl/util.rb
69
+ - rubygl.gemspec
70
+ - test/test_util.rb
68
71
  homepage: https://github.com/GGist/RubyGL
69
72
  licenses:
70
73
  - MIT
@@ -75,18 +78,18 @@ require_paths:
75
78
  - lib
76
79
  required_ruby_version: !ruby/object:Gem::Requirement
77
80
  requirements:
78
- - - '>='
81
+ - - ! '>='
79
82
  - !ruby/object:Gem::Version
80
83
  version: '0'
81
84
  required_rubygems_version: !ruby/object:Gem::Requirement
82
85
  requirements:
83
- - - '>='
86
+ - - ! '>='
84
87
  - !ruby/object:Gem::Version
85
88
  version: '0'
86
89
  requirements: []
87
90
  rubyforge_project:
88
- rubygems_version: 2.0.14
91
+ rubygems_version: 2.4.2
89
92
  signing_key:
90
93
  specification_version: 4
91
- summary: A Complete Solution For Graphics Programming In Ruby
94
+ summary: A Complete Solution For Graphics Programming In Ruby.
92
95
  test_files: []
@@ -1,13 +0,0 @@
1
- require 'ffi'
2
-
3
- module RubyGL::Native
4
- class EventType < FFI::Union
5
-
6
- end
7
-
8
- attach_function :initInput, [], :int
9
- attach_function :quitInput, [], :void
10
- attach_function :addEventWatch, [:pointer, :pointer], :void
11
- attach_function :deleteEventWatch, [:pointer, :pointer], :void
12
- attach_function :pumpEvents, [], :void
13
- end
@@ -1,10 +0,0 @@
1
-
2
- module RubyGL
3
-
4
- class InputCallback
5
- def self.register()
6
-
7
- end
8
- end
9
-
10
- end