remogatto-ffi-opengl 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/README.rdoc +2 -2
- data/Rakefile +1 -1
- data/bench/bench_spinning_cube.rb +2 -1
- data/bench/ffi-opengl_spinning_cube.rb +3 -1
- data/examples/gears.rb +3 -2
- data/examples/spinning_cube.rb +2 -1
- data/lib/ffi-opengl.rb +5 -48
- data/lib/ffi-opengl/glut.rb +26 -26
- data/tasks/generator.rake +4 -1
- metadata +14 -11
- data/ffi-opengl.gemspec +0 -34
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -20,8 +20,8 @@ don't expect idiomatic ruby inside!
|
|
20
20
|
|
21
21
|
* No need of opengl development libraries.
|
22
22
|
|
23
|
-
* No compilation needed (
|
24
|
-
|
23
|
+
* No compilation needed (once you have ruby-ffi installed or you are
|
24
|
+
using JRuby).
|
25
25
|
|
26
26
|
* Not yet tested on windows platform.
|
27
27
|
|
data/Rakefile
CHANGED
@@ -22,7 +22,7 @@ PROJ.name = 'ffi-opengl'
|
|
22
22
|
PROJ.authors = 'Andrea Fazzi'
|
23
23
|
PROJ.email = 'andrea.fazzi@alcacoop.it'
|
24
24
|
PROJ.url = 'http://github.com/remogatto/ffi-opengl'
|
25
|
-
PROJ.version =
|
25
|
+
PROJ.version = '0.2.1'
|
26
26
|
PROJ.rubyforge.name = 'ffi-opengl'
|
27
27
|
|
28
28
|
PROJ.readme_file = 'README.rdoc'
|
@@ -1,5 +1,7 @@
|
|
1
|
+
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
|
2
|
+
require 'ffi-opengl'
|
1
3
|
require File.expand_path(File.join(File.dirname(__FILE__), %w[.. examples spinning_cube]))
|
2
|
-
|
4
|
+
|
3
5
|
|
4
6
|
include FFI, GL, GLU, GLUT
|
5
7
|
app = SpinningCube.new(ARGV[0].to_i)
|
data/examples/gears.rb
CHANGED
@@ -10,10 +10,11 @@
|
|
10
10
|
# 2005-01-09 Original C version (gears.c) by Brian Paul et al.
|
11
11
|
# http://cvs.freedesktop.org/mesa/Mesa/progs/demos/gears.c?rev=1.8
|
12
12
|
|
13
|
-
|
13
|
+
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
|
14
|
+
require 'ffi-opengl'
|
14
15
|
|
15
16
|
class Gears
|
16
|
-
include FFI, GL, GLU, GLUT
|
17
|
+
include FFI, GL, GLU, GLUT, Math
|
17
18
|
|
18
19
|
POS = MemoryPointer.new(:float, 4).put_array_of_float(0, [5.0, 5.0, 10.0, 0.0])
|
19
20
|
RED = MemoryPointer.new(:float, 4).put_array_of_float(0, [0.8, 0.1, 0.0, 1.0])
|
data/examples/spinning_cube.rb
CHANGED
@@ -67,7 +67,8 @@ class SpinningCube
|
|
67
67
|
end
|
68
68
|
|
69
69
|
if __FILE__ == $0
|
70
|
-
|
70
|
+
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
|
71
|
+
require 'ffi-opengl'
|
71
72
|
include FFI, GL, GLU, GLUT
|
72
73
|
app = SpinningCube.new
|
73
74
|
app.light_diffuse = MemoryPointer.new(:float, 4).put_array_of_float(0, [1.0, 0.0, 0.0, 1.0])
|
data/lib/ffi-opengl.rb
CHANGED
@@ -1,55 +1,12 @@
|
|
1
|
-
module FFIOpenGL
|
2
|
-
|
3
|
-
# :stopdoc:
|
4
|
-
VERSION = '0.2.0'
|
5
|
-
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
6
|
-
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
7
|
-
# :startdoc:
|
8
|
-
|
9
|
-
# Returns the version string for the library.
|
10
|
-
#
|
11
|
-
def self.version
|
12
|
-
VERSION
|
13
|
-
end
|
14
|
-
|
15
|
-
# Returns the library path for the module. If any arguments are given,
|
16
|
-
# they will be joined to the end of the libray path using
|
17
|
-
# <tt>File.join</tt>.
|
18
|
-
#
|
19
|
-
def self.libpath( *args )
|
20
|
-
args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
21
|
-
end
|
22
|
-
|
23
|
-
# Returns the lpath for the module. If any arguments are given,
|
24
|
-
# they will be joined to the end of the path using
|
25
|
-
# <tt>File.join</tt>.
|
26
|
-
#
|
27
|
-
def self.path( *args )
|
28
|
-
args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Utility method used to require all files ending in .rb that lie in the
|
32
|
-
# directory below this file that has the same name as the filename passed
|
33
|
-
# in. Optionally, a specific _directory_ name can be passed in such that
|
34
|
-
# the _filename_ does not have to be equivalent to the directory.
|
35
|
-
#
|
36
|
-
def self.require_all_libs_relative_to( fname, dir = nil )
|
37
|
-
dir ||= ::File.basename(fname, '.*')
|
38
|
-
search_me = ::File.expand_path(
|
39
|
-
::File.join(::File.dirname(fname), dir, '**', '*.rb'))
|
40
|
-
|
41
|
-
Dir.glob(search_me).sort.each {|rb| require rb}
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
1
|
begin
|
47
2
|
require 'rubygems'
|
48
3
|
rescue
|
49
4
|
nil # try without it
|
50
5
|
end
|
6
|
+
|
51
7
|
require 'ffi'
|
52
|
-
require
|
53
|
-
|
8
|
+
require 'ffi-opengl/platform'
|
9
|
+
require 'ffi-opengl/gl'
|
10
|
+
require 'ffi-opengl/glu'
|
11
|
+
require 'ffi-opengl/glut'
|
54
12
|
|
55
|
-
# EOF
|
data/lib/ffi-opengl/glut.rb
CHANGED
@@ -201,7 +201,7 @@ module GLUT
|
|
201
201
|
attach_function :glutPostWindowOverlayRedisplay, [ :int ], :void
|
202
202
|
attach_function :glutShowOverlay, [ ], :void
|
203
203
|
attach_function :glutHideOverlay, [ ], :void
|
204
|
-
attach_function :glutCreateMenu, [ callback(
|
204
|
+
attach_function :glutCreateMenu, [ callback([ :int ], :void) ], :int
|
205
205
|
attach_function :glutDestroyMenu, [ :int ], :void
|
206
206
|
attach_function :glutGetMenu, [ ], :int
|
207
207
|
attach_function :glutSetMenu, [ :int ], :void
|
@@ -212,31 +212,31 @@ module GLUT
|
|
212
212
|
attach_function :glutRemoveMenuItem, [ :int ], :void
|
213
213
|
attach_function :glutAttachMenu, [ :int ], :void
|
214
214
|
attach_function :glutDetachMenu, [ :int ], :void
|
215
|
-
attach_function :glutTimerFunc, [ :uint, callback(
|
216
|
-
attach_function :glutIdleFunc, [ callback(
|
217
|
-
attach_function :glutKeyboardFunc, [ callback(
|
218
|
-
attach_function :glutSpecialFunc, [ callback(
|
219
|
-
attach_function :glutReshapeFunc, [ callback(
|
220
|
-
attach_function :glutVisibilityFunc, [ callback(
|
221
|
-
attach_function :glutDisplayFunc, [ callback(
|
222
|
-
attach_function :glutMouseFunc, [ callback(
|
223
|
-
attach_function :glutMotionFunc, [ callback(
|
224
|
-
attach_function :glutPassiveMotionFunc, [ callback(
|
225
|
-
attach_function :glutEntryFunc, [ callback(
|
226
|
-
attach_function :glutKeyboardUpFunc, [ callback(
|
227
|
-
attach_function :glutSpecialUpFunc, [ callback(
|
228
|
-
attach_function :glutJoystickFunc, [ callback(
|
229
|
-
attach_function :glutMenuStateFunc, [ callback(
|
230
|
-
attach_function :glutMenuStatusFunc, [ callback(
|
231
|
-
attach_function :glutOverlayDisplayFunc, [ callback(
|
232
|
-
attach_function :glutWindowStatusFunc, [ callback(
|
233
|
-
attach_function :glutSpaceballMotionFunc, [ callback(
|
234
|
-
attach_function :glutSpaceballRotateFunc, [ callback(
|
235
|
-
attach_function :glutSpaceballButtonFunc, [ callback(
|
236
|
-
attach_function :glutButtonBoxFunc, [ callback(
|
237
|
-
attach_function :glutDialsFunc, [ callback(
|
238
|
-
attach_function :glutTabletMotionFunc, [ callback(
|
239
|
-
attach_function :glutTabletButtonFunc, [ callback(
|
215
|
+
attach_function :glutTimerFunc, [ :uint, callback([ :int ], :void), :int ], :void
|
216
|
+
attach_function :glutIdleFunc, [ callback([ ], :void) ], :void
|
217
|
+
attach_function :glutKeyboardFunc, [ callback([ :uchar, :int, :int ], :void) ], :void
|
218
|
+
attach_function :glutSpecialFunc, [ callback([ :int, :int, :int ], :void) ], :void
|
219
|
+
attach_function :glutReshapeFunc, [ callback([ :int, :int ], :void) ], :void
|
220
|
+
attach_function :glutVisibilityFunc, [ callback([ :int ], :void) ], :void
|
221
|
+
attach_function :glutDisplayFunc, [ callback([ ], :void) ], :void
|
222
|
+
attach_function :glutMouseFunc, [ callback([ :int, :int, :int, :int ], :void) ], :void
|
223
|
+
attach_function :glutMotionFunc, [ callback([ :int, :int ], :void) ], :void
|
224
|
+
attach_function :glutPassiveMotionFunc, [ callback([ :int, :int ], :void) ], :void
|
225
|
+
attach_function :glutEntryFunc, [ callback([ :int ], :void) ], :void
|
226
|
+
attach_function :glutKeyboardUpFunc, [ callback([ :uchar, :int, :int ], :void) ], :void
|
227
|
+
attach_function :glutSpecialUpFunc, [ callback([ :int, :int, :int ], :void) ], :void
|
228
|
+
attach_function :glutJoystickFunc, [ callback([ :uint, :int, :int, :int ], :void), :int ], :void
|
229
|
+
attach_function :glutMenuStateFunc, [ callback([ :int ], :void) ], :void
|
230
|
+
attach_function :glutMenuStatusFunc, [ callback([ :int, :int, :int ], :void) ], :void
|
231
|
+
attach_function :glutOverlayDisplayFunc, [ callback([ ], :void) ], :void
|
232
|
+
attach_function :glutWindowStatusFunc, [ callback([ :int ], :void) ], :void
|
233
|
+
attach_function :glutSpaceballMotionFunc, [ callback([ :int, :int, :int ], :void) ], :void
|
234
|
+
attach_function :glutSpaceballRotateFunc, [ callback([ :int, :int, :int ], :void) ], :void
|
235
|
+
attach_function :glutSpaceballButtonFunc, [ callback([ :int, :int ], :void) ], :void
|
236
|
+
attach_function :glutButtonBoxFunc, [ callback([ :int, :int ], :void) ], :void
|
237
|
+
attach_function :glutDialsFunc, [ callback([ :int, :int ], :void) ], :void
|
238
|
+
attach_function :glutTabletMotionFunc, [ callback([ :int, :int ], :void) ], :void
|
239
|
+
attach_function :glutTabletButtonFunc, [ callback([ :int, :int, :int, :int ], :void) ], :void
|
240
240
|
attach_function :glutGet, [ :uint ], :int
|
241
241
|
attach_function :glutDeviceGet, [ :uint ], :int
|
242
242
|
attach_function :glutGetModifiers, [ ], :int
|
data/tasks/generator.rake
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
begin
|
2
2
|
require 'ffi-swig-generator'
|
3
|
-
FFI::Generator::Task.new
|
3
|
+
FFI::Generator::Task.new do |task|
|
4
|
+
task.input_fn = 'interfaces/*.i'
|
5
|
+
task.output_dir = 'generated/'
|
6
|
+
end
|
4
7
|
rescue LoadError
|
5
8
|
nil
|
6
9
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remogatto-ffi-opengl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrea Fazzi
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-17 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +22,16 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 0.3.0
|
24
24
|
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: bones
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.5.1
|
34
|
+
version:
|
25
35
|
description: "ffi-opengl is an autogenerated[1] ruby FFI interface towards OpenGL libraries (GL, GLU, GLUT). The FFI layer ensures compatibility among all Ruby implementation that support it. At the moment, this means that you can run the same ffi-opengl script with MRI Ruby and JRuby. ffi-opengl API aims to be a 1:1 tranposition of the OpenGL C API: don't expect idiomatic ruby inside!"
|
26
36
|
email: andrea.fazzi@alcacoop.it
|
27
37
|
executables: []
|
@@ -41,13 +51,6 @@ files:
|
|
41
51
|
- bench/ruby-opengl_spinning_cube.rb
|
42
52
|
- examples/gears.rb
|
43
53
|
- examples/spinning_cube.rb
|
44
|
-
- ffi-opengl.gemspec
|
45
|
-
- generated/gl_wrap.rb
|
46
|
-
- generated/gl_wrap.xml
|
47
|
-
- generated/glu_wrap.rb
|
48
|
-
- generated/glu_wrap.xml
|
49
|
-
- generated/glut_wrap.rb
|
50
|
-
- generated/glut_wrap.xml
|
51
54
|
- interfaces/freeglut_std.h
|
52
55
|
- interfaces/gl.h
|
53
56
|
- interfaces/gl.i
|
@@ -74,7 +77,7 @@ files:
|
|
74
77
|
- tasks/spec.rake
|
75
78
|
- tasks/svn.rake
|
76
79
|
- tasks/test.rake
|
77
|
-
has_rdoc:
|
80
|
+
has_rdoc: false
|
78
81
|
homepage: http://github.com/remogatto/ffi-opengl
|
79
82
|
post_install_message:
|
80
83
|
rdoc_options:
|
@@ -99,7 +102,7 @@ requirements: []
|
|
99
102
|
rubyforge_project: ffi-opengl
|
100
103
|
rubygems_version: 1.2.0
|
101
104
|
signing_key:
|
102
|
-
specification_version:
|
105
|
+
specification_version: 3
|
103
106
|
summary: ffi-opengl is an autogenerated[1] ruby FFI interface towards OpenGL libraries (GL, GLU, GLUT)
|
104
107
|
test_files: []
|
105
108
|
|
data/ffi-opengl.gemspec
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = %q{ffi-opengl}
|
5
|
-
s.version = "0.2.0"
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Andrea Fazzi"]
|
9
|
-
s.date = %q{2009-04-05}
|
10
|
-
s.description = %q{ffi-opengl is an autogenerated[1] ruby FFI interface towards OpenGL libraries (GL, GLU, GLUT). The FFI layer ensures compatibility among all Ruby implementation that support it. At the moment, this means that you can run the same ffi-opengl script with MRI Ruby and JRuby. ffi-opengl API aims to be a 1:1 tranposition of the OpenGL C API: don't expect idiomatic ruby inside!}
|
11
|
-
s.email = %q{andrea.fazzi@alcacoop.it}
|
12
|
-
s.extra_rdoc_files = ["History.txt", "README.rdoc"]
|
13
|
-
s.files = [".gitignore", "History.txt", "README.rdoc", "Rakefile", "bench/bench_spinning_cube.rb", "bench/ffi-opengl_spinning_cube.rb", "bench/ruby-opengl_spinning_cube.rb", "examples/gears.rb", "examples/spinning_cube.rb", "ffi-opengl.gemspec", "generated/gl_wrap.rb", "generated/gl_wrap.xml", "generated/glu_wrap.rb", "generated/glu_wrap.xml", "generated/glut_wrap.rb", "generated/glut_wrap.xml", "interfaces/freeglut_std.h", "interfaces/gl.h", "interfaces/gl.i", "interfaces/glu.h", "interfaces/glu.i", "interfaces/glut.i", "lib/ffi-opengl.rb", "lib/ffi-opengl/gl.rb", "lib/ffi-opengl/glu.rb", "lib/ffi-opengl/glut.rb", "lib/ffi-opengl/platform.rb", "spec/ffi-opengl_spec.rb", "spec/spec_helper.rb", "tasks/ann.rake", "tasks/bones.rake", "tasks/gem.rake", "tasks/generator.rake", "tasks/git.rake", "tasks/notes.rake", "tasks/post_load.rake", "tasks/rdoc.rake", "tasks/rubyforge.rake", "tasks/setup.rb", "tasks/spec.rake", "tasks/svn.rake", "tasks/test.rake"]
|
14
|
-
s.has_rdoc = true
|
15
|
-
s.homepage = %q{http://github.com/remogatto/ffi-opengl}
|
16
|
-
s.rdoc_options = ["--main", "README.rdoc"]
|
17
|
-
s.require_paths = ["lib"]
|
18
|
-
s.rubyforge_project = %q{ffi-opengl}
|
19
|
-
s.rubygems_version = %q{1.3.1}
|
20
|
-
s.summary = %q{ffi-opengl is an autogenerated[1] ruby FFI interface towards OpenGL libraries (GL, GLU, GLUT)}
|
21
|
-
|
22
|
-
if s.respond_to? :specification_version then
|
23
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
-
s.specification_version = 2
|
25
|
-
|
26
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
|
-
s.add_runtime_dependency(%q<ffi>, [">= 0.3.0"])
|
28
|
-
else
|
29
|
-
s.add_dependency(%q<ffi>, [">= 0.3.0"])
|
30
|
-
end
|
31
|
-
else
|
32
|
-
s.add_dependency(%q<ffi>, [">= 0.3.0"])
|
33
|
-
end
|
34
|
-
end
|