Struct allegro::core::Core[][src]

pub struct Core { /* fields omitted */ }

Type through which you’ll be doing most your interaction with Allegro.

Implementations

impl Core[src]

pub fn init() -> Result<Core, String>[src]

This must be called on the main thread.

pub fn init_with_config(system_config: &Config) -> Result<Core, String>[src]

Initializes Allegro while merging in the system_config into the system configuration.

pub fn get_system_config(&self) -> &Config[src]

Returns the system config.

pub fn get_system_config_mut(&mut self) -> &mut Config[src]

Returns the system config.

pub fn get_num_video_adapters(&self) -> i32[src]

pub fn get_monitor_info(&self, adapter: i32) -> Result<MonitorInfo, ()>[src]

pub fn rest(&self, seconds: f64)[src]

pub fn get_time(&self) -> f64[src]

pub fn install_keyboard(&self) -> Result<(), ()>[src]

pub fn is_keyboard_installed(&self) -> bool[src]

pub fn get_keyboard_event_source(&self) -> Option<EventSource<'_>>[src]

pub fn set_keyboard_leds(&self, leds: KeyModifier) -> Result<(), ()>[src]

pub fn keycode_to_name(&self, k: KeyCode) -> String[src]

pub fn install_mouse(&self) -> Result<(), ()>[src]

pub fn is_mouse_installed(&self) -> bool[src]

pub fn get_mouse_event_source(&self) -> Option<EventSource<'_>>[src]

pub fn install_joystick(&self) -> Result<(), ()>[src]

pub fn is_joystick_installed(&self) -> bool[src]

pub fn get_joystick_event_source(&self) -> Option<EventSource<'_>>[src]

pub fn reconfigure_joysticks(&self) -> Result<(), ()>[src]

pub fn get_num_joysticks(&self) -> i32[src]

pub fn get_mouse_num_buttons(&self) -> u32[src]

pub fn get_mouse_num_axes(&self) -> u32[src]

pub fn set_mouse_xy(&self, display: &Display, x: i32, y: i32) -> Result<(), ()>[src]

pub fn set_mouse_z(&self, z: i32) -> Result<(), ()>[src]

pub fn set_mouse_w(&self, w: i32) -> Result<(), ()>[src]

pub fn set_mouse_axis(&self, axis: i32, value: i32) -> Result<(), ()>[src]

pub fn grab_mouse(&self, display: &Display) -> Result<(), ()>[src]

pub fn ungrab_mouse(&self) -> Result<(), ()>[src]

pub fn set_new_bitmap_flags(&self, flags: BitmapFlags)[src]

pub fn get_new_bitmap_flags(&self) -> BitmapFlags[src]

pub fn set_new_bitmap_format(&self, format: PixelFormat)[src]

pub fn get_new_bitmap_format(&self) -> PixelFormat[src]

pub fn set_target_bitmap<T: BitmapLike>(&self, bmp: Option<&T>)[src]

pub fn clear_to_color(&self, color: Color)[src]

pub fn clear_depth_buffer(&self, z: f32)[src]

pub fn draw_pixel(&self, x: f32, y: f32, color: Color)[src]

pub fn put_pixel(&self, x: i32, y: i32, color: Color)[src]

pub fn put_blended_pixel(&self, x: i32, y: i32, color: Color)[src]

