@@ -38,46 +38,46 @@ namespace AppKit {
38
38
public partial class NSOpenGLPixelFormat {
39
39
static IntPtr selInitWithAttributes = Selector . GetHandle ( "initWithAttributes:" ) ;
40
40
41
- /// <param name="attribs">To be added .</param >
42
- /// <summary>To be added .</summary >
43
- /// <remarks>To be added.</remarks>
44
- public NSOpenGLPixelFormat ( NSOpenGLPixelFormatAttribute [ ] attribs ) : base ( NSObjectFlag . Empty )
41
+ /// <summary>Create a new <see cref="NSOpenGLPixelFormat" /> instance with the specified attributes .</summary >
42
+ /// <param name="attribs">The attributes to initialize the new <see cref="NSOpenGLPixelFormat" /> instance with .</param >
43
+ public NSOpenGLPixelFormat ( NSOpenGLPixelFormatAttribute [ ] attribs )
44
+ : base ( NSObjectFlag . Empty )
45
45
{
46
46
if ( attribs is null )
47
- throw new ArgumentNullException ( " attribs" ) ;
47
+ throw new ArgumentNullException ( nameof ( attribs ) ) ;
48
48
49
49
unsafe {
50
50
NSOpenGLPixelFormatAttribute [ ] copy = new NSOpenGLPixelFormatAttribute [ attribs . Length + 1 ] ;
51
51
Array . Copy ( attribs , 0 , copy , 0 , attribs . Length ) ;
52
52
53
53
fixed ( NSOpenGLPixelFormatAttribute * pArray = copy ) {
54
54
if ( IsDirectBinding ) {
55
- Handle = ObjCRuntime . Messaging . IntPtr_objc_msgSend_IntPtr ( this . Handle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) ;
55
+ InitializeHandle ( ObjCRuntime . Messaging . IntPtr_objc_msgSend_IntPtr ( this . Handle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) , "initWithAttributes:" ) ;
56
56
} else {
57
- Handle = ObjCRuntime . Messaging . IntPtr_objc_msgSendSuper_IntPtr ( this . SuperHandle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) ;
57
+ InitializeHandle ( ObjCRuntime . Messaging . IntPtr_objc_msgSendSuper_IntPtr ( this . SuperHandle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) , "initWithAttributes:" ) ;
58
58
}
59
59
}
60
60
61
61
}
62
62
}
63
63
64
- /// <param name="attribs">To be added .</param >
65
- /// <summary>To be added .</summary >
66
- /// <remarks>To be added.</remarks>
67
- public NSOpenGLPixelFormat ( uint [ ] attribs ) : base ( NSObjectFlag . Empty )
64
+ /// <summary>Create a new <see cref="NSOpenGLPixelFormat" /> instance with the specified attributes .</summary >
65
+ /// <param name="attribs">The attributes to initialize the new <see cref="NSOpenGLPixelFormat" /> instance with .</param >
66
+ public NSOpenGLPixelFormat ( uint [ ] attribs )
67
+ : base ( NSObjectFlag . Empty )
68
68
{
69
69
if ( attribs is null )
70
- throw new ArgumentNullException ( " attribs" ) ;
70
+ throw new ArgumentNullException ( nameof ( attribs ) ) ;
71
71
72
72
unsafe {
73
73
uint [ ] copy = new uint [ attribs . Length + 1 ] ;
74
74
Array . Copy ( attribs , 0 , copy , 0 , attribs . Length ) ;
75
75
76
76
fixed ( uint * pArray = copy ) {
77
77
if ( IsDirectBinding ) {
78
- InitializeHandle ( ObjCRuntime . Messaging . IntPtr_objc_msgSend_IntPtr ( this . Handle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) ) ;
78
+ InitializeHandle ( ObjCRuntime . Messaging . IntPtr_objc_msgSend_IntPtr ( this . Handle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) , "initWithAttributes:" ) ;
79
79
} else {
80
- InitializeHandle ( ObjCRuntime . Messaging . IntPtr_objc_msgSendSuper_IntPtr ( this . SuperHandle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) ) ;
80
+ InitializeHandle ( ObjCRuntime . Messaging . IntPtr_objc_msgSendSuper_IntPtr ( this . SuperHandle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) , "initWithAttributes:" ) ;
81
81
}
82
82
}
83
83
@@ -156,34 +156,11 @@ static uint [] ConvertToAttributes (object [] args)
156
156
return list . ToArray ( ) ;
157
157
}
158
158
159
- /// <param name="attribs">To be added .</param >
160
- /// <summary>To be added .</summary >
161
- /// <remarks>To be added.</remarks>
162
- public NSOpenGLPixelFormat ( params object [ ] attribs ) : this ( ConvertToAttributes ( attribs ) )
159
+ /// <summary>Create a new <see cref="NSOpenGLPixelFormat" /> instance with the specified attributes .</summary >
160
+ /// <param name="attribs">The attributes to initialize the new <see cref="NSOpenGLPixelFormat" /> instance with .</param >
161
+ public NSOpenGLPixelFormat ( params object [ ] attribs )
162
+ : this ( ConvertToAttributes ( attribs ) )
163
163
{
164
- if ( attribs is null )
165
- throw new ArgumentNullException ( "attribs" ) ;
166
-
167
- unsafe {
168
- var copy = new NSOpenGLPixelFormatAttribute [ attribs . Length + 1 /* null termination */ ] ;
169
- for ( int i = 0 ; i < attribs . Length ; i ++ ) {
170
- var input = attribs [ i ] ;
171
- if ( input is NSOpenGLPixelFormatAttribute ) {
172
- copy [ i ] = ( NSOpenGLPixelFormatAttribute ) input ;
173
- } else {
174
- copy [ i ] = ( NSOpenGLPixelFormatAttribute ) ( int ) input ;
175
- }
176
- }
177
-
178
- fixed ( NSOpenGLPixelFormatAttribute * pArray = copy ) {
179
- if ( IsDirectBinding ) {
180
- Handle = ObjCRuntime . Messaging . IntPtr_objc_msgSend_IntPtr ( this . Handle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) ;
181
- } else {
182
- Handle = ObjCRuntime . Messaging . IntPtr_objc_msgSendSuper_IntPtr ( this . SuperHandle , selInitWithAttributes , new IntPtr ( ( void * ) pArray ) ) ;
183
- }
184
- }
185
-
186
- }
187
164
}
188
165
}
189
166
}
0 commit comments