sokol.sgl #

Constants #

const (
	version = gfx.version + 1
)

fn begin_line_strip #

fn begin_line_strip()

fn begin_lines #

fn begin_lines()

fn begin_points #

fn begin_points()

define primitives, each begin/end is one draw command

fn begin_quads #

fn begin_quads()

fn begin_triangle_strip #

fn begin_triangle_strip()

fn begin_triangles #

fn begin_triangles()

fn c1i #

fn c1i(rgba u32)

fn c3b #

fn c3b(r byte, g byte, b byte)

fn c3f #

fn c3f(r f32, g f32, b f32)

fn c4b #

fn c4b(r byte, g byte, b byte, a byte)

fn c4f #

fn c4f(r f32, g f32, b f32, a f32)

fn default_pipeline #

fn default_pipeline()

fn defaults #

fn defaults()

fn deg #

fn deg(rad f32) f32

fn destroy_pipeline #

fn destroy_pipeline(pip C.sgl_pipeline)

fn disable_texture #

fn disable_texture()

fn draw #

fn draw()

render everything

fn enable_texture #

fn enable_texture()

fn end #

fn end()

fn error #

fn error() C.sgl_error_t

fn frustum #

fn frustum(l f32, r f32, b f32, t f32, n f32, f f32)

fn load_default_pipeline #

fn load_default_pipeline()

pipeline stack functions

fn load_identity #

fn load_identity()

fn load_matrix #

fn load_matrix(m []f32)

fn load_pipeline #

fn load_pipeline(pip C.sgl_pipeline)

fn load_transpose_matrix #

fn load_transpose_matrix(m []f32)

fn lookat #

fn lookat(eye_x f32, eye_y f32, eye_z f32, center_x f32, center_y f32, center_z f32, up_x f32, up_y f32, up_z f32)

fn make_pipeline #

fn make_pipeline(desc &C.sg_pipeline_desc) C.sgl_pipeline

create and destroy pipeline objects

fn matrix_mode_modelview #

fn matrix_mode_modelview()

matrix stack functions

fn matrix_mode_projection #

fn matrix_mode_projection()

fn matrix_mode_texture #

fn matrix_mode_texture()

fn mult_matrix #

fn mult_matrix(m []f32)

fn mult_transpose_matrix #

fn mult_transpose_matrix(m []f32)

fn ortho #

fn ortho(l f32, r f32, b f32, t f32, n f32, f f32)

fn perspective #

fn perspective(fov_y f32, aspect f32, z_near f32, z_far f32)

fn pop_matrix #

fn pop_matrix()

fn pop_pipeline #

fn pop_pipeline()

fn push_matrix #

fn push_matrix()

fn push_pipeline #

fn push_pipeline()

fn rad #

fn rad(deg f32) f32

fn rotate #

fn rotate(angle_rad f32, x f32, y f32, z f32)

fn scale #

fn scale(x f32, y f32, z f32)

fn scissor_rect #

fn scissor_rect(x int, y int, w int, h int, origin_top_left bool)

fn setup #

fn setup(desc &C.sgl_desc_t)

setup/shutdown/misc

fn shutdown #

fn shutdown()

fn t2f #

fn t2f(u f32, v f32)

these functions only set the internal 'current texcoord / color' (valid inside or outside begin/end)

fn texture #

fn texture(img C.sg_image)

fn translate #

fn translate(x f32, y f32, z f32)

fn v2f #

fn v2f(x f32, y f32)

fn v2f_c1i #

fn v2f_c1i(x f32, y f32, rgba u32)

fn v2f_c3b #

fn v2f_c3b(x f32, y f32, r byte, g byte, b byte)

fn v2f_c3f #

fn v2f_c3f(x f32, y f32, r f32, g f32, b f32)

fn v2f_c4b #

fn v2f_c4b(x f32, y f32, r byte, g byte, b byte, a byte)

fn v2f_c4f #

fn v2f_c4f(x f32, y f32, r f32, g f32, b f32, a f32)

fn v2f_t2f #

fn v2f_t2f(x f32, y f32, u f32, v f32)

fn v2f_t2f_c1i #

fn v2f_t2f_c1i(x f32, y f32, u f32, v f32, rgba u32)

fn v2f_t2f_c3b #

fn v2f_t2f_c3b(x f32, y f32, u f32, v f32, r byte, g byte, b byte)

fn v2f_t2f_c3f #

fn v2f_t2f_c3f(x f32, y f32, u f32, v f32, r f32, g f32, b f32)

fn v2f_t2f_c4b #

fn v2f_t2f_c4b(x f32, y f32, u f32, v f32, r byte, g byte, b byte, a byte)

fn v2f_t2f_c4f #

fn v2f_t2f_c4f(x f32, y f32, u f32, v f32, r f32, g f32, b f32, a f32)

fn v3f #

fn v3f(x f32, y f32, z f32)

fn v3f_c1i #

fn v3f_c1i(x f32, y f32, z f32, rgba u32)

fn v3f_c3b #

fn v3f_c3b(x f32, y f32, z f32, r byte, g byte, b byte)

fn v3f_c3f #

fn v3f_c3f(x f32, y f32, z f32, r f32, g f32, b f32)

fn v3f_c4b #

fn v3f_c4b(x f32, y f32, z f32, r byte, g byte, b byte, a byte)

fn v3f_c4f #

fn v3f_c4f(x f32, y f32, z f32, r f32, g f32, b f32, a f32)

fn v3f_t2f #

fn v3f_t2f(x f32, y f32, z f32, u f32, v f32)

fn v3f_t2f_c1i #

fn v3f_t2f_c1i(x f32, y f32, z f32, u f32, v f32, rgba u32)

fn v3f_t2f_c3b #

fn v3f_t2f_c3b(x f32, y f32, z f32, u f32, v f32, r byte, g byte, b byte)

fn v3f_t2f_c3f #

fn v3f_t2f_c3f(x f32, y f32, z f32, u f32, v f32, r f32, g f32, b f32)

fn v3f_t2f_c4b #

fn v3f_t2f_c4b(x f32, y f32, z f32, u f32, v f32, r byte, g byte, b byte, a byte)

fn v3f_t2f_c4f #

fn v3f_t2f_c4f(x f32, y f32, z f32, u f32, v f32, r f32, g f32, b f32, a f32)

fn viewport #

fn viewport(x int, y int, w int, h int, origin_top_left bool)

render state functions

enum SglError #

enum SglError {
	no_error
	vertices_full
	commands_full
	stack_overflow
	stack_underfloat
}

should be in a proper module

struct C.sgl_desc_t #

struct C.sgl_desc_t {
	max_vertices       int
	max_commands       int
	pipeline_pool_size int
	color_format       C.sg_pixel_format
	depth_format       C.sg_pixel_format
	sample_count       int
	face_winding       C.sg_face_winding
}

struct C.sgl_pipeline #

struct C.sgl_pipeline {
	id u32
}