rbglox 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjEzYjllYmJjYzI3OWIxMjQxYjllMjgzN2QwYzg1OTFiYzBhNTkyNw==
5
+ data.tar.gz: !binary |-
6
+ MTlmZTIwZDJiZDIyMGU1NmE0ZGVlNTJhOTc2NWJjYTVjYjhlNjZlMQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MzdlMzY3M2RmMWZiMDRiM2ZkMTcxOTI1MTU3Mzg2ZWVmZjQ0NGFmMTBkMDE3
10
+ MjAwZDhkNDQyMjZlMGZkNGE2MWRiOGQ1Yjk3NTNkMWM0YWQ4MTI2MWQ4YzA4
11
+ ZTEyMWM0MzZlMzZkMjg4Y2I2ZThkZTk0NzZhZDliNWJjODQwYzc=
12
+ data.tar.gz: !binary |-
13
+ M2JiNGMyNzU5YmY2N2NjNDQyMTNkMjk2MDRjZDgwYTliOTViYTU3ZmRkYzAy
14
+ YmYyZjhmMzkwNzVmNDM5MzAzYzVhNTY2YWVhMzIyYzVhOTU0OWU2MzFmYzkw
15
+ ZDMyZGM3MjlmY2MxMDM5YjUyY2Y5NTcwMDZmMTJmMDgyZmM4MDA=
data/README.md CHANGED
@@ -25,59 +25,60 @@ Getting Started
25
25
 
26
26
  Using rbGLox as a library is a very easy :)
27
27
 
28
- ```ruby
29
- require 'rbglox'
30
- class DemoApp < RBGLox::App
31
- def init
32
- @texture = RBGLox::Texture.new 'mosaic.tga'
33
- @r = 0.0
34
- @cube = RBGLox::MeshCube.new
35
- end
36
- def update
37
- @r += 0.1
38
- end
39
- def draw
40
- glTranslatef 0.0,0.0,-6.0
41
- glRotatef @r, 1.0, 1.0, 1.0
28
+ ```ruby
29
+ require 'rbglox'
30
+ class DemoApp < RBGLox::App
31
+ def init
32
+ @texture = RBGLox::Texture.new 'mosaic.tga'
33
+ @r = 0.0
34
+ @cube = RBGLox::MeshCube.new
35
+ end
36
+ def update
37
+ @r += 0.1
38
+ end
39
+ def draw
40
+ glTranslatef 0.0,0.0,-6.0
41
+ glRotatef @r, 1.0, 1.0, 1.0
42
42
 
43
- @texture.bind
44
- @cube.draw
45
- @texture.release
46
- end
47
- def shutdown
48
- @texture.free
49
- @cube.free
50
- end
51
- end
52
- ```
43
+ @texture.bind
44
+ @cube.draw
45
+ @texture.release
46
+ end
47
+ def shutdown
48
+ @texture.free
49
+ @cube.free
50
+ end
51
+ end
52
+ ```
53
53
 
54
54
  Now let's fire this up :)
55
55
 
56
- ```ruby
57
- DemoApp.new do |app|
58
- app.title = 'DemoApp'
59
- app.exec
60
- end
61
- ```
56
+ ```ruby
57
+ DemoApp.new do |app|
58
+ app.title = 'DemoApp'
59
+ app.exec
60
+ end
61
+ ```
62
62
 
63
63
  Additional methods you can override:
64
64
 
65
- ```ruby
66
- resize(h, w)
67
- begin_frame
68
- end_frame
69
- reload(event)
70
- ```
65
+ ```ruby
66
+ resize(h, w)
67
+ begin_frame
68
+ end_frame
69
+ reload(event)
70
+ ```
71
71
 
72
72
  #### Semi-automatic resource re-loading
73
73
 
74
- ```ruby
75
- DemoApp.new do |app|
76
- app.watch = 'data/'
77
- app.title = 'DemoApp'
78
- app.exec
79
- end
80
- ```
74
+ ```ruby
75
+ DemoApp.new do |app|
76
+ app.watch = 'data/'
77
+ app.title = 'DemoApp'
78
+ app.exec
79
+ end
80
+ ```
81
+
81
82
  If the `watch` variable is not `nil` then the given directory will be watched
82
83
  for any changes. (i.e file modified, file created, etc)
83
84
 
@@ -87,23 +88,25 @@ reload your resources.
87
88
  The included `RBGLox::Texture` and `RBGLox::Shader` classes have a `reload` method
88
89
  which facilitates this as illustrated in the example below.
89
90
 
90
- ```ruby
91
- ...
92
- def reload(event)
93
- if event.type == :modified
94
- texture1.reload if event.path =~ /myawesometexture.tga$/
95
- shader.reload if event.path =~ /myshader.glsl$/
96
- ...
97
- end
91
+ ```ruby
92
+ ...
93
+ def reload(event)
94
+ if event.type == :modified
95
+ texture1.reload if event.path =~ /myawesometexture.tga$/
96
+ shader.reload if event.path =~ /myshader.glsl$/
98
97
  ...
