class Shale::RenderCtx

Defined in:

shale/render_ctx.cr

Constructors

Instance Method Summary

Constructor Detail

def self.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

[View source]

Instance Method Detail

def 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


[View source]
def draw_triangle(*vertices : Shale::Vertex, texture : Shale::Surface) #

[View source]
def scan_edges(a : Shale::Edge, b : Shale::Edge, swap : Bool, gradient : Gradient, texture : Shale::Surface) #

[View source]
def scan_triangle(min : Shale::Vertex, mid : Shale::Vertex, max : Shale::Vertex, texture : Shale::Surface) #

[View source]