Documentation ¶
Index ¶
- Constants
- func FreeSerif() (*os.File, error)
- func GetShaderInfoLog(shader *Shader) string
- func LAY_ASSERT(cond bool)
- func ShaderSource(shader *Shader, src string)
- type BoundBuilder
- type Bounds
- type Buffer
- type Button
- type ButtonProgram
- type Char
- type Context
- func (c *Context) ActiveTexture(texture int)
- func (c *Context) AttachShader(program *Program, shader *Shader)
- func (c *Context) BindAttribLocation(program *Program, index int, name string)
- func (c *Context) BindBuffer(target int, buffer *Buffer)
- func (c *Context) BindFrameBuffer(target int, vao *FrameBuffer)
- func (c *Context) BindRenderBuffer(target int, vao *RenderBuffer)
- func (c *Context) BindTexture(target int, texture *Texture)
- func (c *Context) BindVertexArray(vao *VertexArray)
- func (c *Context) BlendEquation(mode int)
- func (c *Context) BlendFunc(src, dst int)
- func (c *Context) BufferData(target int, data interface{}, usage int)
- func (c *Context) CheckFramebufferStatus(target int) int
- func (c *Context) Clear(flags int)
- func (c *Context) ClearColor(r, g, b, a float32)
- func (c *Context) CompileShader(shader *Shader)
- func (c *Context) CreateBuffer() *Buffer
- func (c *Context) CreateFrameBuffer() *FrameBuffer
- func (c *Context) CreateProgram() *Program
- func (c *Context) CreateRenderBuffer() *RenderBuffer
- func (c *Context) CreateShader(typ int) *Shader
- func (c *Context) CreateTexture() *Texture
- func (c *Context) CreateVertexArray() *VertexArray
- func (c *Context) DeleteBuffer(buffer *Buffer)
- func (c *Context) DeleteFrameBuffer(vao *FrameBuffer)
- func (c *Context) DeleteProgram(program *Program)
- func (c *Context) DeleteRenderBuffer(vao *RenderBuffer)
- func (c *Context) DeleteShader(shader *Shader)
- func (c *Context) DeleteTexture(texture *Texture)
- func (c *Context) DeleteVertexArray(vao *VertexArray)
- func (c *Context) Disable(flag int)
- func (c *Context) DisableVertexAttribArray(index int)
- func (c *Context) DrawArrays(mode, first, count int)
- func (c *Context) DrawBuffer(buf int)
- func (c *Context) DrawElements(mode, count, typ, offset int)
- func (c *Context) Enable(flag int)
- func (c *Context) EnableVertexAttribArray(index int)
- func (c *Context) Flush()
- func (c *Context) FramebufferRenderbuffer(target, attachment, renderbuffertarget int, renderbuffer *RenderBuffer)
- func (c *Context) FramebufferTexture2D(target, attachment, textarget int, texture *Texture, level int)
- func (c *Context) GetAttribLocation(program *Program, name string) int
- func (c *Context) GetError() int
- func (c *Context) GetProgramInfoLog(program *Program) string
- func (c *Context) GetProgramParameterb(program *Program, pname int) bool
- func (c *Context) GetProgramParameteri(program *Program, pname int) int
- func (c *Context) GetShaderInfoLog(shader *Shader) string
- func (c *Context) GetShaderiv(shader *Shader, pname uint32) bool
- func (c *Context) GetUniformLocation(program *Program, name string) *UniformLocation
- func (c *Context) LinkProgram(program *Program)
- func (c *Context) Ptr(data interface{}) unsafe.Pointer
- func (c *Context) ReadBuffer(src int)
- func (c *Context) ReadPixels(x, y, width, height, format, typ int, pixels unsafe.Pointer)
- func (c *Context) RenderbufferStorage(target, internalFormat, width, height int)
- func (c *Context) ShaderSource(shader *Shader, source string)
- func (c *Context) TexImage2D(target, level, internalFormat, width, height, format, kind int, ...)
- func (c *Context) TexParameteri(target int, pname int, param int)
- func (c *Context) Uniform1f(location *UniformLocation, x float32)
- func (c *Context) Uniform1i(location *UniformLocation, x int)
- func (c *Context) Uniform2f(location *UniformLocation, x, y float32)
- func (c *Context) Uniform3f(location *UniformLocation, x, y, z float32)
- func (c *Context) Uniform4f(location *UniformLocation, x, y, z, w float32)
- func (c *Context) UniformMatrix3fv(location *UniformLocation, transpose bool, value []float32)
- func (c *Context) UniformMatrix4fv(location *UniformLocation, transpose bool, value []float32)
- func (c *Context) UseProgram(program *Program)
- func (c *Context) ValidateProgram(program *Program)
- func (c *Context) Version() string
- func (c *Context) VertexAttribPointer(index, size, typ int, normal bool, stride int, offset int)
- func (c *Context) Viewport(x, y, width, height int)
- type Font
- type FrameBuffer
- type GPProgram
- func (p *GPProgram) DeleteProgram()
- func (p *GPProgram) GetAttribLocation(s string) int
- func (p *GPProgram) GetAttribs() (attribs map[string]int)
- func (p *GPProgram) GetProgramInfoLog() string
- func (p *GPProgram) GetUniformLocation(s string) *UniformLocation
- func (p *GPProgram) Material(m *Material)
- func (p *GPProgram) ProgramUniform1f(uniform string, value float32)
- func (p *GPProgram) ProgramUniform1i(uniform string, value int)
- func (p *GPProgram) ProgramUniform2f(uniform string, v0 float32, v1 float32)
- func (p *GPProgram) ProgramUniform3fv(uniform string, value [3]float32)
- func (p *GPProgram) ProgramUniform4fv(uniform string, value [4]float32)
- func (p *GPProgram) ProgramUniformMatrix3fv(uniform string, matrix [9]float32)
- func (p *GPProgram) ProgramUniformMatrix4fv(uniform string, matrix [16]float32)
- func (p *GPProgram) UnuseProgram()
- func (p *GPProgram) UseProgram()
- func (p *GPProgram) ValidateProgram() error
- type GPTexture
- type Lay_context
- func (ctx *Lay_context) Lay_append(earlier Lay_id, later Lay_id)
- func (ctx *Lay_context) Lay_clear_item_break(item Lay_id)
- func (ctx *Lay_context) Lay_first_child(id Lay_id) Lay_id
- func (ctx *Lay_context) Lay_get_item(id Lay_id) *Lay_item_t
- func (ctx *Lay_context) Lay_get_margins(item Lay_id) Lay_vec4
- func (ctx *Lay_context) Lay_get_margins_ltrb(item Lay_id) Lay_vec4
- func (ctx *Lay_context) Lay_get_rect(id Lay_id) Lay_vec4
- func (ctx *Lay_context) Lay_get_rect_xywh(id Lay_id) Lay_vec4
- func (ctx *Lay_context) Lay_get_size(item Lay_id) Lay_vec2
- func (ctx *Lay_context) Lay_get_size_xy(item Lay_id) Lay_vec2
- func (ctx *Lay_context) Lay_insert(parent Lay_id, child Lay_id)
- func (ctx *Lay_context) Lay_item() Lay_id
- func (ctx *Lay_context) Lay_items_capacity() Lay_id
- func (ctx *Lay_context) Lay_items_count() Lay_id
- func (ctx *Lay_context) Lay_last_child(parent Lay_id) Lay_id
- func (ctx *Lay_context) Lay_next_sibling(id Lay_id) Lay_id
- func (ctx *Lay_context) Lay_push(parent Lay_id, new_child Lay_id)
- func (ctx *Lay_context) Lay_run_context()
- func (ctx *Lay_context) Lay_run_item(item Lay_id)
- func (ctx *Lay_context) Lay_set_behave(item Lay_id, flags int32)
- func (ctx *Lay_context) Lay_set_contain(item Lay_id, flags int32)
- func (ctx *Lay_context) Lay_set_margins(item Lay_id, ltrb Lay_vec4)
- func (ctx *Lay_context) Lay_set_margins_ltrb(item Lay_id, l, t, r, b Lay_scalar)
- func (ctx *Lay_context) Lay_set_size(item Lay_id, size Lay_vec2)
- func (ctx *Lay_context) Lay_set_size_xy(item Lay_id, width, height Lay_scalar)
- type Lay_id
- type Lay_item_t
- type Lay_scalar
- type Lay_vec2
- type Lay_vec4
- type Material
- type Obj
- type ObjOptions
- type ObjRender
- type ObjsRender
- type OpenGL3
- type Program
- type ProgramCache
- type ReferenceCountable
- type ReleasingReferenceCount
- type RenderBuffer
- type RenderTarget
- type Shader
- type String
- type SubMaterial
- type SubObject
- type Texture
- type UniformLocation
- type VBO
- func NewVBO(prog *GPProgram, options VBOOptions, verts []float32, indices []uint32) (vbo *VBO)
- func NewVBOCube(prog *GPProgram, x float32, y float32, z float32, u float32, v float32, ...) (vbo *VBO)
- func NewVBOCubeNormal(prog *GPProgram, x float32, y float32, z float32, u float32, v float32, ...) (vbo *VBO)
- func NewVBOQuad(prog *GPProgram, x float32, y float32, w float32, h float32) (vbo *VBO)
- type VBOOptions
- type VertexArray
Constants ¶
const ( // left to right LAY_ROW = 0x002 // top to bottom LAY_COLUMN = 0x003 // free layout LAY_LAYOUT = 0x000 // flex model LAY_FLEX = 0x002 // single-line LAY_NOWRAP = 0x000 // multi-line, wrap left to right LAY_WRAP = 0x004 // justify-content (start, end, center, space-between) // at start of row/column LAY_START = 0x008 // at center of row/column LAY_MIDDLE = 0x000 // at end of row/column LAY_END = 0x010 // insert spacing to stretch across whole row/column LAY_JUSTIFY = 0x018 )
Container flags to pass to lay_set_container()
const ( // anchor to left item or left side of parent LAY_LEFT = 0x020 // anchor to top item or top side of parent LAY_TOP = 0x040 // anchor to right item or right side of parent LAY_RIGHT = 0x080 // anchor to bottom item or bottom side of parent LAY_BOTTOM = 0x100 // anchor to both left and right item or parent borders LAY_HFILL = 0x0a0 // anchor to both top and bottom item or parent borders LAY_VFILL = 0x140 // center horizontally, with left margin as offset LAY_HCENTER = 0x000 // center vertically, with top margin as offset LAY_VCENTER = 0x000 // center in both directions, with left/top margin as offset LAY_CENTER = 0x000 // anchor to all four directions LAY_FILL = 0x1e0 // When in a wrapping container, put this element on a new line. Wrapping // layout code auto-inserts LAY_BREAK flags as needed. See GitHub issues for // TODO related to this. // // Drawing routines can read this via item pointers as needed after // performing layout calculations. LAY_BREAK = 0x200 )
child layout flags to pass to lay_set_behave()
const ( // these bits, starting at bit 16, can be safely assigned by the // application, e.g. as item types, other event types, drop targets, etc. // this is not yet exposed via API functions, you'll need to get/set these // by directly accessing item pointers. // // (In reality we have more free bits than this, TODO) // // TODO fix int/unsigned size mismatch (clang issues warning for this), // should be all bits as 1 instead of INT_MAX LAY_USERMASK = 0x7fff0000 // a special mask passed to lay_find_item() (currently does not exist, was // not ported from oui) LAY_ANY = 0x7fffffff )
const ( // bit 0-2 LAY_ITEM_BOX_MODEL_MASK = 0x000007 // bit 0-4 LAY_ITEM_BOX_MASK = 0x00001F // bit 5-9 LAY_ITEM_LAYOUT_MASK = 0x0003E0 // item has been inserted (bit 10) LAY_ITEM_INSERTED = 0x400 // horizontal size has been explicitly set (bit 11) LAY_ITEM_HFIXED = 0x800 // vertical size has been explicitly set (bit 12) LAY_ITEM_VFIXED = 0x1000 // bit 11-12 LAY_ITEM_FIXED_MASK = LAY_ITEM_HFIXED | LAY_ITEM_VFIXED // which flag bits will be compared LAY_ITEM_COMPARE_MASK = LAY_ITEM_BOX_MODEL_MASK | (LAY_ITEM_LAYOUT_MASK & ^LAY_BREAK) | LAY_USERMASK )
Variables ¶
This section is empty.
Functions ¶
func LAY_ASSERT ¶
func LAY_ASSERT(cond bool)
Types ¶
type BoundBuilder ¶
type BoundBuilder struct {
// contains filtered or unexported fields
}
BoundBuilder ...
type ButtonProgram ¶
type ButtonProgram struct { ReleasingReferenceCount // contains filtered or unexported fields }
ButtonProgram ...
type Context ¶
type Context struct { ARRAY_BUFFER int ARRAY_BUFFER_BINDING int ATTACHED_SHADERS int BACK int BLEND int BLEND_COLOR int BLEND_DST_ALPHA int BLEND_DST_RGB int BLEND_EQUATION int BLEND_EQUATION_ALPHA int BLEND_EQUATION_RGB int BLEND_SRC_ALPHA int BLEND_SRC_RGB int BLUE_BITS int BOOL int BOOL_VEC2 int BOOL_VEC3 int BOOL_VEC4 int BROWSER_DEFAULT_WEBGL int BUFFER_SIZE int BUFFER_USAGE int BYTE int CCW int CLAMP_TO_EDGE int CLAMP_TO_BORDER int COLOR_ATTACHMENT0 int COLOR_BUFFER_BIT int COLOR_CLEAR_VALUE int COLOR_WRITEMASK int COMPILE_STATUS uint32 COMPRESSED_TEXTURE_FORMATS int CONSTANT_ALPHA int CONSTANT_COLOR int CONTEXT_LOST_WEBGL int CULL_FACE int CULL_FACE_MODE int CURRENT_PROGRAM int CURRENT_VERTEX_ATTRIB int CW int DECR int DECR_WRAP int DELETE_STATUS int DEPTH_ATTACHMENT int DEPTH_BITS int DEPTH_BUFFER_BIT int DEPTH_CLEAR_VALUE int DEPTH_COMPONENT int DEPTH_COMPONENT16 int DEPTH_FUNC int DEPTH_RANGE int DEPTH_STENCIL int DEPTH_STENCIL_ATTACHMENT int DEPTH_TEST int DEPTH_WRITEMASK int DITHER int DONT_CARE int DST_ALPHA int DST_COLOR int DYNAMIC_DRAW int ELEMENT_ARRAY_BUFFER int ELEMENT_ARRAY_BUFFER_BINDING int EQUAL int FASTEST int FLOAT int FLOAT_MAT2 int FLOAT_MAT3 int FLOAT_MAT4 int FLOAT_VEC2 int FLOAT_VEC3 int FLOAT_VEC4 int FRAGMENT_SHADER int FRAMEBUFFER int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL int FRAMEBUFFER_BINDING int FRAMEBUFFER_COMPLETE int FRAMEBUFFER_INCOMPLETE_ATTACHMENT int FRAMEBUFFER_INCOMPLETE_DIMENSIONS int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER int FRAMEBUFFER_INCOMPLETE_READ_BUFFER int FRAMEBUFFER_UNSUPPORTED int FRONT int FRONT_AND_BACK int FRONT_FACE int FUNC_ADD int FUNC_REVERSE_SUBTRACT int FUNC_SUBTRACT int GENERATE_MIPMAP_HINT int GEQUAL int GREATER int GREEN_BITS int HIGH_FLOAT int HIGH_INT int INCR int INCR_WRAP int INFO_LOG_LENGTH uint32 INT int INT_VEC2 int INT_VEC3 int INT_VEC4 int INVALID_ENUM int INVALID_FRAMEBUFFER_OPERATION int INVALID_OPERATION int INVALID_VALUE int INVERT int KEEP int LEQUAL int LESS int LINEAR int LINEAR_MIPMAP_LINEAR int LINEAR_MIPMAP_NEAREST int LINES int LINE_LOOP int LINE_STRIP int LINE_WIDTH int LINK_STATUS int LOW_FLOAT int LOW_INT int LUMINANCE int LUMINANCE_ALPHA int MAX_COMBINED_TEXTURE_IMAGE_UNITS int MAX_CUBE_MAP_TEXTURE_SIZE int MAX_FRAGMENT_UNIFORM_VECTORS int MAX_RENDERBUFFER_SIZE int MAX_TEXTURE_IMAGE_UNITS int MAX_TEXTURE_SIZE int MAX_VARYING_VECTORS int MAX_VERTEX_ATTRIBS int MAX_VERTEX_TEXTURE_IMAGE_UNITS int MAX_VERTEX_UNIFORM_VECTORS int MAX_VIEWPORT_DIMS int MEDIUM_FLOAT int MEDIUM_INT int MIRRORED_REPEAT int MULTISAMPLE int NEAREST int NEAREST_MIPMAP_LINEAR int NEAREST_MIPMAP_NEAREST int NEVER int NICEST int NONE int NOTEQUAL int NO_ERROR int NUM_COMPRESSED_TEXTURE_FORMATS int ONE int ONE_MINUS_CONSTANT_ALPHA int ONE_MINUS_CONSTANT_COLOR int ONE_MINUS_DST_ALPHA int ONE_MINUS_DST_COLOR int ONE_MINUS_SRC_ALPHA int ONE_MINUS_SRC_COLOR int OUT_OF_MEMORY int PACK_ALIGNMENT int POINTS int POLYGON_OFFSET_FACTOR int POLYGON_OFFSET_FILL int POLYGON_OFFSET_UNITS int RED_BITS int RENDERBUFFER int RENDERBUFFER_ALPHA_SIZE int RENDERBUFFER_BINDING int RENDERBUFFER_BLUE_SIZE int RENDERBUFFER_DEPTH_SIZE int RENDERBUFFER_GREEN_SIZE int RENDERBUFFER_HEIGHT int RENDERBUFFER_INTERNAL_FORMAT int RENDERBUFFER_RED_SIZE int RENDERBUFFER_STENCIL_SIZE int RENDERBUFFER_WIDTH int RENDERER int REPEAT int REPLACE int RGB int RGB5_A1 int RGB565 int RGBA int RGBA32F int RGBA4 int SAMPLER_2D int SAMPLER_CUBE int SAMPLES int SAMPLE_ALPHA_TO_COVERAGE int SAMPLE_BUFFERS int SAMPLE_COVERAGE int SAMPLE_COVERAGE_INVERT int SAMPLE_COVERAGE_VALUE int SCISSOR_BOX int SCISSOR_TEST int SHADER_COMPILER int SHADER_SOURCE_LENGTH int SHADER_TYPE int SHADING_LANGUAGE_VERSION int SHORT int SRC_ALPHA int SRC_ALPHA_SATURATE int SRC_COLOR int STATIC_DRAW int STENCIL_ATTACHMENT int STENCIL_BACK_FAIL int STENCIL_BACK_FUNC int STENCIL_BACK_PASS_DEPTH_FAIL int STENCIL_BACK_PASS_DEPTH_PASS int STENCIL_BACK_REF int STENCIL_BACK_VALUE_MASK int STENCIL_BACK_WRITEMASK int STENCIL_BITS int STENCIL_BUFFER_BIT int STENCIL_CLEAR_VALUE int STENCIL_FAIL int STENCIL_FUNC int STENCIL_INDEX int STENCIL_INDEX8 int STENCIL_PASS_DEPTH_FAIL int STENCIL_PASS_DEPTH_PASS int STENCIL_REF int STENCIL_TEST int STENCIL_VALUE_MASK int STENCIL_WRITEMASK int STREAM_DRAW int SUBPIXEL_BITS int TEXTURE int TEXTURE0 int TEXTURE1 int TEXTURE2 int TEXTURE3 int TEXTURE4 int TEXTURE5 int TEXTURE6 int TEXTURE7 int TEXTURE8 int TEXTURE9 int TEXTURE10 int TEXTURE11 int TEXTURE12 int TEXTURE13 int TEXTURE14 int TEXTURE15 int TEXTURE16 int TEXTURE17 int TEXTURE18 int TEXTURE19 int TEXTURE20 int TEXTURE21 int TEXTURE22 int TEXTURE23 int TEXTURE24 int TEXTURE25 int TEXTURE26 int TEXTURE27 int TEXTURE28 int TEXTURE29 int TEXTURE30 int TEXTURE31 int TEXTURE_2D int TEXTURE_BINDING_2D int TEXTURE_BINDING_CUBE_MAP int TEXTURE_CUBE_MAP int TEXTURE_CUBE_MAP_NEGATIVE_X int TEXTURE_CUBE_MAP_NEGATIVE_Y int TEXTURE_CUBE_MAP_NEGATIVE_Z int TEXTURE_CUBE_MAP_POSITIVE_X int TEXTURE_CUBE_MAP_POSITIVE_Y int TEXTURE_CUBE_MAP_POSITIVE_Z int TEXTURE_MAG_FILTER int TEXTURE_MIN_FILTER int TEXTURE_WRAP_S int TEXTURE_WRAP_T int TRIANGLES int TRIANGLE_FAN int TRIANGLE_STRIP int UNPACK_ALIGNMENT int UNPACK_COLORSPACE_CONVERSION_WEBGL int UNPACK_FLIP_Y_WEBGL int UNPACK_PREMULTIPLY_ALPHA_WEBGL int UNSIGNED_BYTE int UNSIGNED_INT int UNSIGNED_SHORT int UNSIGNED_SHORT_4_4_4_4 int UNSIGNED_SHORT_5_5_5_1 int UNSIGNED_SHORT_5_6_5 int VALIDATE_STATUS int VENDOR int VERSION int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING int VERTEX_ATTRIB_ARRAY_ENABLED int VERTEX_ATTRIB_ARRAY_NORMALIZED int VERTEX_ATTRIB_ARRAY_POINTER int VERTEX_ATTRIB_ARRAY_SIZE int VERTEX_ATTRIB_ARRAY_STRIDE int VERTEX_ATTRIB_ARRAY_TYPE int VERTEX_SHADER int VIEWPORT int ZERO int TRUE int R8 int RED int R32F int }
var Gl *Context
Gl may become engo.Gl (Gl = glplus.NewContext())
func (*Context) ActiveTexture ¶
func (*Context) AttachShader ¶
func (*Context) BindAttribLocation ¶
func (*Context) BindBuffer ¶
func (*Context) BindFrameBuffer ¶
func (c *Context) BindFrameBuffer(target int, vao *FrameBuffer)
func (*Context) BindRenderBuffer ¶
func (c *Context) BindRenderBuffer(target int, vao *RenderBuffer)
func (*Context) BindTexture ¶
func (*Context) BindVertexArray ¶
func (c *Context) BindVertexArray(vao *VertexArray)
func (*Context) BlendEquation ¶
func (*Context) BufferData ¶
func (*Context) CheckFramebufferStatus ¶
func (*Context) ClearColor ¶
func (*Context) CompileShader ¶
func (*Context) CreateBuffer ¶
func (*Context) CreateFrameBuffer ¶
func (c *Context) CreateFrameBuffer() *FrameBuffer
func (*Context) CreateProgram ¶
func (*Context) CreateRenderBuffer ¶
func (c *Context) CreateRenderBuffer() *RenderBuffer
func (*Context) CreateShader ¶
func (*Context) CreateTexture ¶
func (*Context) CreateVertexArray ¶
func (c *Context) CreateVertexArray() *VertexArray
func (*Context) DeleteBuffer ¶
func (*Context) DeleteFrameBuffer ¶
func (c *Context) DeleteFrameBuffer(vao *FrameBuffer)
func (*Context) DeleteProgram ¶
func (*Context) DeleteRenderBuffer ¶
func (c *Context) DeleteRenderBuffer(vao *RenderBuffer)
func (*Context) DeleteShader ¶
func (*Context) DeleteTexture ¶
func (*Context) DeleteVertexArray ¶
func (c *Context) DeleteVertexArray(vao *VertexArray)
func (*Context) DisableVertexAttribArray ¶
func (*Context) DrawArrays ¶
func (*Context) DrawBuffer ¶
func (*Context) DrawElements ¶
func (*Context) EnableVertexAttribArray ¶
func (*Context) FramebufferRenderbuffer ¶
func (c *Context) FramebufferRenderbuffer(target, attachment, renderbuffertarget int, renderbuffer *RenderBuffer)
func (*Context) FramebufferTexture2D ¶
func (*Context) GetAttribLocation ¶
func (*Context) GetProgramInfoLog ¶
func (*Context) GetProgramParameterb ¶
func (*Context) GetProgramParameteri ¶
func (*Context) GetShaderInfoLog ¶
func (*Context) GetUniformLocation ¶
func (c *Context) GetUniformLocation(program *Program, name string) *UniformLocation
func (*Context) LinkProgram ¶
func (*Context) ReadBuffer ¶
func (*Context) ReadPixels ¶
func (*Context) RenderbufferStorage ¶
func (*Context) ShaderSource ¶
func (*Context) TexImage2D ¶
func (*Context) Uniform1f ¶
func (c *Context) Uniform1f(location *UniformLocation, x float32)
func (*Context) Uniform1i ¶
func (c *Context) Uniform1i(location *UniformLocation, x int)
Assigns a integer value to a uniform variable for the current program object.
func (*Context) Uniform2f ¶
func (c *Context) Uniform2f(location *UniformLocation, x, y float32)
func (*Context) Uniform3f ¶
func (c *Context) Uniform3f(location *UniformLocation, x, y, z float32)
func (*Context) Uniform4f ¶
func (c *Context) Uniform4f(location *UniformLocation, x, y, z, w float32)
func (*Context) UniformMatrix3fv ¶
func (c *Context) UniformMatrix3fv(location *UniformLocation, transpose bool, value []float32)
func (*Context) UniformMatrix4fv ¶
func (c *Context) UniformMatrix4fv(location *UniformLocation, transpose bool, value []float32)
func (*Context) UseProgram ¶
func (*Context) ValidateProgram ¶
func (*Context) VertexAttribPointer ¶
type FrameBuffer ¶
type FrameBuffer struct {
// contains filtered or unexported fields
}
FrameBuffer ...
type GPProgram ¶
type GPProgram struct {
// contains filtered or unexported fields
}
GPProgram ...
func LoadShaderProgram ¶
LoadShaderProgram ... loads shader objects and then attaches them to a program
func (*GPProgram) GetAttribLocation ¶
GetAttribLocation ...
func (*GPProgram) GetAttribs ¶
GetAttribs ...
func (*GPProgram) GetProgramInfoLog ¶
GetProgramInfoLog ...
func (*GPProgram) GetUniformLocation ¶
func (p *GPProgram) GetUniformLocation(s string) *UniformLocation
GetUniformLocation ...
func (*GPProgram) ProgramUniform1f ¶
ProgramUniform1f ...
func (*GPProgram) ProgramUniform1i ¶
ProgramUniform1i ...
func (*GPProgram) ProgramUniform2f ¶
ProgramUniform2f ...
func (*GPProgram) ProgramUniform3fv ¶
ProgramUniform3fv ...
func (*GPProgram) ProgramUniform4fv ¶
ProgramUniform4fv ...
func (*GPProgram) ProgramUniformMatrix3fv ¶
ProgramUniformMatrix3fv ...
func (*GPProgram) ProgramUniformMatrix4fv ¶
ProgramUniformMatrix4fv ...
type GPTexture ¶
GPTexture ...
func LoadTexture ¶
LoadTexture ...
func NewRGBATexture ¶
NewRGBATexture ...
type Lay_context ¶
type Lay_context struct {
// contains filtered or unexported fields
}
func (*Lay_context) Lay_append ¶
func (ctx *Lay_context) Lay_append(earlier Lay_id, later Lay_id)
lay_append inserts an item as a sibling after another item. This allows inserting an item into the middle of an existing list of items within a parent. It's also more efficient than repeatedly using lay_insert(ctx, parent, new_child) in a loop to create a list of items in a parent, because it does not need to traverse the parent's children each time. So if you're creating a long list of children inside of a parent, you might prefer to use this after using lay_insert to insert the first child.
func (*Lay_context) Lay_clear_item_break ¶
func (ctx *Lay_context) Lay_clear_item_break(item Lay_id)
func (*Lay_context) Lay_first_child ¶
func (ctx *Lay_context) Lay_first_child(id Lay_id) Lay_id
Get the id of first child of an item, if any. Returns LAY_INVALID_ID if there is no child.
func (*Lay_context) Lay_get_item ¶
func (ctx *Lay_context) Lay_get_item(id Lay_id) *Lay_item_t
Get the pointer to an item in the buffer by its id. Don't keep this around -- it will become invalid as soon as any reallocation occurs. Just store the id instead (it's smaller, anyway, and the lookup cost will be nothing.)
func (*Lay_context) Lay_get_margins ¶
func (ctx *Lay_context) Lay_get_margins(item Lay_id) Lay_vec4
Get the margins that were set by lay_set_margins. The _ltrb version writes the output values to the specified addresses instead of returning the values in a Lay_vec4. l: left, t: top, r: right, b: bottom
func (*Lay_context) Lay_get_margins_ltrb ¶
func (ctx *Lay_context) Lay_get_margins_ltrb(item Lay_id) Lay_vec4
func (*Lay_context) Lay_get_rect ¶
func (ctx *Lay_context) Lay_get_rect(id Lay_id) Lay_vec4
Returns the calculated rectangle of an item. This is only valid after calling lay_run_context and before any other reallocation occurs. Otherwise, the result will be undefined. The vector components are: 0: x starting position, 1: y starting position 2: width, 3: height
func (*Lay_context) Lay_get_rect_xywh ¶
func (ctx *Lay_context) Lay_get_rect_xywh(id Lay_id) Lay_vec4
The same as lay_get_rect, but writes the x,y positions and width,height values to the specified addresses instead of returning them in a Lay_vec4.
func (*Lay_context) Lay_get_size ¶
func (ctx *Lay_context) Lay_get_size(item Lay_id) Lay_vec2
Gets the size that was set with lay_set_size or lay_set_size_xy. The _xy version writes the output values to the specified addresses instead of returning the values in a Lay_vec2.
func (*Lay_context) Lay_get_size_xy ¶
func (ctx *Lay_context) Lay_get_size_xy(item Lay_id) Lay_vec2
func (*Lay_context) Lay_insert ¶
func (ctx *Lay_context) Lay_insert(parent Lay_id, child Lay_id)
Inserts an item into another item, forming a parent - child relationship. An item can contain any number of child items. Items inserted into a parent are put at the end of the ordering, after any existing siblings.
func (*Lay_context) Lay_item ¶
func (ctx *Lay_context) Lay_item() Lay_id
Create a new item, which can just be thought of as a rectangle. Returns the id (handle) used to identify the item.
func (*Lay_context) Lay_items_capacity ¶
func (ctx *Lay_context) Lay_items_capacity() Lay_id
Returns the number of items the context can hold without performing a reallocation.
func (*Lay_context) Lay_items_count ¶
func (ctx *Lay_context) Lay_items_count() Lay_id
Returns the number of items that have been created in a context.
func (*Lay_context) Lay_last_child ¶
func (ctx *Lay_context) Lay_last_child(parent Lay_id) Lay_id
func (*Lay_context) Lay_next_sibling ¶
func (ctx *Lay_context) Lay_next_sibling(id Lay_id) Lay_id
Get the id of the next sibling of an item, if any. Returns LAY_INVALID_ID if there is no next sibling.
func (*Lay_context) Lay_push ¶
func (ctx *Lay_context) Lay_push(parent Lay_id, new_child Lay_id)
Like lay_insert, but puts the new item as the first child in a parent instead of as the last.
func (*Lay_context) Lay_run_context ¶
func (ctx *Lay_context) Lay_run_context()
Performs the layout calculations, starting at the root item (id 0). After calling this, you can use lay_get_rect() to query for an item's calculated rectangle. If you use procedures such as lay_append() or lay_insert() after calling this, your calculated data may become invalid if a reallocation occurs.
You should prefer to recreate your items starting from the root instead of doing fine-grained updates to the existing context.
However, it's safe to use lay_set_size on an item, and then re-run lay_run_context. This might be useful if you are doing a resizing animation on items in a layout without any contents changing.
func (*Lay_context) Lay_run_item ¶
func (ctx *Lay_context) Lay_run_item(item Lay_id)
Like lay_run_context(), this procedure will run layout calculations -- however, it lets you specify which item you want to start from. lay_run_context() always starts with item 0, the first item, as the root. Running the layout calculations from a specific item is useful if you want need to iteratively re-run parts of your layout hierarchy, or if you are only interested in updating certain subsets of it. Be careful when using this -- it's easy to generated bad output if the parent items haven't yet had their output rectangles calculated, or if they've been invalidated (e.g. due to re-allocation).
func (*Lay_context) Lay_set_behave ¶
func (ctx *Lay_context) Lay_set_behave(item Lay_id, flags int32)
Set the flags on an item which determines how it behaves as a child inside of a parent item. For example, setting LAY_VFILL will make an item try to fill up all available vertical space inside of its parent.
func (*Lay_context) Lay_set_contain ¶
func (ctx *Lay_context) Lay_set_contain(item Lay_id, flags int32)
Set the flags on an item which determines how it behaves as a parent. For example, setting LAY_COLUMN will make an item behave as if it were a column -- it will lay out its children vertically.
func (*Lay_context) Lay_set_margins ¶
func (ctx *Lay_context) Lay_set_margins(item Lay_id, ltrb Lay_vec4)
Set the margins on an item. The components of the vector are: 0: left, 1: top, 2: right, 3: bottom.
func (*Lay_context) Lay_set_margins_ltrb ¶
func (ctx *Lay_context) Lay_set_margins_ltrb(item Lay_id, l, t, r, b Lay_scalar)
Same as lay_set_margins, but the components are passed as separate arguments (left, top, right, bottom).
func (*Lay_context) Lay_set_size ¶
func (ctx *Lay_context) Lay_set_size(item Lay_id, size Lay_vec2)
Sets the size of an item. The _xy version passes the width and height as separate arguments, but functions the same.
func (*Lay_context) Lay_set_size_xy ¶
func (ctx *Lay_context) Lay_set_size_xy(item Lay_id, width, height Lay_scalar)
type Lay_item_t ¶
type Lay_item_t struct {
// contains filtered or unexported fields
}
type Lay_scalar ¶
type Lay_scalar int16
type Lay_vec2 ¶
type Lay_vec2 [2]Lay_scalar
type Lay_vec4 ¶
type Lay_vec4 [4]Lay_scalar
func Lay_vec4_xyzw ¶
func Lay_vec4_xyzw(x, y, z, w Lay_scalar) Lay_vec4
type Material ¶
type Material struct { Diffuse []float32 `yaml:",flow"` Shininess float32 `yaml:"shininess"` // rename Specular []float32 `yaml:",flow"` Ambient []float32 `yaml:",flow"` }
Material ...
type Obj ¶
type Obj struct { Bounds Bounds ObjVertices []float32 Name string TexImg *image.RGBA SubObjects []SubObject SubMaterials []SubMaterial Marker Bounds }
Obj ...
type ObjOptions ¶
ObjOptions ...
type ObjRender ¶
type ObjRender struct { Obj *Obj // contains filtered or unexported fields }
ObjRender ...
func (*ObjRender) Draw ¶
func (m *ObjRender) Draw(material *Material, camera, projection, model mgl32.Mat4, light mgl32.Vec3, uvAngle float64, tex *GPTexture)
Draw ...
func (*ObjRender) NormalizedMat ¶
NormalizedMat ...
type ObjsRender ¶
type ObjsRender struct {
Objs []*ObjRender
}
ObjsRender ...
func (*ObjsRender) Draw ¶
func (m *ObjsRender) Draw(material *Material, camera, projection, model mgl32.Mat4, light mgl32.Vec3, uvAngle float64, tex *GPTexture)
Draw ...
func (*ObjsRender) NormalizedMat ¶
func (m *ObjsRender) NormalizedMat() (mres mgl32.Mat4)
NormalizedMat ...
type OpenGL3 ¶
type OpenGL3 struct {
// contains filtered or unexported fields
}
OpenGL3 implements a renderer based on github.com/go-gl/gl (v3.2-core).
func NewOpenGL3 ¶
NewOpenGL3 attempts to initialize a renderer. An OpenGL context has to be established before calling this function.
type ProgramCache ¶
type ProgramCache struct { ReleasingReferenceCount // contains filtered or unexported fields }
ProgramCache ...
type ReferenceCountable ¶
type ReferenceCountable interface { Decr() bool Incr() }
ReferenceCountable ...
type ReleasingReferenceCount ¶
type ReleasingReferenceCount struct {
// contains filtered or unexported fields
}
ReleasingReferenceCount ...
type RenderBuffer ¶
type RenderBuffer struct {
// contains filtered or unexported fields
}
RenderBuffer ...
type RenderTarget ¶
type RenderTarget struct { Tex *GPTexture // contains filtered or unexported fields }
RenderTarget ...
func (*RenderTarget) EnsureSize ¶
func (r *RenderTarget) EnsureSize(size image.Point)
EnsureSize ...
func (*RenderTarget) ReadBuffer ¶
func (r *RenderTarget) ReadBuffer(w, h int) (newImage *image.RGBA)
ReadBuffer ...
type Texture ¶
type Texture struct {
// contains filtered or unexported fields
}
Texture one day my become gl. from "engo.io/gl"
type UniformLocation ¶
type UniformLocation struct {
// contains filtered or unexported fields
}
UniformLocation ...
type VBO ¶
type VBO struct {
// contains filtered or unexported fields
}
VBO ...
func NewVBO ¶
func NewVBO(prog *GPProgram, options VBOOptions, verts []float32, indices []uint32) (vbo *VBO)
NewVBO ...
func NewVBOCube ¶
func NewVBOCube(prog *GPProgram, x float32, y float32, z float32, u float32, v float32, w float32) (vbo *VBO)
NewVBOCube ...
func NewVBOCubeNormal ¶
func NewVBOCubeNormal(prog *GPProgram, x float32, y float32, z float32, u float32, v float32, w float32) (vbo *VBO)
NewVBOCubeNormal ...
func NewVBOQuad ¶
NewVBOQuad ...
type VBOOptions ¶
VBOOptions ...
type VertexArray ¶
type VertexArray struct {
// contains filtered or unexported fields
}
VertexArray ...