Graphics

graphics.initiate

graphics.initiate(window_reference: integer, v_sync: boolean) -> nil

graphics.cleanup

graphics.cleanup() -> nil

graphics.set_projection_matrix

graphics.set_projection_matrix(projection_matrix: table) -> nil
Example usage
SetProjectionMatrix.lua
local screen_size = win32.get_screen_size( )

local fov = math.rad(60)
local aspect = screen_size.x / screen_size.y
local near, far = 0.1, 100.0
local f = 1.0 / math.tan(fov / 2)

graphics.set_projection_matrix({
    f / aspect, 0,  0,                              0,
    0,          f,  0,                              0,
    0,          0,  far / (far - near),             1,
    0,          0,  (-near * far) / (far - near),   0
})

graphics.set_viewport

graphics.set_viewport(position: vector2, size: vector2, min_depth: number, max_depth: number) -> nil

graphics.create_texture

graphics.create_texture(texture_name: string, texture_description: table, sub_resource_data: table, shader_resource_view_desc: table) -> nil

graphics.destroy_texture

graphics.destroy_texture(texture: texture) -> nil

graphics.create_font

graphics.create_font(font_path: string, size: number, padding: number: antialiasing: boolean) -> font

This returns a font object.

graphics.destroy_font

graphics.destroy_font(font: font) -> nil

Last updated