use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
pub static kEAGLDrawablePropertyRetainedBacking: &'static NSString;
}
extern "C" {
pub static kEAGLDrawablePropertyColorFormat: &'static NSString;
}
extern "C" {
pub static kEAGLColorFormatRGBA8: &'static NSString;
}
extern "C" {
pub static kEAGLColorFormatRGB565: &'static NSString;
}
extern "C" {
pub static kEAGLColorFormatSRGBA8: &'static NSString;
}
extern_protocol!(
pub unsafe trait EAGLDrawable {
#[unsafe(method(drawableProperties))]
#[unsafe(method_family = none)]
unsafe fn drawableProperties(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
#[unsafe(method(setDrawableProperties:))]
#[unsafe(method_family = none)]
unsafe fn setDrawableProperties(
&self,
drawable_properties: Option<&NSDictionary<NSString, AnyObject>>,
);
}
);
#[cfg(feature = "EAGL")]
impl EAGLContext {
extern_methods!(
#[unsafe(method(renderbufferStorage:fromDrawable:))]
#[unsafe(method_family = none)]
pub unsafe fn renderbufferStorage_fromDrawable(
&self,
target: NSUInteger,
drawable: Option<&ProtocolObject<dyn EAGLDrawable>>,
) -> bool;
#[unsafe(method(presentRenderbuffer:))]
#[unsafe(method_family = none)]
pub unsafe fn presentRenderbuffer(&self, target: NSUInteger) -> bool;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(presentRenderbuffer:atTime:))]
#[unsafe(method_family = none)]
pub unsafe fn presentRenderbuffer_atTime(
&self,
target: NSUInteger,
presentation_time: CFTimeInterval,
) -> bool;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(presentRenderbuffer:afterMinimumDuration:))]
#[unsafe(method_family = none)]
pub unsafe fn presentRenderbuffer_afterMinimumDuration(
&self,
target: NSUInteger,
duration: CFTimeInterval,
) -> bool;
);
}