Documentation ¶
Index ¶
- Variables
- type Context
- func (c *Context) ConvertBlendEq(eq gfx.BlendEq) int
- func (c *Context) ConvertBlendOp(o gfx.BlendOp) int
- func (c *Context) ConvertCmp(cmp gfx.Cmp) int
- func (c *Context) ConvertPrimitive(p gfx.Primitive) int
- func (c *Context) ConvertStencilOp(o gfx.StencilOp) int
- func (c *Context) ConvertTexFilter(f gfx.TexFilter) int
- func (c *Context) ConvertTexWrap(w gfx.TexWrap) int
- func (c *Context) Feature(capability int, enabled bool)
- func (c *Context) FramebufferStatus(code int) error
- func (c *Context) GetError() error
- func (c *Context) ShadingLanguageVersion() (major, minor, release int, vendor string)
- func (c *Context) UnconvertBlendEq(eq int) gfx.BlendEq
- func (c *Context) UnconvertBlendOp(o int) gfx.BlendOp
- func (c *Context) UnconvertCmp(cmp int) gfx.Cmp
- func (c *Context) UnconvertFaceCullMode(fc int) gfx.FaceCullMode
- func (c *Context) UnconvertStencilOp(o int) gfx.StencilOp
- func (c *Context) Version() (major, minor, release int, vendor string)
- type GraphicsState
- func (g *GraphicsState) Begin(bounds image.Rectangle, custom func()) bool
- func (g *GraphicsState) Blend(v bool)
- func (g *GraphicsState) BlendColor(c gfx.Color)
- func (g *GraphicsState) BlendEquationSeparate(bs gfx.BlendState)
- func (g *GraphicsState) BlendFuncSeparate(bs gfx.BlendState)
- func (g *GraphicsState) ClearColor(color gfx.Color)
- func (g *GraphicsState) ClearDepth(depth float64)
- func (g *GraphicsState) ClearStencil(stencil int)
- func (g *GraphicsState) ColorWrite(red, green, blue, alpha bool)
- func (g *GraphicsState) DepthCmp(cmp gfx.Cmp)
- func (g *GraphicsState) DepthTest(v bool)
- func (g *GraphicsState) DepthWrite(write bool)
- func (g *GraphicsState) Dithering(v bool)
- func (g *GraphicsState) FaceCulling(m gfx.FaceCullMode)
- func (g *GraphicsState) Multisample(v bool)
- func (g *GraphicsState) Restore(bounds image.Rectangle, custom func()) bool
- func (g *GraphicsState) SampleAlphaToCoverage(v bool)
- func (g *GraphicsState) Scissor(bounds, rect image.Rectangle)
- func (g *GraphicsState) ScissorTest(v bool)
- func (g *GraphicsState) StencilOpSeparate(front, back gfx.StencilState)
- func (g *GraphicsState) StencilTest(v bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InvalidEnum = errors.New("GL_INVALID_ENUM") InvalidValue = errors.New("GL_INVALID_VALUE") InvalidOperation = errors.New("GL_INVALID_OPERATION") InvalidFramebufferOperation = errors.New("GL_INVALID_FRAMEBUFFER_OPERATION") OutOfMemory = errors.New("GL_OUT_OF_MEMORY") StackUnderflow = errors.New("GL_STACK_UNDERFLOW") StackOverflow = errors.New("GL_STACK_OVERFLOW") )
View Source
var ( FramebufferIncompleteAttachment = errors.New("GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT") FramebufferIncompleteDimensions = errors.New("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS") FramebufferIncompleteMissingAttachment = errors.New("GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT") FramebufferIncompleteDrawBuffer = errors.New("GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER") FramebufferIncompleteReadBuffer = errors.New("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER") FramebufferIncompleteMultisample = errors.New("GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE") FramebufferUnsupported = errors.New("GL_FRAMEBUFFER_UNSUPPORTED") FramebufferUndefined = errors.New("GL_FRAMEBUFFER_UNDEFINED") )
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { NO_ERROR int INVALID_ENUM int INVALID_VALUE int INVALID_OPERATION int INVALID_FRAMEBUFFER_OPERATION int OUT_OF_MEMORY int STACK_UNDERFLOW int STACK_OVERFLOW int TRIANGLES int POINTS int LINES int FRONT int BACK int FRONT_AND_BACK int KEEP int ZERO int REPLACE int INCR int INCR_WRAP int DECR int DECR_WRAP int INVERT int NEVER int LESS int LEQUAL int ALWAYS int GREATER int GEQUAL int EQUAL int NOTEQUAL int ONE int SRC_COLOR int ONE_MINUS_SRC_COLOR int DST_COLOR int ONE_MINUS_DST_COLOR int SRC_ALPHA int ONE_MINUS_SRC_ALPHA int DST_ALPHA int ONE_MINUS_DST_ALPHA int CONSTANT_COLOR int ONE_MINUS_CONSTANT_COLOR int CONSTANT_ALPHA int ONE_MINUS_CONSTANT_ALPHA int SRC_ALPHA_SATURATE int FUNC_ADD int FUNC_SUBTRACT int FUNC_REVERSE_SUBTRACT int DITHER int SCISSOR_TEST int STENCIL_TEST int DEPTH_TEST int CULL_FACE int BLEND int SAMPLE_ALPHA_TO_COVERAGE int MULTISAMPLE int DEPTH_WRITEMASK int COLOR_CLEAR_VALUE int BLEND_COLOR int DEPTH_CLEAR_VALUE int STENCIL_CLEAR_VALUE int DEPTH_FUNC int CULL_FACE_MODE int BLEND_SRC_RGB int BLEND_DST_RGB int BLEND_SRC_ALPHA int BLEND_DST_ALPHA int BLEND_EQUATION_RGB int BLEND_EQUATION_ALPHA int STENCIL_FAIL int STENCIL_PASS_DEPTH_FAIL int STENCIL_PASS_DEPTH_PASS int STENCIL_BACK_FAIL int STENCIL_BACK_PASS_DEPTH_FAIL int STENCIL_BACK_PASS_DEPTH_PASS int REPEAT int CLAMP_TO_EDGE int CLAMP_TO_BORDER int MIRRORED_REPEAT int NEAREST int LINEAR int NEAREST_MIPMAP_NEAREST int LINEAR_MIPMAP_NEAREST int NEAREST_MIPMAP_LINEAR int LINEAR_MIPMAP_LINEAR 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_INCOMPLETE_MULTISAMPLE int FRAMEBUFFER_UNSUPPORTED int FRAMEBUFFER_UNDEFINED int VERSION int SHADING_LANGUAGE_VERSION int // contains filtered or unexported fields }
func NewContext ¶
func NewContext() *Context
func (*Context) Feature ¶
Feature enables or disables the given capability depending on the given boolean.
func (*Context) FramebufferStatus ¶
func (*Context) ShadingLanguageVersion ¶
func (*Context) UnconvertFaceCullMode ¶
func (c *Context) UnconvertFaceCullMode(fc int) gfx.FaceCullMode
type GraphicsState ¶
type GraphicsState struct { C *Context S *glutil.CommonState Saved *glutil.CommonState }
func NewGraphicsState ¶
func NewGraphicsState(c *Context) *GraphicsState
func (*GraphicsState) Begin ¶
func (g *GraphicsState) Begin(bounds image.Rectangle, custom func()) bool
Begin begins use of this graphics state by saving the existing OpenGL state for restoration later (see Restore).
If Begin was already called without a call to Restore later, the call to this function is no-op, and false is returned.
func (*GraphicsState) Blend ¶
func (g *GraphicsState) Blend(v bool)
func (*GraphicsState) BlendColor ¶
func (g *GraphicsState) BlendColor(c gfx.Color)
func (*GraphicsState) BlendEquationSeparate ¶
func (g *GraphicsState) BlendEquationSeparate(bs gfx.BlendState)
func (*GraphicsState) BlendFuncSeparate ¶
func (g *GraphicsState) BlendFuncSeparate(bs gfx.BlendState)
func (*GraphicsState) ClearColor ¶
func (g *GraphicsState) ClearColor(color gfx.Color)
func (*GraphicsState) ClearDepth ¶
func (g *GraphicsState) ClearDepth(depth float64)
func (*GraphicsState) ClearStencil ¶
func (g *GraphicsState) ClearStencil(stencil int)
func (*GraphicsState) ColorWrite ¶
func (g *GraphicsState) ColorWrite(red, green, blue, alpha bool)
func (*GraphicsState) DepthCmp ¶
func (g *GraphicsState) DepthCmp(cmp gfx.Cmp)
func (*GraphicsState) DepthTest ¶
func (g *GraphicsState) DepthTest(v bool)
func (*GraphicsState) DepthWrite ¶
func (g *GraphicsState) DepthWrite(write bool)
func (*GraphicsState) Dithering ¶
func (g *GraphicsState) Dithering(v bool)
func (*GraphicsState) FaceCulling ¶
func (g *GraphicsState) FaceCulling(m gfx.FaceCullMode)
func (*GraphicsState) Multisample ¶
func (g *GraphicsState) Multisample(v bool)
func (*GraphicsState) Restore ¶
func (g *GraphicsState) Restore(bounds image.Rectangle, custom func()) bool
Restore restores the OpenGL graphics state. If Restore was called without a preceding call to Begin, then the call to this function is no-op and false is returned.
func (*GraphicsState) SampleAlphaToCoverage ¶
func (g *GraphicsState) SampleAlphaToCoverage(v bool)
func (*GraphicsState) Scissor ¶
func (g *GraphicsState) Scissor(bounds, rect image.Rectangle)
Scissor sets the scissor rectangle, bounds should be the framebuffer's bounds (used to convert the scissor rectangle to OpenGL's coordinate system).
func (*GraphicsState) ScissorTest ¶
func (g *GraphicsState) ScissorTest(v bool)
func (*GraphicsState) StencilOpSeparate ¶
func (g *GraphicsState) StencilOpSeparate(front, back gfx.StencilState)
func (*GraphicsState) StencilTest ¶
func (g *GraphicsState) StencilTest(v bool)
Click to show internal directories.
Click to hide internal directories.