Projects

Ticket #520 (new defect)

Opened 9 months ago

Last modified 7 months ago

Confusion in data type names for Core OpenGL

Reported by: sojastar07@… Owned by: lsansonetti@…
Priority: blocker Milestone:
Component: MacRuby Keywords: pointer Core OpenGL data types confusion
Cc:

Description

Core OpenGL data type names end with the 'Obj' suffix, yet Core OpenGL functions called in MacRuby expect the same names but with the 'Object' suffix. Maybe a bridge problem ?

An example reducing the problem can be found here :  http://github.com/sojastar/Some-MacRuby-sample-code/tree/master/buggy/cgl_renderer_info_obj/ The problem is visible at line 85 of file MyOpenGLView.rb

Change History

Changed 7 months ago by martinlagardette@…

I reduced the code, but haven't been able to find what exactly is causing the problem. The issue arise at the last line, when trying to dereference *CGLRendererInfoObject to CGLRendererInfoObject (aka ^{_CGLRendererInfoObject} to {_CGLRendererInfoObject})

$ cat test.rb
framework 'Cocoa'

renderer_info = Pointer.new_with_type("^{_CGLRendererInfoObject}")
renderer_count = Pointer.new_with_type("i")
CGLQueryRendererInfo(1, renderer_info, renderer_count)
renderer_info[0]

$ ./miniruby test.rb
/tmp/test.rb:1:in `<main>': unrecognized runtime type `{_CGLRendererInfoObject}' (TypeError)
Note: See TracTickets for help on using tickets.