mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Annotate all SDL structs
This commit is contained in:
@@ -43,6 +43,7 @@ pub mod ll {
|
||||
::std::option::Option<extern "C" fn
|
||||
(arg1: *const c_void, arg2: *const uint8_t,
|
||||
arg3: c_int)>;
|
||||
#[repr(C)]
|
||||
pub struct SDL_AudioSpec {
|
||||
pub freq: c_int,
|
||||
pub format: SDL_AudioFormat,
|
||||
@@ -59,6 +60,7 @@ pub mod ll {
|
||||
(arg1: *const SDL_AudioCVT,
|
||||
arg2: SDL_AudioFormat)>;
|
||||
#[allow(dead_code)]
|
||||
#[repr(C)]
|
||||
pub struct SDL_AudioCVT {
|
||||
pub needed: c_int,
|
||||
pub src_format: SDL_AudioFormat,
|
||||
|
||||
@@ -17,12 +17,14 @@ pub mod ll {
|
||||
pub static SDL_CONTROLLER_BINDTYPE_HAT: SDL_GameControllerBindType = 3;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(C)]
|
||||
pub struct SDL_GameControllerButtonBind {
|
||||
bindType: SDL_GameControllerBindType,
|
||||
value: SDL_GameControllerButtonBindData,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(C)]
|
||||
pub struct SDL_GameControllerButtonBindData {
|
||||
data: [c_uchar, ..8u],
|
||||
}
|
||||
|
||||
@@ -309,6 +309,7 @@ pub mod ll {
|
||||
pub msg: *const SDL_SysWMmsg,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDL_Event {
|
||||
pub data: [uint8_t, ..56u],
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ pub mod ll {
|
||||
pub type SDL_Joystick = c_void;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(C)]
|
||||
pub struct SDL_JoystickGUID {
|
||||
data: [uint8_t, ..16u],
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ pub mod ll {
|
||||
use libc::{c_int, uint8_t, uint32_t};
|
||||
|
||||
//SDL_pixels.h
|
||||
#[repr(C)]
|
||||
pub struct SDL_Color {
|
||||
pub r: uint8_t,
|
||||
pub g: uint8_t,
|
||||
@@ -12,6 +13,7 @@ pub mod ll {
|
||||
pub a: uint8_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDL_Palette {
|
||||
pub ncolors: c_int,
|
||||
pub colors: *const SDL_Color,
|
||||
@@ -20,6 +22,7 @@ pub mod ll {
|
||||
}
|
||||
|
||||
#[allow(uppercase_variables)]
|
||||
#[repr(C)]
|
||||
pub struct SDL_PixelFormat {
|
||||
pub format: SDL_PixelFormatFlag,
|
||||
pub palette: *const SDL_Palette,
|
||||
|
||||
@@ -7,6 +7,7 @@ use libc::c_int;
|
||||
|
||||
/// A structure that defines a two dimensional point.
|
||||
#[deriving(PartialEq, Clone, Show)]
|
||||
#[repr(C)]
|
||||
pub struct Point {
|
||||
pub x: i32,
|
||||
pub y: i32
|
||||
@@ -14,6 +15,7 @@ pub struct Point {
|
||||
|
||||
/// A structure that defines a rectangle, with the origin at the upper left.
|
||||
#[deriving(PartialEq, Clone, Show)]
|
||||
#[repr(C)]
|
||||
pub struct Rect {
|
||||
pub x: i32,
|
||||
pub y: i32,
|
||||
|
||||
@@ -39,6 +39,7 @@ pub mod ll {
|
||||
SDL_RENDERER_TARGETTEXTURE = 0x00000008
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDL_RendererInfo
|
||||
{
|
||||
pub name: *const c_char,
|
||||
@@ -69,7 +70,9 @@ pub mod ll {
|
||||
SDL_FLIP_VERTICAL = 0x00000002
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDL_Renderer;
|
||||
#[repr(C)]
|
||||
pub struct SDL_Texture;
|
||||
|
||||
//SDL_blendmode.h
|
||||
|
||||
@@ -10,6 +10,7 @@ pub mod ll {
|
||||
use libc::{c_int, int64_t, size_t};
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(C)]
|
||||
struct SDL_RWops_Anon {
|
||||
data: [c_uchar, ..24],
|
||||
}
|
||||
@@ -21,6 +22,7 @@ pub mod ll {
|
||||
pub static RW_SEEK_END: c_int = 2;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(C)]
|
||||
pub struct SDL_RWops {
|
||||
pub size: extern "C" fn(context: *const SDL_RWops) -> int64_t,
|
||||
pub seek: extern "C" fn(context: *const SDL_RWops, offset: int64_t, whence: c_int) -> int64_t,
|
||||
|
||||
@@ -28,8 +28,10 @@ pub mod ll {
|
||||
pub static SDL_DONTFREE: SDL_SurfaceFlag = 0x00000004;
|
||||
|
||||
//SDL_surface.h
|
||||
#[repr(C)]
|
||||
pub struct SDL_BlitMap;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDL_Surface {
|
||||
pub flags: uint32_t,
|
||||
pub format: *const SDL_PixelFormat,
|
||||
|
||||
@@ -3,6 +3,7 @@ use std::ptr;
|
||||
pub type TouchDevice = ll::SDL_TouchID;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[repr(C)]
|
||||
pub struct Finger {
|
||||
id: TouchDevice,
|
||||
x: f32,
|
||||
|
||||
@@ -9,6 +9,7 @@ use std::c_str::CString;
|
||||
#[allow(non_camel_case_types)]
|
||||
pub mod ll {
|
||||
use libc::{uint8_t, c_char, c_int};
|
||||
#[repr(C)]
|
||||
pub struct SDL_version {
|
||||
pub major: uint8_t,
|
||||
pub minor: uint8_t,
|
||||
|
||||
@@ -23,8 +23,10 @@ pub mod ll {
|
||||
pub type SDL_bool = c_int;
|
||||
|
||||
//SDL_video.h
|
||||
#[repr(C)]
|
||||
pub struct SDL_Window;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDL_DisplayMode {
|
||||
pub format: uint32_t,
|
||||
pub w: c_int,
|
||||
|
||||
Reference in New Issue
Block a user