package vendor:nanovg/gl

⌘K
Ctrl+K
or
/

    Types

    Blend ¶

    Blend :: struct {
    	src_RGB:   u32,
    	dst_RGB:   u32,
    	src_alpha: u32,
    	dst_alpha: u32,
    }

    Call ¶

    Call :: struct {
    	type:           CallType,
    	image:          int,
    	pathOffset:     int,
    	pathCount:      int,
    	triangleOffset: int,
    	triangleCount:  int,
    	uniformOffset:  int,
    	blendFunc:      Blend,
    }

    CallType ¶

    CallType :: enum int {
    	NONE, 
    	FILL, 
    	CONVEX_FILL, 
    	STROKE, 
    	TRIANGLES, 
    }

    Color ¶

    Color :: [4]f32

    Context ¶

    Context :: struct {
    	shader:          Shader,
    	textures:        [dynamic]Texture,
    	view:            [2]f32,
    	textureId:       int,
    	vertBuf:         u32,
    	vertArr:         u32,
    	// GL3
    	fragBuf:         u32,
    	// USE_UNIFORMBUFFER
    	fragSize:        int,
    	flags:           bit_set[CreateFlag],
    	frag_binding:    u32,
    	// Per frame buffers
    	calls:           [dynamic]Call,
    	paths:           [dynamic]Path,
    	verts:           [dynamic][4]f32,
    	uniforms:        [dynamic]u8,
    	// cached state used for state filter
    	boundTexture:    u32,
    	stencilMask:     u32,
    	stencilFunc:     u32,
    	stencilFuncRef:  i32,
    	stencilFuncMask: u32,
    	blendFunc:       Blend,
    	dummyTex:        int,
    }

    CreateFlag ¶

    CreateFlag :: enum int {
    	// Flag indicating if geometry based anti-aliasing is used (may not be needed when using MSAA).
    	ANTI_ALIAS, 
    	// Flag indicating if strokes should be drawn using stencil buffer. The rendering will be a little
    	// slower, but path overlaps (i.e. self-intersecting or sharp turns) will be drawn just once.
    	STENCIL_STROKES, 
    	// additional debug checks
    	DEBUG, 
    }

    CreateFlags ¶

    CreateFlags :: bit_set[CreateFlag]

    FragUniforms ¶

    FragUniforms :: struct #packed {
    	scissorMat:   [12]f32,
    	// matrices are actually 3 vec4s
    	paintMat:     [12]f32,
    	innerColor:   [4]f32,
    	outerColor:   [4]f32,
    	scissorExt:   [2]f32,
    	scissorScale: [2]f32,
    	extent:       [2]f32,
    	radius:       f32,
    	feather:      f32,
    	strokeMult:   f32,
    	strokeThr:    f32,
    	texType:      i32,
    	type:         ShaderType,
    }

    ImageFlags ¶

    ImageFlags :: bit_set[nanovg.ImageFlag]

    Paint ¶

    Paint :: nanovg.Paint

    Path ¶

    Path :: struct {
    	fillOffset:   int,
    	fillCount:    int,
    	strokeOffset: int,
    	strokeCount:  int,
    }

    ScissorT ¶

    ScissorT :: nanovg.ScissorT

    Shader ¶

    Shader :: struct {
    	prog: u32,
    	frag: u32,
    	vert: u32,
    	loc:  [UniformLoc]i32,
    }

    ShaderType ¶

    ShaderType :: enum i32 {
    	FILL_GRAD, 
    	FILL_IMG, 
    	SIMPLE, 
    	IMG, 
    }

    Texture ¶

    Texture :: struct {
    	id:     int,
    	tex:    u32,
    	width:  int,
    	height: int,
    	type:   nanovg.Texture,
    	flags:  bit_set[nanovg.ImageFlag],
    }

    TextureType ¶

    TextureType :: nanovg.Texture

    UniformLoc ¶

    UniformLoc :: enum int {
    	VIEW_SIZE, 
    	TEX, 
    	FRAG, 
    }

    Vertex ¶

    Vertex :: [4]f32

    framebuffer ¶

    framebuffer :: struct {
    	ctx:     ^nanovg.Context,
    	fbo:     u32,
    	rbo:     u32,
    	texture: u32,
    	image:   int,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Constants

    BLEND_FACTOR_TABLE ¶

    BLEND_FACTOR_TABLE: [nanovg.BlendFactor]u32 : [nvg.BlendFactor]u32{.ZERO = gl.ZERO, .ONE = gl.ONE, .SRC_COLOR = gl.SRC_COLOR, .ONE_MINUS_SRC_COLOR = gl.ONE_MINUS_SRC_COLOR, .DST_COLOR = gl.DST_COLOR, .ONE_MINUS_DST_COLOR = gl.ONE_MINUS_DST_COLOR, .SRC_ALPHA = gl.SRC_ALPHA, .ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA, .DST_ALPHA = gl.DST_ALPHA, .ONE_MINUS_DST_ALPHA = gl.ONE_MINUS_DST_ALPHA, .SRC_ALPHA_SATURATE = gl.SRC_ALPHA_SATURATE}

    DEFAULT_FBO ¶

    DEFAULT_FBO :: 100_000

    DEFAULT_IMPLEMENTATION_STRING ¶

    DEFAULT_IMPLEMENTATION_STRING :: #config(NANOVG_GL_IMPL, "GL3")

    GL2 ¶

    GL2 :: false

    GL2_IMPLEMENTATION ¶

    GL2_IMPLEMENTATION :: DEFAULT_IMPLEMENTATION_STRING == "GL2"

    GL3 ¶

    GL3 :: true

    GL3_IMPLEMENTATION ¶

    GL3_IMPLEMENTATION :: DEFAULT_IMPLEMENTATION_STRING == "GL3"

    GLES2 ¶

    GLES2 :: false

    GLES2_IMPLEMENTATION ¶

    GLES2_IMPLEMENTATION :: DEFAULT_IMPLEMENTATION_STRING == "GLES2"

    GLES3 ¶

    GLES3 :: false

    GLES3_IMPLEMENTATION ¶

    GLES3_IMPLEMENTATION :: DEFAULT_IMPLEMENTATION_STRING == "GLES3"

    GL_IMPLEMENTATION ¶

    GL_IMPLEMENTATION :: true

    GL_UNIFORMARRAY_SIZE ¶

    GL_UNIFORMARRAY_SIZE :: 11

    GL_USE_UNIFORMBUFFER ¶

    GL_USE_UNIFORMBUFFER :: true

    USE_STATE_FILTER ¶

    USE_STATE_FILTER :: #config(USE_STATE_FILTER, true)

    Variables

    defaultFBO ¶

    defaultFBO: i32 = …

    frag_shader ¶

    frag_shader: []u8 = …

    vert_shader ¶

    vert_shader: []u8 = …

    Procedures

    BindFramebuffer ¶

    BindFramebuffer :: proc(fb: ^framebuffer) {…}
     

    helper function to create GL frame buffer to render to

    Create ¶

    Create :: proc(flags: bit_set[CreateFlag]) -> ^nanovg.Context {…}

    CreateFramebuffer ¶

    CreateFramebuffer :: proc(ctx: ^nanovg.Context, w, h: int, imageFlags: bit_set[nanovg.ImageFlag]) -> (fb: framebuffer) {…}

    CreateImageFromHandle ¶

    CreateImageFromHandle :: proc(ctx: ^nanovg.Context, textureId: u32, w, h: int, imageFlags: bit_set[nanovg.ImageFlag]) -> int {…}

    DeleteFramebuffer ¶

    DeleteFramebuffer :: proc(fb: ^framebuffer) {…}

    Destroy ¶

    Destroy :: proc(ctx: ^nanovg.Context) {…}

    ImageHandle ¶

    ImageHandle :: proc(ctx: ^nanovg.Context, textureId: int) -> u32 {…}

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2024-04 (vendor "odin") Windows_amd64 @ 2024-04-26 21:08:59.765720000 +0000 UTC