class Shale::Display
- Shale::Display
- Reference
- Object
Defined in:
shale/display.crConstructors
-
.new(width : UInt32, height : UInt32, title : String)
Create a display
Instance Method Summary
- #clear(*args, **options)
- #clear(*args, **options, &)
- #close(*args, **options)
- #close(*args, **options, &)
-
#draw(&block : Shale::Surface -> Nil)
Draw to the Display's buffer
-
#finalize : Int32
Cleanup garbage collection method
- #flush(*args, **options)
- #flush(*args, **options, &)
- #frame_buffer : Shale::Surface
- #next_event(*args, **options)
- #next_event(*args, **options, &)
- #pending(*args, **options)
- #pending(*args, **options, &)
-
#resize(width : UInt32, height : UInt32)
Resize the drawing area
-
#swap_buffer
Swap buffer
- #sync(*args, **options)
- #sync(*args, **options, &)
-
#toggle_fullscreen
Toggle the display for fullscreen or back to windowed mode
- #wm_delete_window : X11::C::Atom
Constructor Detail
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
Instance Method Detail
Cleanup garbage collection method
Description
When garbage collection (GC) is initiated, it will call the Display's
#close
method and cleanup X11 resources
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)