objc2_open_gl/generated/
mod.rs

1// This file has been automatically generated by `objc2`'s `header-translator`.
2// DO NOT EDIT
3
4#![allow(unused_imports)]
5#![allow(deprecated)]
6#![allow(non_snake_case)]
7#![allow(non_camel_case_types)]
8#![allow(non_upper_case_globals)]
9#![allow(missing_docs)]
10#![allow(clippy::too_many_arguments)]
11#![allow(clippy::type_complexity)]
12#![allow(clippy::upper_case_acronyms)]
13#![allow(clippy::identity_op)]
14#![allow(clippy::missing_safety_doc)]
15#![allow(clippy::doc_lazy_continuation)]
16#![allow(rustdoc::broken_intra_doc_links)]
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::invalid_html_tags)]
19
20#[link(name = "OpenGL", kind = "framework")]
21extern "C" {}
22
23#[cfg(feature = "CGLCurrent")]
24#[path = "CGLCurrent.rs"]
25mod __CGLCurrent;
26#[cfg(feature = "CGLDevice")]
27#[path = "CGLDevice.rs"]
28mod __CGLDevice;
29#[cfg(feature = "CGLRenderers")]
30#[path = "CGLRenderers.rs"]
31mod __CGLRenderers;
32#[cfg(feature = "CGLTypes")]
33#[path = "CGLTypes.rs"]
34mod __CGLTypes;
35#[cfg(feature = "IOSurface")]
36#[path = "IOSurface.rs"]
37mod __IOSurface;
38
39#[cfg(all(feature = "CGLCurrent", feature = "CGLTypes"))]
40pub use self::__CGLCurrent::CGLGetCurrentContext;
41#[cfg(all(feature = "CGLCurrent", feature = "CGLTypes"))]
42pub use self::__CGLCurrent::CGLSetCurrentContext;
43#[cfg(all(feature = "CGLDevice", feature = "CGLTypes"))]
44pub use self::__CGLDevice::CGLGetShareGroup;
45#[cfg(feature = "CGLDevice")]
46pub use self::__CGLDevice::CGLShareGroupObj;
47#[cfg(feature = "CGLDevice")]
48pub use self::__CGLDevice::CGLShareGroupRec;
49#[cfg(feature = "CGLDevice")]
50pub(crate) use self::__CGLDevice::_cl_device_id;
51#[cfg(feature = "CGLDevice")]
52pub use self::__CGLDevice::cl_device_id;
53#[cfg(feature = "CGLDevice")]
54pub use self::__CGLDevice::CGLGetDeviceFromGLRenderer;
55#[cfg(feature = "CGLRenderers")]
56pub use self::__CGLRenderers::kCGLRendererATIRadeon8500ID;
57#[cfg(feature = "CGLRenderers")]
58pub use self::__CGLRenderers::kCGLRendererATIRadeon9700ID;
59#[cfg(feature = "CGLRenderers")]
60pub use self::__CGLRenderers::kCGLRendererATIRadeonID;
61#[cfg(feature = "CGLRenderers")]
62pub use self::__CGLRenderers::kCGLRendererATIRadeonX1000ID;
63#[cfg(feature = "CGLRenderers")]
64pub use self::__CGLRenderers::kCGLRendererATIRadeonX2000ID;
65#[cfg(feature = "CGLRenderers")]
66pub use self::__CGLRenderers::kCGLRendererATIRadeonX3000ID;
67#[cfg(feature = "CGLRenderers")]
68pub use self::__CGLRenderers::kCGLRendererATIRadeonX4000ID;
69#[cfg(feature = "CGLRenderers")]
70pub use self::__CGLRenderers::kCGLRendererATIRage128ID;
71#[cfg(feature = "CGLRenderers")]
72pub use self::__CGLRenderers::kCGLRendererATIRageProID;
73#[cfg(feature = "CGLRenderers")]
74pub use self::__CGLRenderers::kCGLRendererAppleSWID;
75#[cfg(feature = "CGLRenderers")]
76pub use self::__CGLRenderers::kCGLRendererGeForce2MXID;
77#[cfg(feature = "CGLRenderers")]
78pub use self::__CGLRenderers::kCGLRendererGeForce3ID;
79#[cfg(feature = "CGLRenderers")]
80pub use self::__CGLRenderers::kCGLRendererGeForce8xxxID;
81#[cfg(feature = "CGLRenderers")]
82pub use self::__CGLRenderers::kCGLRendererGeForceFXID;
83#[cfg(feature = "CGLRenderers")]
84pub use self::__CGLRenderers::kCGLRendererGeForceID;
85#[cfg(feature = "CGLRenderers")]
86pub use self::__CGLRenderers::kCGLRendererGenericFloatID;
87#[cfg(feature = "CGLRenderers")]
88pub use self::__CGLRenderers::kCGLRendererGenericID;
89#[cfg(feature = "CGLRenderers")]
90pub use self::__CGLRenderers::kCGLRendererIDMatchingMask;
91#[cfg(feature = "CGLRenderers")]
92pub use self::__CGLRenderers::kCGLRendererIntel900ID;
93#[cfg(feature = "CGLRenderers")]
94pub use self::__CGLRenderers::kCGLRendererIntelHD4000ID;
95#[cfg(feature = "CGLRenderers")]
96pub use self::__CGLRenderers::kCGLRendererIntelHD5000ID;
97#[cfg(feature = "CGLRenderers")]
98pub use self::__CGLRenderers::kCGLRendererIntelHDID;
99#[cfg(feature = "CGLRenderers")]
100pub use self::__CGLRenderers::kCGLRendererIntelX3100ID;
101#[cfg(feature = "CGLRenderers")]
102pub use self::__CGLRenderers::kCGLRendererMesa3DFXID;
103#[cfg(feature = "CGLRenderers")]
104pub use self::__CGLRenderers::kCGLRendererVTBladeXP2ID;
105#[cfg(feature = "CGLTypes")]
106pub(crate) use self::__CGLTypes::_CGLPBufferObject;
107#[cfg(feature = "CGLTypes")]
108pub(crate) use self::__CGLTypes::_CGLPixelFormatObject;
109#[cfg(feature = "CGLTypes")]
110pub(crate) use self::__CGLTypes::_CGLRendererInfoObject;
111#[cfg(feature = "CGLTypes")]
112pub use self::__CGLTypes::kCGL0Bit;
113#[cfg(feature = "CGLTypes")]
114pub use self::__CGLTypes::kCGL10Bit;
115#[cfg(feature = "CGLTypes")]
116pub use self::__CGLTypes::kCGL128Bit;
117#[cfg(feature = "CGLTypes")]
118pub use self::__CGLTypes::kCGL12Bit;
119#[cfg(feature = "CGLTypes")]
120pub use self::__CGLTypes::kCGL16Bit;
121#[cfg(feature = "CGLTypes")]
122pub use self::__CGLTypes::kCGL1Bit;
123#[cfg(feature = "CGLTypes")]
124pub use self::__CGLTypes::kCGL24Bit;
125#[cfg(feature = "CGLTypes")]
126pub use self::__CGLTypes::kCGL2Bit;
127#[cfg(feature = "CGLTypes")]
128pub use self::__CGLTypes::kCGL32Bit;
129#[cfg(feature = "CGLTypes")]
130pub use self::__CGLTypes::kCGL3Bit;
131#[cfg(feature = "CGLTypes")]
132pub use self::__CGLTypes::kCGL48Bit;
133#[cfg(feature = "CGLTypes")]
134pub use self::__CGLTypes::kCGL4Bit;
135#[cfg(feature = "CGLTypes")]
136pub use self::__CGLTypes::kCGL5Bit;
137#[cfg(feature = "CGLTypes")]
138pub use self::__CGLTypes::kCGL64Bit;
139#[cfg(feature = "CGLTypes")]
140pub use self::__CGLTypes::kCGL6Bit;
141#[cfg(feature = "CGLTypes")]
142pub use self::__CGLTypes::kCGL8Bit;
143#[cfg(feature = "CGLTypes")]
144pub use self::__CGLTypes::kCGL96Bit;
145#[cfg(feature = "CGLTypes")]
146pub use self::__CGLTypes::kCGLARGB12121212Bit;
147#[cfg(feature = "CGLTypes")]
148pub use self::__CGLTypes::kCGLARGB1555Bit;
149#[cfg(feature = "CGLTypes")]
150pub use self::__CGLTypes::kCGLARGB16161616Bit;
151#[cfg(feature = "CGLTypes")]
152pub use self::__CGLTypes::kCGLARGB2101010Bit;
153#[cfg(feature = "CGLTypes")]
154pub use self::__CGLTypes::kCGLARGB4444Bit;
155#[cfg(feature = "CGLTypes")]
156pub use self::__CGLTypes::kCGLARGB8888Bit;
157#[cfg(feature = "CGLTypes")]
158pub use self::__CGLTypes::kCGLDoubleBufferBit;
159#[cfg(feature = "CGLTypes")]
160pub use self::__CGLTypes::kCGLMonoscopicBit;
161#[cfg(feature = "CGLTypes")]
162pub use self::__CGLTypes::kCGLMultisampleBit;
163#[cfg(feature = "CGLTypes")]
164pub use self::__CGLTypes::kCGLRGB101010Bit;
165#[cfg(feature = "CGLTypes")]
166pub use self::__CGLTypes::kCGLRGB101010_A8Bit;
167#[cfg(feature = "CGLTypes")]
168pub use self::__CGLTypes::kCGLRGB121212Bit;
169#[cfg(feature = "CGLTypes")]
170pub use self::__CGLTypes::kCGLRGB161616Bit;
171#[cfg(feature = "CGLTypes")]
172pub use self::__CGLTypes::kCGLRGB444A8Bit;
173#[cfg(feature = "CGLTypes")]
174pub use self::__CGLTypes::kCGLRGB444Bit;
175#[cfg(feature = "CGLTypes")]
176pub use self::__CGLTypes::kCGLRGB555A8Bit;
177#[cfg(feature = "CGLTypes")]
178pub use self::__CGLTypes::kCGLRGB555Bit;
179#[cfg(feature = "CGLTypes")]
180pub use self::__CGLTypes::kCGLRGB565A8Bit;
181#[cfg(feature = "CGLTypes")]
182pub use self::__CGLTypes::kCGLRGB565Bit;
183#[cfg(feature = "CGLTypes")]
184pub use self::__CGLTypes::kCGLRGB888A8Bit;
185#[cfg(feature = "CGLTypes")]
186pub use self::__CGLTypes::kCGLRGB888Bit;
187#[cfg(feature = "CGLTypes")]
188pub use self::__CGLTypes::kCGLRGBA16161616Bit;
189#[cfg(feature = "CGLTypes")]
190pub use self::__CGLTypes::kCGLRGBAFloat128Bit;
191#[cfg(feature = "CGLTypes")]
192pub use self::__CGLTypes::kCGLRGBAFloat256Bit;
193#[cfg(feature = "CGLTypes")]
194pub use self::__CGLTypes::kCGLRGBAFloat64Bit;
195#[cfg(feature = "CGLTypes")]
196pub use self::__CGLTypes::kCGLRGBFloat128Bit;
197#[cfg(feature = "CGLTypes")]
198pub use self::__CGLTypes::kCGLRGBFloat256Bit;
199#[cfg(feature = "CGLTypes")]
200pub use self::__CGLTypes::kCGLRGBFloat64Bit;
201#[cfg(feature = "CGLTypes")]
202pub use self::__CGLTypes::kCGLSingleBufferBit;
203#[cfg(feature = "CGLTypes")]
204pub use self::__CGLTypes::kCGLStereoscopicBit;
205#[cfg(feature = "CGLTypes")]
206pub use self::__CGLTypes::kCGLSupersampleBit;
207#[cfg(feature = "CGLTypes")]
208pub use self::__CGLTypes::kCGLTripleBufferBit;
209#[cfg(feature = "CGLTypes")]
210pub use self::__CGLTypes::CGLCPContextPriorityRequest;
211#[cfg(feature = "CGLTypes")]
212pub use self::__CGLTypes::CGLContextEnable;
213#[cfg(feature = "CGLTypes")]
214pub use self::__CGLTypes::CGLContextObj;
215#[cfg(feature = "CGLTypes")]
216pub use self::__CGLTypes::CGLContextParameter;
217#[cfg(feature = "CGLTypes")]
218pub use self::__CGLTypes::CGLError;
219#[cfg(feature = "CGLTypes")]
220pub use self::__CGLTypes::CGLGPURestartStatus;
221#[cfg(feature = "CGLTypes")]
222pub use self::__CGLTypes::CGLGlobalOption;
223#[cfg(feature = "CGLTypes")]
224pub use self::__CGLTypes::CGLOpenGLProfile;
225#[cfg(feature = "CGLTypes")]
226pub use self::__CGLTypes::CGLPBufferObj;
227#[cfg(feature = "CGLTypes")]
228pub use self::__CGLTypes::CGLPixelFormatAttribute;
229#[cfg(feature = "CGLTypes")]
230pub use self::__CGLTypes::CGLPixelFormatObj;
231#[cfg(feature = "CGLTypes")]
232pub use self::__CGLTypes::CGLRendererInfoObj;
233#[cfg(feature = "CGLTypes")]
234pub use self::__CGLTypes::CGLRendererProperty;
235#[cfg(all(
236    feature = "CGLTypes",
237    feature = "IOSurface",
238    feature = "objc2-io-surface"
239))]
240pub use self::__IOSurface::CGLTexImageIOSurface2D;
241use core::ffi::*;
242use core::ptr::NonNull;
243
244use crate::*;
245
246/// [Apple's documentation](https://developer.apple.com/documentation/opengl/cgl_version_1_0?language=objc)
247pub const CGL_VERSION_1_0: c_uint = 1;
248/// [Apple's documentation](https://developer.apple.com/documentation/opengl/cgl_version_1_1?language=objc)
249pub const CGL_VERSION_1_1: c_uint = 1;
250/// [Apple's documentation](https://developer.apple.com/documentation/opengl/cgl_version_1_2?language=objc)
251pub const CGL_VERSION_1_2: c_uint = 1;
252/// [Apple's documentation](https://developer.apple.com/documentation/opengl/cgl_version_1_3?language=objc)
253pub const CGL_VERSION_1_3: c_uint = 1;
254extern "C-unwind" {
255    /// # Safety
256    ///
257    /// - `attribs` must be a valid pointer.
258    /// - `pix` must be a valid pointer.
259    /// - `npix` must be a valid pointer.
260    #[cfg(feature = "CGLTypes")]
261    pub fn CGLChoosePixelFormat(
262        attribs: NonNull<CGLPixelFormatAttribute>,
263        pix: NonNull<CGLPixelFormatObj>,
264        npix: NonNull<GLint>,
265    ) -> CGLError;
266}
267
268extern "C-unwind" {
269    /// # Safety
270    ///
271    /// `pix` must be a valid pointer.
272    #[cfg(feature = "CGLTypes")]
273    pub fn CGLDestroyPixelFormat(pix: CGLPixelFormatObj) -> CGLError;
274}
275
276extern "C-unwind" {
277    /// # Safety
278    ///
279    /// - `pix` must be a valid pointer.
280    /// - `value` must be a valid pointer.
281    #[cfg(feature = "CGLTypes")]
282    pub fn CGLDescribePixelFormat(
283        pix: CGLPixelFormatObj,
284        pix_num: GLint,
285        attrib: CGLPixelFormatAttribute,
286        value: NonNull<GLint>,
287    ) -> CGLError;
288}
289
290extern "C-unwind" {
291    /// # Safety
292    ///
293    /// `pix` must be a valid pointer.
294    #[cfg(feature = "CGLTypes")]
295    pub fn CGLReleasePixelFormat(pix: CGLPixelFormatObj);
296}
297
298extern "C-unwind" {
299    /// # Safety
300    ///
301    /// `pix` must be a valid pointer.
302    #[cfg(feature = "CGLTypes")]
303    pub fn CGLRetainPixelFormat(pix: CGLPixelFormatObj) -> CGLPixelFormatObj;
304}
305
306extern "C-unwind" {
307    /// # Safety
308    ///
309    /// `pix` must be a valid pointer.
310    #[cfg(feature = "CGLTypes")]
311    pub fn CGLGetPixelFormatRetainCount(pix: CGLPixelFormatObj) -> GLuint;
312}
313
314extern "C-unwind" {
315    /// # Safety
316    ///
317    /// - `rend` must be a valid pointer.
318    /// - `nrend` must be a valid pointer.
319    #[cfg(feature = "CGLTypes")]
320    pub fn CGLQueryRendererInfo(
321        display_mask: GLuint,
322        rend: NonNull<CGLRendererInfoObj>,
323        nrend: NonNull<GLint>,
324    ) -> CGLError;
325}
326
327extern "C-unwind" {
328    /// # Safety
329    ///
330    /// `rend` must be a valid pointer.
331    #[cfg(feature = "CGLTypes")]
332    pub fn CGLDestroyRendererInfo(rend: CGLRendererInfoObj) -> CGLError;
333}
334
335extern "C-unwind" {
336    /// # Safety
337    ///
338    /// - `rend` must be a valid pointer.
339    /// - `value` must be a valid pointer or null.
340    #[cfg(feature = "CGLTypes")]
341    pub fn CGLDescribeRenderer(
342        rend: CGLRendererInfoObj,
343        rend_num: GLint,
344        prop: CGLRendererProperty,
345        value: *mut GLint,
346    ) -> CGLError;
347}
348
349extern "C-unwind" {
350    /// # Safety
351    ///
352    /// - `pix` must be a valid pointer.
353    /// - `share` must be a valid pointer or null.
354    /// - `ctx` must be a valid pointer.
355    #[cfg(feature = "CGLTypes")]
356    pub fn CGLCreateContext(
357        pix: CGLPixelFormatObj,
358        share: CGLContextObj,
359        ctx: NonNull<CGLContextObj>,
360    ) -> CGLError;
361}
362
363extern "C-unwind" {
364    /// # Safety
365    ///
366    /// `ctx` must be a valid pointer.
367    #[cfg(feature = "CGLTypes")]
368    pub fn CGLDestroyContext(ctx: CGLContextObj) -> CGLError;
369}
370
371extern "C-unwind" {
372    /// # Safety
373    ///
374    /// - `src` must be a valid pointer.
375    /// - `dst` must be a valid pointer.
376    #[cfg(feature = "CGLTypes")]
377    pub fn CGLCopyContext(src: CGLContextObj, dst: CGLContextObj, mask: GLbitfield) -> CGLError;
378}
379
380extern "C-unwind" {
381    /// # Safety
382    ///
383    /// `ctx` must be a valid pointer.
384    #[cfg(feature = "CGLTypes")]
385    pub fn CGLRetainContext(ctx: CGLContextObj) -> CGLContextObj;
386}
387
388extern "C-unwind" {
389    /// # Safety
390    ///
391    /// `ctx` must be a valid pointer.
392    #[cfg(feature = "CGLTypes")]
393    pub fn CGLReleaseContext(ctx: CGLContextObj);
394}
395
396extern "C-unwind" {
397    /// # Safety
398    ///
399    /// `ctx` must be a valid pointer.
400    #[cfg(feature = "CGLTypes")]
401    pub fn CGLGetContextRetainCount(ctx: CGLContextObj) -> GLuint;
402}
403
404extern "C-unwind" {
405    /// # Safety
406    ///
407    /// `ctx` must be a valid pointer.
408    #[cfg(feature = "CGLTypes")]
409    pub fn CGLGetPixelFormat(ctx: CGLContextObj) -> CGLPixelFormatObj;
410}
411
412extern "C-unwind" {
413    /// # Safety
414    ///
415    /// `pbuffer` must be a valid pointer.
416    #[cfg(feature = "CGLTypes")]
417    pub fn CGLCreatePBuffer(
418        width: GLsizei,
419        height: GLsizei,
420        target: GLenum,
421        internal_format: GLenum,
422        max_level: GLint,
423        pbuffer: NonNull<CGLPBufferObj>,
424    ) -> CGLError;
425}
426
427extern "C-unwind" {
428    /// # Safety
429    ///
430    /// `pbuffer` must be a valid pointer.
431    #[cfg(feature = "CGLTypes")]
432    pub fn CGLDestroyPBuffer(pbuffer: CGLPBufferObj) -> CGLError;
433}
434
435extern "C-unwind" {
436    /// # Safety
437    ///
438    /// - `obj` must be a valid pointer.
439    /// - `width` must be a valid pointer.
440    /// - `height` must be a valid pointer.
441    /// - `target` must be a valid pointer.
442    /// - `internal_format` must be a valid pointer.
443    /// - `mipmap` must be a valid pointer.
444    #[cfg(feature = "CGLTypes")]
445    pub fn CGLDescribePBuffer(
446        obj: CGLPBufferObj,
447        width: NonNull<GLsizei>,
448        height: NonNull<GLsizei>,
449        target: NonNull<GLenum>,
450        internal_format: NonNull<GLenum>,
451        mipmap: NonNull<GLint>,
452    ) -> CGLError;
453}
454
455extern "C-unwind" {
456    /// # Safety
457    ///
458    /// - `ctx` must be a valid pointer.
459    /// - `pbuffer` must be a valid pointer.
460    #[cfg(feature = "CGLTypes")]
461    pub fn CGLTexImagePBuffer(
462        ctx: CGLContextObj,
463        pbuffer: CGLPBufferObj,
464        source: GLenum,
465    ) -> CGLError;
466}
467
468extern "C-unwind" {
469    /// # Safety
470    ///
471    /// `pbuffer` must be a valid pointer.
472    #[cfg(feature = "CGLTypes")]
473    pub fn CGLRetainPBuffer(pbuffer: CGLPBufferObj) -> CGLPBufferObj;
474}
475
476extern "C-unwind" {
477    /// # Safety
478    ///
479    /// `pbuffer` must be a valid pointer.
480    #[cfg(feature = "CGLTypes")]
481    pub fn CGLReleasePBuffer(pbuffer: CGLPBufferObj);
482}
483
484extern "C-unwind" {
485    /// # Safety
486    ///
487    /// `pbuffer` must be a valid pointer.
488    #[cfg(feature = "CGLTypes")]
489    pub fn CGLGetPBufferRetainCount(pbuffer: CGLPBufferObj) -> GLuint;
490}
491
492extern "C-unwind" {
493    /// # Safety
494    ///
495    /// - `ctx` must be a valid pointer.
496    /// - `baseaddr` must be a valid pointer.
497    #[cfg(feature = "CGLTypes")]
498    pub fn CGLSetOffScreen(
499        ctx: CGLContextObj,
500        width: GLsizei,
501        height: GLsizei,
502        rowbytes: GLint,
503        baseaddr: NonNull<c_void>,
504    ) -> CGLError;
505}
506
507extern "C-unwind" {
508    /// # Safety
509    ///
510    /// - `ctx` must be a valid pointer.
511    /// - `width` must be a valid pointer.
512    /// - `height` must be a valid pointer.
513    /// - `rowbytes` must be a valid pointer.
514    /// - `baseaddr` must be a valid pointer.
515    #[cfg(feature = "CGLTypes")]
516    pub fn CGLGetOffScreen(
517        ctx: CGLContextObj,
518        width: NonNull<GLsizei>,
519        height: NonNull<GLsizei>,
520        rowbytes: NonNull<GLint>,
521        baseaddr: NonNull<*mut c_void>,
522    ) -> CGLError;
523}
524
525extern "C-unwind" {
526    /// # Safety
527    ///
528    /// `ctx` must be a valid pointer.
529    #[cfg(feature = "CGLTypes")]
530    pub fn CGLSetFullScreen(ctx: CGLContextObj) -> CGLError;
531}
532
533extern "C-unwind" {
534    /// # Safety
535    ///
536    /// `ctx` must be a valid pointer.
537    #[cfg(feature = "CGLTypes")]
538    pub fn CGLSetFullScreenOnDisplay(ctx: CGLContextObj, display_mask: GLuint) -> CGLError;
539}
540
541extern "C-unwind" {
542    /// # Safety
543    ///
544    /// - `ctx` must be a valid pointer.
545    /// - `pbuffer` must be a valid pointer.
546    #[cfg(feature = "CGLTypes")]
547    pub fn CGLSetPBuffer(
548        ctx: CGLContextObj,
549        pbuffer: CGLPBufferObj,
550        face: GLenum,
551        level: GLint,
552        screen: GLint,
553    ) -> CGLError;
554}
555
556extern "C-unwind" {
557    /// # Safety
558    ///
559    /// - `ctx` must be a valid pointer.
560    /// - `pbuffer` must be a valid pointer.
561    /// - `face` must be a valid pointer.
562    /// - `level` must be a valid pointer.
563    /// - `screen` must be a valid pointer.
564    #[cfg(feature = "CGLTypes")]
565    pub fn CGLGetPBuffer(
566        ctx: CGLContextObj,
567        pbuffer: NonNull<CGLPBufferObj>,
568        face: NonNull<GLenum>,
569        level: NonNull<GLint>,
570        screen: NonNull<GLint>,
571    ) -> CGLError;
572}
573
574extern "C-unwind" {
575    /// # Safety
576    ///
577    /// `ctx` must be a valid pointer.
578    #[cfg(feature = "CGLTypes")]
579    pub fn CGLClearDrawable(ctx: CGLContextObj) -> CGLError;
580}
581
582extern "C-unwind" {
583    /// # Safety
584    ///
585    /// `ctx` must be a valid pointer.
586    #[cfg(feature = "CGLTypes")]
587    pub fn CGLFlushDrawable(ctx: CGLContextObj) -> CGLError;
588}
589
590extern "C-unwind" {
591    /// # Safety
592    ///
593    /// `ctx` must be a valid pointer.
594    #[cfg(feature = "CGLTypes")]
595    pub fn CGLEnable(ctx: CGLContextObj, pname: CGLContextEnable) -> CGLError;
596}
597
598extern "C-unwind" {
599    /// # Safety
600    ///
601    /// `ctx` must be a valid pointer.
602    #[cfg(feature = "CGLTypes")]
603    pub fn CGLDisable(ctx: CGLContextObj, pname: CGLContextEnable) -> CGLError;
604}
605
606extern "C-unwind" {
607    /// # Safety
608    ///
609    /// - `ctx` must be a valid pointer.
610    /// - `enable` must be a valid pointer.
611    #[cfg(feature = "CGLTypes")]
612    pub fn CGLIsEnabled(
613        ctx: CGLContextObj,
614        pname: CGLContextEnable,
615        enable: NonNull<GLint>,
616    ) -> CGLError;
617}
618
619extern "C-unwind" {
620    /// # Safety
621    ///
622    /// - `ctx` must be a valid pointer.
623    /// - `params` must be a valid pointer.
624    #[cfg(feature = "CGLTypes")]
625    pub fn CGLSetParameter(
626        ctx: CGLContextObj,
627        pname: CGLContextParameter,
628        params: NonNull<GLint>,
629    ) -> CGLError;
630}
631
632extern "C-unwind" {
633    /// # Safety
634    ///
635    /// - `ctx` must be a valid pointer.
636    /// - `params` must be a valid pointer.
637    #[cfg(feature = "CGLTypes")]
638    pub fn CGLGetParameter(
639        ctx: CGLContextObj,
640        pname: CGLContextParameter,
641        params: NonNull<GLint>,
642    ) -> CGLError;
643}
644
645extern "C-unwind" {
646    /// # Safety
647    ///
648    /// `ctx` must be a valid pointer.
649    #[cfg(feature = "CGLTypes")]
650    pub fn CGLSetVirtualScreen(ctx: CGLContextObj, screen: GLint) -> CGLError;
651}
652
653extern "C-unwind" {
654    /// # Safety
655    ///
656    /// - `ctx` must be a valid pointer.
657    /// - `screen` must be a valid pointer.
658    #[cfg(feature = "CGLTypes")]
659    pub fn CGLGetVirtualScreen(ctx: CGLContextObj, screen: NonNull<GLint>) -> CGLError;
660}
661
662extern "C-unwind" {
663    /// # Safety
664    ///
665    /// `ctx` must be a valid pointer.
666    #[cfg(feature = "CGLTypes")]
667    pub fn CGLUpdateContext(ctx: CGLContextObj) -> CGLError;
668}
669
670extern "C-unwind" {
671    /// # Safety
672    ///
673    /// `params` must be a valid pointer or null.
674    #[cfg(feature = "CGLTypes")]
675    pub fn CGLSetGlobalOption(pname: CGLGlobalOption, params: *const GLint) -> CGLError;
676}
677
678extern "C-unwind" {
679    /// # Safety
680    ///
681    /// `params` must be a valid pointer.
682    #[cfg(feature = "CGLTypes")]
683    pub fn CGLGetGlobalOption(pname: CGLGlobalOption, params: NonNull<GLint>) -> CGLError;
684}
685
686extern "C-unwind" {
687    #[cfg(feature = "CGLTypes")]
688    pub fn CGLSetOption(pname: CGLGlobalOption, param: GLint) -> CGLError;
689}
690
691extern "C-unwind" {
692    /// # Safety
693    ///
694    /// `param` must be a valid pointer.
695    #[cfg(feature = "CGLTypes")]
696    pub fn CGLGetOption(pname: CGLGlobalOption, param: NonNull<GLint>) -> CGLError;
697}
698
699extern "C-unwind" {
700    /// # Safety
701    ///
702    /// `ctx` must be a valid pointer.
703    #[cfg(feature = "CGLTypes")]
704    pub fn CGLLockContext(ctx: CGLContextObj) -> CGLError;
705}
706
707extern "C-unwind" {
708    /// # Safety
709    ///
710    /// `ctx` must be a valid pointer.
711    #[cfg(feature = "CGLTypes")]
712    pub fn CGLUnlockContext(ctx: CGLContextObj) -> CGLError;
713}
714
715extern "C-unwind" {
716    /// # Safety
717    ///
718    /// - `majorvers` must be a valid pointer or null.
719    /// - `minorvers` must be a valid pointer or null.
720    pub fn CGLGetVersion(majorvers: *mut GLint, minorvers: *mut GLint);
721}
722
723#[cfg(feature = "CGLTypes")]
724#[inline]
725pub unsafe extern "C-unwind" fn CGLErrorString(error: CGLError) -> NonNull<c_char> {
726    extern "C-unwind" {
727        fn CGLErrorString(error: CGLError) -> Option<NonNull<c_char>>;
728    }
729    let ret = unsafe { CGLErrorString(error) };
730    ret.expect("function was marked as returning non-null, but actually returned NULL")
731}