[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RubyCocoa parameter conversion ?

the.rubist

4/16/2005 6:09:00 PM

hi all

i try to set the right parameter for the following Cocoa-Method with
RubyCocoa:

OSX::NSOpenGLPixelFormat.alloc.init.initWithAttributes

i don't know how i must initialize the "attribs" - parameter with
RubyCocoa. is there someone that can help me ? :)

thanks

the.rubist

4 Answers

acharlieblue

4/16/2005 6:47:00 PM

0


the.rubist wrote:
> i try to set the right parameter for the following Cocoa-Method with
> RubyCocoa:
>
> OSX::NSOpenGLPixelFormat.alloc.init.initWithAttributes
>
> i don't know how i must initialize the "attribs" - parameter with
> RubyCocoa.

The docs for the Objective-C version say it's a list of integers and
booleans. It looks like you'll need to define the appropriate constants
yourself (Apple's documentation has a list of them), but once you do
that, it should work pretty much as documented (assuming RubyCocoa
properly supports varargs).

By the way, you're not actually writing init.initWithAttributes, are
you?

the.rubist

4/16/2005 8:03:00 PM

0

thanks for info. i've tried many variants to transfer this
constant/int-array to this function with RubyCocoa, but nothing works.
yes, you're right, i've made a typo. i mean:

OSX::NSOpenGLPixelFormat.alloc.initWithAttributes( attribs )

the.rubist

4/17/2005 1:34:00 PM

0

someone on the mailinglist of rubycocoa helped me:

attribs = [OSX::NSOpenGLPFADoubleBuffer,
OSX::NSOpenGLPFAAccelerated,
OSX::NSOpenGLPFAColorSize, BITS_PER_PIXEL,
OSX::NSOpenGLPFADepthSize, DEPTH_SIZE, 0].pack("i*")

nsglFormat = OSX::NSOpenGLPixelFormat.alloc.initWithAttributes(
attribs )

that was the solution.

the.rubist

4/17/2005 1:34:00 PM

0

someone on the mailinglist of rubycocoa helped me:

attribs = [OSX::NSOpenGLPFADoubleBuffer,
OSX::NSOpenGLPFAAccelerated,
OSX::NSOpenGLPFAColorSize, BITS_PER_PIXEL,
OSX::NSOpenGLPFADepthSize, DEPTH_SIZE, 0].pack("i*")

nsglFormat = OSX::NSOpenGLPixelFormat.alloc.initWithAttributes(
attribs )

that was the solution.