class SDL::Renderer

Defined in:

renderer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(window : Window, flags : Flags = Flags::ACCELERATED) #

[View source]

Instance Method Detail

def clear #

Fills the target texture using the current #draw_color.


[View source]
def clip_rect #

[View source]
def clip_rect=(rect) #

[View source]
def copy(surface : Surface, srcrect = nil, dstrect = nil, angle = 0, center = nil, flip : Flip = Flip::NONE) #

Transforms a surface into a texture, then copies it to the renderer's target texture, with extra rotation and flipping options.


[View source]
def copy(texture, srcrect = nil, dstrect = nil, angle = 0, center = nil, flip : Flip = Flip::NONE) #

Copy a texture to the renderer's target texture, with extra rotation and flipping options.


[View source]
def draw_blend_mode #

Get the current drawing blend mode.


[View source]
def draw_blend_mode=(blend_mode : BlendMode) #

Set the blen mode for drawing operations (fill, lines).


[View source]
def draw_color #

Get the current drawing color.


[View source]
def draw_color=(color) #

Set the color for drawing operations (lines, rectangles and clear).


[View source]
def draw_line(x1, y1, x2, y2) #

Draw a single line between two Point.


[View source]
def draw_line(a, b) #

Draw a single line between two Point.


[View source]
def draw_lines(points) #

Draw a line between following a series of Point.


[View source]
def draw_point(x, y) #

[View source]
def draw_point(point) #

Draw a single Point.


[View source]
def draw_points(points) #

Draw many Point at once.


[View source]
def draw_rect(x, y, w, h) #

Draw a single Rect.


[View source]
def draw_rect(rect) #

Draw a single Rect.


[View source]
def draw_rects(rects) #

Draw many Rect at once.


[View source]
def fill_rect(x, y, w, h) #

Fill a Rect with the current #draw_color and #draw_blend_mode.


[View source]
def fill_rect(rect) #

Fill a Rect with the current #draw_color and #draw_blend_mode.


[View source]
def fill_rects(rects) #

Fill many Rect at once with the current #draw_color and #draw_blend_mode.


[View source]
def finalize #

[View source]
def info #

[View source]
def logical_size #

[View source]
def logical_size=(xy) #

[View source]
def output_size #

[View source]
def present #

Render the target texture to the screen.


[View source]
def read_pixels(rect : Rect, format : PixelFormat, buffer : Bytes) #

[View source]
def scale #

[View source]
def scale=(xy) #

[View source]
def target #

[View source]
def target=(texture = nil) #

[View source]
def target_supported? #

[View source]
def to_unsafe : Pointer(LibSDL::Renderer) #

[View source]
def viewport #

[View source]
def viewport=(rect) #

[View source]