class

Shale::RenderCtx

Inherits Reference < Object

Constructors

new(width : Int32, height : Int32, target : Shale::Surface)

Render Context

Description

For now to save time and getting things working, just following the implementation from the video series, in the future (depending on where this class' goes), would be good to change:

  • Not relying on the 'window' dimensions for the size of @data
  • Conform on which type of Int?
  • remove width and height and just use @target's width and height instead
Source

Instance methods

draw_scan_line(left : Shale::Edge, right : Shale::Edge, y : UInt32, gradient : Gradient, texture : Shale::Surface)

FIXME, for the texture mapping, gradient is not needed, but still including for the colour part, for now

Source
draw_triangle(*vertices : Shale::Vertex, texture : Shale::Surface)
Source
scan_edges(a : Shale::Edge, b : Shale::Edge, swap : Bool, gradient : Gradient, texture : Shale::Surface)
Source
scan_triangle(min : Shale::Vertex, mid : Shale::Vertex, max : Shale::Vertex, texture : Shale::Surface)
Source