use core::ptr::NonNull;
use objc2_core_foundation::*;
#[cfg(feature = "objc2-open-gl")]
#[cfg(target_os = "macos")]
use objc2_open_gl::*;
use crate::*;
extern "C" {
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
pub static kCVOpenGLBufferWidth: &'static CFString;
}
extern "C" {
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
pub static kCVOpenGLBufferHeight: &'static CFString;
}
extern "C" {
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
pub static kCVOpenGLBufferTarget: &'static CFString;
}
extern "C" {
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
pub static kCVOpenGLBufferInternalFormat: &'static CFString;
}
extern "C" {
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
pub static kCVOpenGLBufferMaximumMipmapLevel: &'static CFString;
}
#[doc(alias = "CVOpenGLBufferRef")]
#[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer"))]
pub type CVOpenGLBuffer = CVImageBuffer;
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
#[inline]
pub extern "C-unwind" fn CVOpenGLBufferGetTypeID() -> CFTypeID {
extern "C-unwind" {
fn CVOpenGLBufferGetTypeID() -> CFTypeID;
}
unsafe { CVOpenGLBufferGetTypeID() }
}
extern "C-unwind" {
#[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer", feature = "CVReturn"))]
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
pub fn CVOpenGLBufferCreate(
allocator: Option<&CFAllocator>,
width: usize,
height: usize,
attributes: Option<&CFDictionary>,
buffer_out: NonNull<*mut CVOpenGLBuffer>,
) -> CVReturn;
}
#[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer"))]
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
#[inline]
pub extern "C-unwind" fn CVOpenGLBufferGetAttributes(
open_gl_buffer: &CVOpenGLBuffer,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn CVOpenGLBufferGetAttributes(
open_gl_buffer: &CVOpenGLBuffer,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { CVOpenGLBufferGetAttributes(open_gl_buffer) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
extern "C-unwind" {
#[cfg(all(
feature = "CVBuffer",
feature = "CVImageBuffer",
feature = "CVReturn",
feature = "objc2-open-gl"
))]
#[cfg(target_os = "macos")]
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
pub fn CVOpenGLBufferAttach(
open_gl_buffer: &CVOpenGLBuffer,
cgl_context: CGLContextObj,
face: GLenum,
level: GLint,
screen: GLint,
) -> CVReturn;
}