|
From: Jonathan P. <jp...@dc...> - 2005-04-17 11:46:18
|
On 17 Apr 2005, at 12:33, Remo Eichenberger wrote:
> hi all
>
> i try to implement the following:
>
> OSX::NSOpenGLPixelFormat.alloc.initWithAttributes(attribs)
>
> i found this in the cocoa-documentation:
>
> - (id)initWithAttributes:(NSOpenGLPixelFormatAttribute *)attribs
>
> How i can create "attribs"-variable with RubyCocoa ? must i use NSData
> ?
>
> i would translate the following:
>
> NSOpenGLPixelFormatAttribute attr[] = {
> NSOpenGLPFADoubleBuffer,
> NSOpenGLPFAAccelerated,
> NSOpenGLPFAColorSize, BITS_PER_PIXEL,
> NSOpenGLPFADepthSize, DEPTH_SIZE,
> 0
Try:
attribs = [OSX:: NSOpenGLPFADoubleBuffer,
OSX::NSOpenGLPFAAccelerated,
OSX::NSOpenGLPFAColorSize, BITS_PER_PIXEL,
OSX:: NSOpenGLPFADepthSize, DEPTH_SIZE, 0].pack("i*")
OSX::NSOpenGLPixelFormat.alloc.initWithAttributes(attribs)
|