[MacRuby-devel] That bus error: Reproducible and with all gl calls!
Dave Baldwin
dave.baldwin at dsl.pipex.com
Tue May 5 00:42:04 PDT 2009
On 5 May 2009, at 00:17, Vincent Isambart wrote:
>
>
>> I also reproduce this on the experimental branch, and it's crashing
>> inside OpenGL. Maybe something needs to be done first, before
>> calling OpenGL? I know it's working nice inside a Cocoa application
>> context.
>>
>> I reproduce the same crash with Ruby 1.8 + RubyCocoa too:
>>
>> $ ruby -r osx/cocoa -e "OSX.require_framework 'OpenGL'; p
>> OSX.glMatrixMode(OSX::GL_PROJECTION)"
>
>
> And also with a simple C program:
> ~/tmp% cat e.c
> #include <OpenGL/gl.h>
>
> int main()
> {
> glMatrixMode(GL_PROJECTION);
> return 0;
> }
> ~/tmp% cat e.c
> #include <OpenGL/gl.h>
>
> int main()
> {
> glMatrixMode(GL_PROJECTION);
> return 0;
> }
> ~/tmp% gcc -framework OpenGL -o e e.c
> ~/tmp% ./e
> zsh: bus error ./e
>
> So as Laurent said, it's probably just an initialization problem.
You need to create an OpenGL context first before you can call any
OpenGL methods. The developer samples will show you how to do this.
Dave.
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
More information about the MacRuby-devel
mailing list