pub fn draw_bitmap<T: BitmapLike>(
    &self,
    bitmap: &T,
    dx: f32,
    dy: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_bitmap_region<T: BitmapLike>(
    &self,
    bitmap: &T,
    sx: f32,
    sy: f32,
    sw: f32,
    sh: f32,
    dx: f32,
    dy: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_scaled_bitmap<T: BitmapLike>(
    &self,
    bitmap: &T,
    sx: f32,
    sy: f32,
    sw: f32,
    sh: f32,
    dx: f32,
    dy: f32,
    dw: f32,
    dh: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_rotated_bitmap<T: BitmapLike>(
    &self,
    bitmap: &T,
    cx: f32,
    cy: f32,
    dx: f32,
    dy: f32,
    angle: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_scaled_rotated_bitmap<T: BitmapLike>(
    &self,
    bitmap: &T,
    cx: f32,
    cy: f32,
    dx: f32,
    dy: f32,
    xscale: f32,
    yscale: f32,
    angle: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_tinted_bitmap<T: BitmapLike>(
    &self,
    bitmap: &T,
    tint: Color,
    dx: f32,
    dy: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_tinted_bitmap_region<T: BitmapLike>(
    &self,
    bitmap: &T,
    tint: Color,
    sx: f32,
    sy: f32,
    sw: f32,
    sh: f32,
    dx: f32,
    dy: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_tinted_scaled_bitmap<T: BitmapLike>(
    &self,
    bitmap: &T,
    tint: Color,
    sx: f32,
    sy: f32,
    sw: f32,
    sh: f32,
    dx: f32,
    dy: f32,
    dw: f32,
    dh: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_tinted_rotated_bitmap<T: BitmapLike>(
    &self,
    bitmap: &T,
    tint: Color,
    cx: f32,
    cy: f32,
    dx: f32,
    dy: f32,
    angle: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_tinted_scaled_rotated_bitmap<T: BitmapLike>(
    &self,
    bitmap: &T,
    tint: Color,
    cx: f32,
    cy: f32,
    dx: f32,
    dy: f32,
    xscale: f32,
    yscale: f32,
    angle: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn draw_tinted_scaled_rotated_bitmap_region<T: BitmapLike>(
    &self,
    bitmap: &T,
    sx: f32,
    sy: f32,
    sw: f32,
    sh: f32,
    tint: Color,
    cx: f32,
    cy: f32,
    dx: f32,
    dy: f32,
    xscale: f32,
    yscale: f32,
    angle: f32,
    flags: BitmapDrawingFlags
)
[src]

pub fn set_clipping_rectangle(&self, x: i32, y: i32, width: i32, height: i32)[src]

pub fn reset_clipping_rectangle(&self)[src]

pub fn get_clipping_rectangle(&self) -> (i32, i32, i32, i32)[src]

pub fn set_new_display_flags(&self, flags: DisplayFlags)[src]

pub fn get_new_display_flags(&self) -> DisplayFlags[src]

pub fn set_new_display_refresh_rate(&self, rate: i32)[src]

pub fn get_new_display_refresh_rate(&self) -> i32[src]

pub fn set_new_display_adapter(&self, adapter: i32)[src]

pub fn get_new_display_adapter(&self) -> i32[src]

pub fn set_new_window_position(&self, x: i32, y: i32)[src]

pub fn get_new_window_position(&self) -> (i32, i32)[src]

pub fn reset_new_display_options(&self)[src]

pub fn set_new_display_option(
    &self,
    option: DisplayOption,
    value: i32,
    importance: DisplayOptionImportance
)
[src]

pub fn get_new_display_option(
    &self,
    option: DisplayOption
) -> (i32, DisplayOptionImportance)
[src]

pub fn get_current_transform(&self) -> Transform[src]

pub fn use_transform(&self, trans: &Transform)[src]

pub fn use_projection_transform(&self, trans: &Transform)[src]

pub fn use_shader(&self, shader: Option<&Shader>) -> Result<(), ()>[src]

Set the shader as current for the current bitmap. Pass None to stop using this shader. Returns an error if the shader isn’t compatible with the bitmap.

pub fn get_default_shader_source(
    &self,
    platform: ShaderPlatform,
    shader_type: ShaderType
) -> Option<String>
[src]

Returns the source of the shader that Allegro uses by default.

pub fn flip_display(&self)[src]

pub fn update_display_region(&self, x: i32, y: i32, width: i32, height: i32)[src]

pub fn wait_for_vsync(&self) -> Result<(), ()>[src]

pub fn hold_bitmap_drawing(&self, hold: bool)[src]

pub fn is_bitmap_drawing_held(&self) -> bool[src]

pub fn set_shader_sampler<T: BitmapLike>(
    &mut self,
    name: &str,
    bmp: &T,
    unit: i32
) -> Result<(), ()>
[src]

Set a sampler for a particular uniform and unit for the current shader. Different uniforms should be set to different units. Pass None to bmp to clear the sampler.

pub fn set_shader_uniform<T: ShaderUniform + ?Sized>(
    &self,
    name: &str,
    val: &T
) -> Result<(), ()>
[src]

Sets a shader uniform to a value.

pub fn set_shader_transform(
    &self,
    name: &str,
    val: &Transform
) -> Result<(), ()>
[src]

Sets a shader uniform to a value.

pub fn set_blender(
    &self,
    op: BlendOperation,
    source: BlendMode,
    dest: BlendMode
)
[src]

Set blender options.

pub fn set_separate_blender(
    &self,
    op: BlendOperation,
    source: BlendMode,
    dest: BlendMode,
    alpha_op: BlendOperation,
    alpha_source: BlendMode,
    alpha_dest: BlendMode
)
[src]

Set blender options, with alpha channel getting a separate setting.

pub fn set_depth_test(&self, function: Option<DepthFunction>)[src]

Auto Trait Implementations

impl RefUnwindSafe for Core

impl Send for Core

impl Sync for Core

impl Unpin for Core

impl UnwindSafe for Core

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.