pub use crate::ffi::*;
use crate::{
ffi::window::{sfContextSettings, sfCursor, sfWindow, sfWindowHandle, Event as sfEvent},
graphics::{Color, Rect, RenderStates as sfRenderStates, Transform as sfTransform},
};
use super::{system::sfInputStream, window::sfVideoMode};
decl_opaque! {
sfCircleShape;
sfConvexShape;
sfImage;
sfShader;
sfRectangleShape;
sfRenderTexture;
sfRenderWindow;
sfShape;
sfSprite;
sfText;
sfTransformable;
sfVertexBuffer;
}
pub type sfTexture = crate::graphics::Texture;
pub type sfView = crate::graphics::View;
pub type sfFont = crate::graphics::Font;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BlendFactor {
Zero,
One,
SrcColor,
OneMinusSrcColor,
DstColor,
OneMinusDstColor,
SrcAlpha,
OneMinusSrcAlpha,
DstAlpha,
OneMinusDstAlpha,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BlendEquation {
Add,
Subtract,
ReverseSubtract,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct BlendMode {
pub color_src_factor: BlendFactor,
pub color_dst_factor: BlendFactor,
pub color_equation: BlendEquation,
pub alpha_src_factor: BlendFactor,
pub alpha_dst_factor: BlendFactor,
pub alpha_equation: BlendEquation,
}
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ShaderType {
Vertex,
Geometry,
Fragment,
}
type sfShaderType = ShaderType;
#[repr(C)]
pub struct sfFontInfo {
pub family: *const c_char,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct sfGlyph {
pub advance: f32,
pub bounds: sfFloatRect,
pub texture_rect: sfIntRect,
}
pub type sfFloatRect = Rect<f32>;
pub type sfIntRect = Rect<c_int>;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum sfVertexBufferUsage {
Stream,
Dynamic,
Static,
}
#[repr(C)]
pub struct sfVertex {
pub position: sfVector2f,
pub color: Color,
pub tex_coords: sfVector2f,
}
pub type sfGlslVec2 = sfVector2f;
pub type sfGlslIvec2 = sfVector2i;
#[repr(C)]
pub struct sfGlslBvec2 {
pub x: bool,
pub y: bool,
}
pub type sfGlslVec3 = crate::system::Vector3<f32>;
#[repr(C)]
pub struct sfGlslIvec3 {
pub x: c_int,
pub y: c_int,
pub z: c_int,
}
#[repr(C)]
pub struct sfGlslBvec3 {
pub x: bool,
pub y: bool,
pub z: bool,
}
#[repr(C)]
pub struct sfGlslVec4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
#[repr(C)]
pub struct sfGlslIvec4 {
pub x: c_int,
pub y: c_int,
pub z: c_int,
pub w: c_int,
}
#[repr(C)]
pub struct sfGlslBvec4 {
pub x: bool,
pub y: bool,
pub z: bool,
pub w: bool,
}
#[repr(C)]
pub struct sfGlslMat3 {
pub array: [f32; 3 * 3],
}
#[repr(C)]
pub struct sfGlslMat4 {
pub array: [f32; 4 * 4],
}
type sfShapeGetPointCountCallback = Option<unsafe extern "C" fn(user_data: *mut c_void) -> usize>;
type sfShapeGetPointCallback =
Option<unsafe extern "C" fn(idx: usize, user_data: *mut c_void) -> sfVector2f>;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum sfPrimitiveType {
Points,
Lines,
LineStrip,
Triangles,
TriangleStrip,
TriangleFan,
Quads,
}
type sfColor = Color;
include!("graphics_bindgen.rs");