99
98
  end
100
99
  ...
101
- ```
100
+ end
101
+ ...
102
+ ```
102
103
 
103
104
  ### Executable
104
105
 
105
106
  It is also possible to use rbGLox as a cheap & rudimentary "GLSL" shader editor.
106
107
 
108
+ ![](https://raw.github.com/icebreaker/rbGLox/master/screenshot.png)
109
+
107
110
  In order to create a new project do the following:
108
111
 
109
112
  mkdir glsl-demo
@@ -35,7 +35,7 @@ class RBGLox::Texture < RBGLox::Resource
35
35
  glTexParameteri GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR
36
36
  glTexParameteri GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR
37
37
 
38
- if mipmaps:
38
+ if mipmaps
39
39
  glTexParameteri GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST
40
40
  glfwLoadTexture2D filename, GLFW_BUILD_MIPMAPS_BIT
41
41
  else
@@ -1,3 +1,3 @@
1
1
  module RBGLox
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,131 +1,136 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rbglox
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Mihail Szabolcs
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2011-06-19 00:00:00 +03:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2014-11-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: ruby-opengl
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 237
30
- segments:
31
- - 0
32
- - 60
33
- - 1
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
34
19
  version: 0.60.1
35
20
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.60.1
27
+ - !ruby/object:Gem::Dependency
38
28
  name: ruby-glfw
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.9.1
34
+ type: :runtime
39
35
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 57
46
- segments:
47
- - 0
48
- - 9
49
- - 1
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
50
40
  version: 0.9.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: glut
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: 8.2.1
51
48
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: directory_watcher
55
49
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 7
62
- segments:
63
- - 1
64
- - 4
65
- - 0
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 8.2.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: glu
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 8.2.1
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 8.2.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: directory_watcher
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
66
75
  version: 1.4.0
67
76
  type: :runtime
68
- version_requirements: *id003
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: 1.4.0
69
83
  description: rbGLox is a small wrapper over the ruby-opengl, ruby-glfw.
70
- email:
84
+ email:
71
85
  - szaby@szabster.net
72
- executables:
86
+ executables:
73
87
  - rbglox
74
88
  extensions: []
75
-
76
- extra_rdoc_files:
89
+ extra_rdoc_files:
77
90
  - README.md
78
91
  - LICENSE
79
- files:
80
- - lib/rbglox/window.rb
81
- - lib/rbglox/texture.rb
82
- - lib/rbglox/resource.rb
92
+ files:
93
+ - LICENSE
94
+ - README.md
95
+ - bin/rbglox
96
+ - lib/rbglox.rb
83
97
  - lib/rbglox/app.rb
84
98
  - lib/rbglox/mesh.rb
85
99
  - lib/rbglox/meshcube.rb
86
100
  - lib/rbglox/meshquad.rb
101
+ - lib/rbglox/resource.rb
87
102
  - lib/rbglox/shader.rb
103
+ - lib/rbglox/texture.rb
88
104
  - lib/rbglox/version.rb
89
- - lib/rbglox.rb
105
+ - lib/rbglox/window.rb
90
106
  - res/shader.glsl
91
107
  - res/texture.tga
92
- - README.md
93
- - LICENSE
94
108
  - test/test_rbglox.rb
95
- - bin/rbglox
96
- has_rdoc: true
97
109
  homepage: http://github.com/icebreaker/rbglox
98
110
  licenses: []
99
-
111
+ metadata: {}
100
112
  post_install_message:
101
- rdoc_options:
113
+ rdoc_options:
102
114
  - --charset=UTF-8
103
- require_paths:
115
+ require_paths:
104
116
  - lib
105
- required_ruby_version: !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- hash: 3
111
- segments:
112
- - 0
113
- version: "0"
114
- required_rubygems_version: !ruby/object:Gem::Requirement
115
- none: false
116
- requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- hash: 3
120
- segments:
121
- - 0
122
- version: "0"
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ! '>='
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
123
127
  requirements: []
124
-
125
128
  rubyforge_project: rbglox
126
- rubygems_version: 1.3.7
129
+ rubygems_version: 2.2.2
127
130
  signing_key:
128
- specification_version: 3
129
- summary: rbGLox is a small wrapper over the ruby-opengl, ruby-glfw family by abstracting and providing some high-level interfaces for things like "Textures", "GLSL Shaders", basic "Geometry" and others.
130
- test_files:
131
+ specification_version: 4
132
+ summary: rbGLox is a small wrapper over the ruby-opengl, ruby-glfw family by abstracting
133
+ and providing some high-level interfaces for things like "Textures", "GLSL Shaders",
134
+ basic "Geometry" and others.
135
+ test_files:
131
136
  - test/test_rbglox.rb