class Shale::Display

Defined in:

shale/display.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(width : UInt32, height : UInt32, title : String) #

Create a display

Arguments

  • @width Width of the X11 window
  • @height Height of the X11 window
  • title The title added to the X11 window

Description

FIXME for the x11 pixmap, it seems to be a mismatch by 1 pixel when displaying in the window example: if the window width (499) is less than the framebuffer width (500) (on the righthand side) some reason, the last column of pixels in the framebuffer are show on the lefthand side by 1 pixel UPDATE: temp fix added to the Surface.map_pixel function, but should investigate more if the right fix is to offset the incoming coords before mapping to the framebuffer


[View source]

Instance Method Detail

def clear(*args, **options) #

[View source]
def clear(*args, **options, &) #

[View source]
def close(*args, **options) #

[View source]
def close(*args, **options, &) #

[View source]
def draw(&block : Shale::Surface -> Nil) #

Draw to the Display's buffer

Description


[View source]
def finalize : Int32 #

Cleanup garbage collection method

Description

When garbage collection (GC) is initiated, it will call the Display's #close method and cleanup X11 resources


[View source]
def flush(*args, **options) #

[View source]
def flush(*args, **options, &) #

[View source]
def frame_buffer : Shale::Surface #

[View source]
def next_event(*args, **options) #

[View source]
def next_event(*args, **options, &) #

[View source]
def pending(*args, **options) #

[View source]
def pending(*args, **options, &) #

[View source]
def resize(width : UInt32, height : UInt32) #

Resize the drawing area

Description


[View source]
def swap_buffer #

Swap buffer

Description

Writes the X11 image, mapped with the Surface data, to the window for display.

Note: the CPU usage of Xorg process also goes up, not sure what i would need to do to prevent that (if at all possible)


[View source]
def sync(*args, **options) #

[View source]
def sync(*args, **options, &) #

[View source]
def toggle_fullscreen #

Toggle the display for fullscreen or back to windowed mode

Description

TODO


[View source]
def wm_delete_window : X11::C::Atom #

[View source]