Module: GLU
- Extended by:
- Fiddle::Importer
- Defined in:
- lib/glu.rb
Constant Summary collapse
- GLU_FUNCTIONS_MAP =
Fiddle’s default ‘extern’ stores all methods into local variable ‘@func_map’, that makes difficult to ‘include GLFW’. So I override it and replace ‘@func_map’ into ‘GLFW_FUNCTIONS_MAP’. Ref.: /lib/ruby/2.0.0/fiddle/import.rb
{}
- GLU_EXT_object_space_tess =
Extensions
1
- GLU_EXT_nurbs_tessellator =
1
- GLU_FALSE =
Boolean
0
- GLU_TRUE =
1
- GLU_VERSION_1_1 =
Version
1
- GLU_VERSION_1_2 =
1
- GLU_VERSION_1_3 =
1
- GLU_VERSION =
StringName
100800
- GLU_EXTENSIONS =
100801
- GLU_INVALID_ENUM =
ErrorCode
100900
- GLU_INVALID_VALUE =
100901
- GLU_OUT_OF_MEMORY =
100902
- GLU_INCOMPATIBLE_GL_VERSION =
100903
- GLU_INVALID_OPERATION =
100904
- GLU_OUTLINE_POLYGON =
NurbsDisplay GLU_FILL
100240
- GLU_OUTLINE_PATCH =
100241
- GLU_NURBS_ERROR =
NurbsCallback
100103
- GLU_ERROR =
100103
- GLU_NURBS_BEGIN =
100164
- GLU_NURBS_BEGIN_EXT =
100164
- GLU_NURBS_VERTEX =
100165
- GLU_NURBS_VERTEX_EXT =
100165
- GLU_NURBS_NORMAL =
100166
- GLU_NURBS_NORMAL_EXT =
100166
- GLU_NURBS_COLOR =
100167
- GLU_NURBS_COLOR_EXT =
100167
- GLU_NURBS_TEXTURE_COORD =
100168
- GLU_NURBS_TEX_COORD_EXT =
100168
- GLU_NURBS_END =
100169
- GLU_NURBS_END_EXT =
100169
- GLU_NURBS_BEGIN_DATA =
100170
- GLU_NURBS_BEGIN_DATA_EXT =
100170
- GLU_NURBS_VERTEX_DATA =
100171
- GLU_NURBS_VERTEX_DATA_EXT =
100171
- GLU_NURBS_NORMAL_DATA =
100172
- GLU_NURBS_NORMAL_DATA_EXT =
100172
- GLU_NURBS_COLOR_DATA =
100173
- GLU_NURBS_COLOR_DATA_EXT =
100173
- GLU_NURBS_TEXTURE_COORD_DATA =
100174
- GLU_NURBS_TEX_COORD_DATA_EXT =
100174
- GLU_NURBS_END_DATA =
100175
- GLU_NURBS_END_DATA_EXT =
100175
- GLU_NURBS_ERROR1 =
NurbsError
100251
- GLU_NURBS_ERROR2 =
spline order un-supported
100252
- GLU_NURBS_ERROR3 =
too few knots
100253
- GLU_NURBS_ERROR4 =
valid knot range is empty
100254
- GLU_NURBS_ERROR5 =
decreasing knot sequence
100255
- GLU_NURBS_ERROR6 =
knot multiplicity > spline order
100256
- GLU_NURBS_ERROR7 =
endcurve() must follow bgncurve()
100257
- GLU_NURBS_ERROR8 =
bgncurve() must precede endcurve()
100258
- GLU_NURBS_ERROR9 =
ctrlarray or knot vector is NULL
100259
- GLU_NURBS_ERROR10 =
can’t draw pwlcurves
100260
- GLU_NURBS_ERROR11 =
missing gluNurbsCurve()
100261
- GLU_NURBS_ERROR12 =
missing gluNurbsSurface()
100262
- GLU_NURBS_ERROR13 =
endtrim() must precede endsurface()
100263
- GLU_NURBS_ERROR14 =
bgnsurface() must precede endsurface()
100264
- GLU_NURBS_ERROR15 =
curve of improper type passed as trim curve
100265
- GLU_NURBS_ERROR16 =
bgnsurface() must precede bgntrim()
100266
- GLU_NURBS_ERROR17 =
endtrim() must follow bgntrim()
100267
- GLU_NURBS_ERROR18 =
bgntrim() must precede endtrim()
100268
- GLU_NURBS_ERROR19 =
invalid or missing trim curve
100269
- GLU_NURBS_ERROR20 =
bgntrim() must precede pwlcurve()
100270
- GLU_NURBS_ERROR21 =
pwlcurve referenced twice
100271
- GLU_NURBS_ERROR22 =
pwlcurve and nurbscurve mixed
100272
- GLU_NURBS_ERROR23 =
improper usage of trim data type
100273
- GLU_NURBS_ERROR24 =
nurbscurve referenced twice
100274
- GLU_NURBS_ERROR25 =
nurbscurve and pwlcurve mixed
100275
- GLU_NURBS_ERROR26 =
nurbssurface referenced twice
100276
- GLU_NURBS_ERROR27 =
invalid property
100277
- GLU_NURBS_ERROR28 =
endsurface() must follow bgnsurface()
100278
- GLU_NURBS_ERROR29 =
intersecting or misoriented trim curves
100279
- GLU_NURBS_ERROR30 =
intersecting trim curves
100280
- GLU_NURBS_ERROR31 =
UNUSED
100281
- GLU_NURBS_ERROR32 =
unconnected trim curves
100282
- GLU_NURBS_ERROR33 =
unknown knot error
100283
- GLU_NURBS_ERROR34 =
negative vertex count encountered
100284
- GLU_NURBS_ERROR35 =
negative byte-stride
100285
- GLU_NURBS_ERROR36 =
unknown type descriptor
100286
- GLU_NURBS_ERROR37 =
null control point reference
100287
- GLU_AUTO_LOAD_MATRIX =
NurbsProperty
100200
- GLU_CULLING =
100201
- GLU_SAMPLING_TOLERANCE =
100203
- GLU_DISPLAY_MODE =
100204
- GLU_PARAMETRIC_TOLERANCE =
100202
- GLU_SAMPLING_METHOD =
100205
- GLU_U_STEP =
100206
- GLU_V_STEP =
100207
- GLU_NURBS_MODE =
100160
- GLU_NURBS_MODE_EXT =
100160
- GLU_NURBS_TESSELLATOR =
100161
- GLU_NURBS_TESSELLATOR_EXT =
100161
- GLU_NURBS_RENDERER =
100162
- GLU_NURBS_RENDERER_EXT =
100162
- GLU_OBJECT_PARAMETRIC_ERROR =
NurbsSampling
100208
- GLU_OBJECT_PARAMETRIC_ERROR_EXT =
100208
- GLU_OBJECT_PATH_LENGTH =
100209
- GLU_OBJECT_PATH_LENGTH_EXT =
100209
- GLU_PATH_LENGTH =
100215
- GLU_PARAMETRIC_ERROR =
100216
- GLU_DOMAIN_DISTANCE =
100217
- GLU_MAP1_TRIM_2 =
NurbsTrim
100210
- GLU_MAP1_TRIM_3 =
100211
- GLU_POINT =
QuadricDrawStyle
100010
- GLU_LINE =
100011
- GLU_FILL =
100012
- GLU_SILHOUETTE =
100013
- GLU_SMOOTH =
QuadricNormal
100000
- GLU_FLAT =
100001
- GLU_NONE =
100002
- GLU_OUTSIDE =
QuadricOrientation
100020
- GLU_INSIDE =
100021
- GLU_TESS_BEGIN =
TessCallback
100100
- GLU_BEGIN =
100100
- GLU_TESS_VERTEX =
100101
- GLU_VERTEX =
100101
- GLU_TESS_END =
100102
- GLU_END =
100102
- GLU_TESS_ERROR =
100103
- GLU_TESS_EDGE_FLAG =
100104
- GLU_EDGE_FLAG =
100104
- GLU_TESS_COMBINE =
100105
- GLU_TESS_BEGIN_DATA =
100106
- GLU_TESS_VERTEX_DATA =
100107
- GLU_TESS_END_DATA =
100108
- GLU_TESS_ERROR_DATA =
100109
- GLU_TESS_EDGE_FLAG_DATA =
100110
- GLU_TESS_COMBINE_DATA =
100111
- GLU_CW =
TessContour
100120
- GLU_CCW =
100121
- GLU_INTERIOR =
100122
- GLU_EXTERIOR =
100123
- GLU_UNKNOWN =
100124
- GLU_TESS_WINDING_RULE =
TessProperty
100140
- GLU_TESS_BOUNDARY_ONLY =
100141
- GLU_TESS_TOLERANCE =
100142
- GLU_TESS_ERROR1 =
TessError
100151
- GLU_TESS_ERROR2 =
100152
- GLU_TESS_ERROR3 =
100153
- GLU_TESS_ERROR4 =
100154
- GLU_TESS_ERROR5 =
100155
- GLU_TESS_ERROR6 =
100156
- GLU_TESS_ERROR7 =
100157
- GLU_TESS_ERROR8 =
100158
- GLU_TESS_MISSING_BEGIN_POLYGON =
100151
- GLU_TESS_MISSING_BEGIN_CONTOUR =
100152
- GLU_TESS_MISSING_END_POLYGON =
100153
- GLU_TESS_MISSING_END_CONTOUR =
100154
- GLU_TESS_COORD_TOO_LARGE =
100155
- GLU_TESS_NEED_COMBINE_CALLBACK =
100156
- GLU_TESS_WINDING_ODD =
TessWinding
100130
- GLU_TESS_WINDING_NONZERO =
100131
- GLU_TESS_WINDING_POSITIVE =
100132
- GLU_TESS_WINDING_NEGATIVE =
100133
- GLU_TESS_WINDING_ABS_GEQ_TWO =
100134
- GLU_TESS_MAX_COORD =
1.0e150
- @@glu_cb_signature =
typedefs
{ :NurbsCallback => "void CallBackFunc()", :QuadricCallback => "void CallBackFunc()", :TessCallback => "void CallBackFunc()", }
- @@glu_import_done =
struct
false
Class Method Summary collapse
- .create_callback(sym, *opts, &blk) ⇒ Object
- .extern(signature, *opts) ⇒ Object
- .import_symbols ⇒ Object
- .load_dll(lib = nil, path = nil) ⇒ Object
-
.load_lib(lib = nil, path = nil) ⇒ Object
Load native library.
Class Method Details
.create_callback(sym, *opts, &blk) ⇒ Object
244 245 246 |
# File 'lib/glu.rb', line 244 def self.create_callback( sym, *opts, &blk ) return bind( @@glu_cb_signature[sym], opts, &blk ) end |
.extern(signature, *opts) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/glu.rb', line 15 def self.extern(signature, *opts) symname, ctype, argtype = parse_signature(signature, @type_alias) opt = (opts) f = import_function(symname, ctype, argtype, opt[:call_type]) name = symname.gsub(/@.+/,'') GLU_FUNCTIONS_MAP[name] = f begin /^(.+?):(\d+)/ =~ caller.first file, line = $1, $2.to_i rescue file, line = __FILE__, __LINE__+3 end args_str="*args" module_eval(<<-EOS, file, line) def #{name}(*args, &block) GLU_FUNCTIONS_MAP['#{name}'].call(*args,&block) end EOS module_function(name) f end |
.import_symbols ⇒ Object
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
# File 'lib/glu.rb', line 277 def self.import_symbols # function extern 'void gluBeginCurve (void*)' extern 'void gluBeginPolygon (void*)' extern 'void gluBeginSurface (void*)' extern 'void gluBeginTrim (void*)' # extern 'int gluBuild1DMipmapLevels (unsigned int, int, int, unsigned int, unsigned int, int, int, int, void*)' # Unavailable on Windows extern 'int gluBuild1DMipmaps (unsigned int, int, int, unsigned int, unsigned int, void*)' # extern 'int gluBuild2DMipmapLevels (unsigned int, int, int, int, unsigned int, unsigned int, int, int, int, void*)' # Unavailable on Windows extern 'int gluBuild2DMipmaps (unsigned int, int, int, int, unsigned int, unsigned int, void*)' # extern 'int gluBuild3DMipmapLevels (unsigned int, int, int, int, int, unsigned int, unsigned int, int, int, int, void*)' # Unavailable on Windows # extern 'int gluBuild3DMipmaps (unsigned int, int, int, int, int, unsigned int, unsigned int, void*)' # Unavailable on Windows # extern 'unsigned char gluCheckExtension ( unsigned char*, unsigned char*)' # Unavailable on Windows extern 'void gluCylinder (void*, double, double, double, int, int)' extern 'void gluDeleteNurbsRenderer (void*)' extern 'void gluDeleteQuadric (void*)' extern 'void gluDeleteTess (void*)' extern 'void gluDisk (void*, double, double, int, int)' extern 'void gluEndCurve (void*)' extern 'void gluEndPolygon (void*)' extern 'void gluEndSurface (void*)' extern 'void gluEndTrim (void*)' extern 'unsigned char* gluErrorString (unsigned int)' extern 'void gluGetNurbsProperty (void*, unsigned int, float*)' extern 'unsigned char* gluGetString (unsigned int)' extern 'void gluGetTessProperty (void*, unsigned int, double*)' extern 'void gluLoadSamplingMatrices (void*, float *, float *, int *)' extern 'void gluLookAt (double, double, double , double, double , double, double , double, double)' extern 'void* gluNewNurbsRenderer ()' extern 'void* gluNewQuadric ()' extern 'void* gluNewTess ()' extern 'void gluNextContour (void*, unsigned int)' extern 'void gluNurbsCallback (void*, unsigned int, void*)' # extern 'void gluNurbsCallbackData (void*, void*)' # Unavailable on Windows # extern 'void gluNurbsCallbackDataEXT (void*, void*)' # Unavailable on Windows extern 'void gluNurbsCurve (void*, int, float *, int, float* , int, unsigned int)' extern 'void gluNurbsProperty (void*, unsigned int, float)' extern 'void gluNurbsSurface (void*, int, float*, int, float*, int, int, float*, int, int, unsigned int)' extern 'void gluOrtho2D (double, double, double, double)' extern 'void gluPartialDisk (void*, double, double, int, int, double, double)' extern 'void gluPerspective (double, double, double, double)' extern 'void gluPickMatrix (double, double, double, double, int *)' extern 'int gluProject (double, double, double, double *, double *, int *, double*, double*, double*)' extern 'void gluPwlCurve (void*, int, float*, int, unsigned int)' extern 'void gluQuadricCallback (void*, unsigned int, void*)' extern 'void gluQuadricDrawStyle (void*, unsigned int)' extern 'void gluQuadricNormals (void*, unsigned int)' extern 'void gluQuadricOrientation (void*, unsigned int)' extern 'void gluQuadricTexture (void*, unsigned char)' extern 'int gluScaleImage (unsigned int, int, int, unsigned int, void*, int, int, unsigned int, void*)' extern 'void gluSphere (void*, double, int, int)' extern 'void gluTessBeginContour (void*)' extern 'void gluTessBeginPolygon (void*, void*)' extern 'void gluTessCallback (void*, unsigned int, void*)' extern 'void gluTessEndContour (void*)' extern 'void gluTessEndPolygon (void*)' extern 'void gluTessNormal (void*, double, double, double)' extern 'void gluTessProperty (void*, unsigned int, double)' extern 'void gluTessVertex (void*, double *, void*)' extern 'int gluUnProject (double, double, double, double *, double *, int *, double*, double*, double*)' # extern 'int gluUnProject4 (double, double, double, double, double *, double *, int *, double, double, double*, double*, double*, double*)' # Unavailable on Windows @@glu_import_done = true end |
.load_dll(lib = nil, path = nil) ⇒ Object
272 273 274 275 |
# File 'lib/glu.rb', line 272 def self.load_dll(lib = nil, path = nil) puts "Warning GLU.load_dll is deprecated, use GLU.load_lib instead" self.load_lib(lib, path) end |
.load_lib(lib = nil, path = nil) ⇒ Object
Load native library.
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/glu.rb', line 253 def self.load_lib(lib = nil, path = nil) if lib == nil && path == nil case OpenGL.get_platform when :OPENGL_PLATFORM_WINDOWS lib, path = 'GLU32.dll', 'C:/Windows/System32' when :OPENGL_PLATFORM_MACOSX lib, path = 'libGLU.dylib', '/System/Library/Frameworks/OpenGL.framework/Libraries' else lib = 'libGLU.so' end end if path dlload (path + '/' + lib) else dlload (lib) end import_symbols() unless @@glu_import_done end |