class Eagle::GPU::VertexLayout

Overview

Describes the attributes in an interleaved vertex buffer, for custom geometry.

layout = GPU::VertexLayout.new.float("a_position", 3).float("a_uv", 2).color("a_color")

Defined in:

eagle/gpu/device.cr

Instance Method Summary

Instance Method Detail

def attribs : Array(Eagle::GPU::VertexAttrib) #

The attributes in order.


def color(name : String) : self #

Adds a packed RGBA color attribute, normalized to 0..1 in the shader. Returns self.


def float(name : String, components : Int32) : self #

Adds a float attribute with components values. Returns self.


def float_count : Int32 #

Floats per vertex.


def stride : Int32 #

Bytes per vertex.