Documentation
¶
Index ¶
- Constants
- func BindMesh(mesh *VertexObject)
- func BindTexture2D(slot TextureSlotId, id TextureBindingId)
- func BindTextureCubemap(slot TextureSlotId, id TextureBindingId)
- func BindVertexAttributes(mesh *VertexObject)
- func Clear(bufferBits ...uint32)
- func ClearColour(red float32, green float32, blue float32, alpha float32)
- func CreateVertexAttribute(mesh *VertexObject, bufferData []float32, stride int)
- func CreateVertexAttributeArrayBuffer(mesh *VertexObject, bufferData []float32, stride int)
- func DeleteMesh(mesh *VertexObject)
- func DeleteTextures(ids ...TextureBindingId)
- func DisableBlend()
- func DisableDepthTest()
- func DrawArray(offset int, length int)
- func DrawElements(count int, offset int, indices []uint32)
- func EnableBlend()
- func EnableCullFace(cullSide uint32, winding uint32)
- func EnableDepthTest()
- func FinishMesh()
- func SetElementArrayAttribute(mesh *VertexObject, bufferData []uint32)
- func SetLineWidth(width float32)
- func SetVertexDrawMode(drawMode uint32)
- type Context
- type ElementArrayObject
- type PixelFormat
- type ShaderType
- type TextureBindingId
- type TextureSlotId
- type VertexArrayObject
- type VertexBufferObject
- type VertexObject
Constants ¶
View Source
const BGR = PixelFormat(opengl.BGR)
View Source
const BGRA = PixelFormat(opengl.BGRA)
View Source
const Back = opengl.BACK
View Source
const DXT1 = PixelFormat(opengl.COMPRESSED_RGB_S3TC_DXT1_EXT)
View Source
const DXT1A = PixelFormat(opengl.COMPRESSED_RGBA_S3TC_DXT1_EXT)
View Source
const DXT3 = PixelFormat(opengl.COMPRESSED_RGBA_S3TC_DXT3_EXT)
View Source
const DXT5 = PixelFormat(opengl.COMPRESSED_RGBA_S3TC_DXT5_EXT)
View Source
const DepthTestLEqual = opengl.LEQUAL
View Source
const FragmentShader = ShaderType(opengl.FRAGMENT_SHADER)
View Source
const Front = opengl.FRONT
View Source
const FrontAndBack = opengl.FRONT_AND_BACK
View Source
const Line = uint32(opengl.LINE)
View Source
const MaskColourBufferBit = opengl.COLOR_BUFFER_BIT
View Source
const MaskDepthBufferBit = opengl.DEPTH_BUFFER_BIT
View Source
const RGB = PixelFormat(opengl.RGB)
View Source
const RGBA = PixelFormat(opengl.RGBA)
View Source
const Triangles = uint32(opengl.TRIANGLES)
View Source
const VertexShader = ShaderType(opengl.VERTEX_SHADER)
View Source
const WindingClockwise = opengl.CW
View Source
const WindingCounterClockwise = opengl.CCW
Variables ¶
This section is empty.
Functions ¶
func BindMesh ¶
func BindMesh(mesh *VertexObject)
func BindTexture2D ¶
func BindTexture2D(slot TextureSlotId, id TextureBindingId)
func BindTextureCubemap ¶
func BindTextureCubemap(slot TextureSlotId, id TextureBindingId)
func BindVertexAttributes ¶
func BindVertexAttributes(mesh *VertexObject)
func CreateVertexAttribute ¶
func CreateVertexAttribute(mesh *VertexObject, bufferData []float32, stride int)
CreateVertexAttribute creates a vertex array attribute
func CreateVertexAttributeArrayBuffer ¶
func CreateVertexAttributeArrayBuffer(mesh *VertexObject, bufferData []float32, stride int)
func DeleteMesh ¶
func DeleteMesh(mesh *VertexObject)
func DeleteTextures ¶
func DeleteTextures(ids ...TextureBindingId)
func DisableBlend ¶
func DisableBlend()
func DisableDepthTest ¶
func DisableDepthTest()
func DrawElements ¶ added in v0.2.0
func EnableBlend ¶
func EnableBlend()
func EnableCullFace ¶
func EnableDepthTest ¶
func EnableDepthTest()
func FinishMesh ¶
func FinishMesh()
func SetElementArrayAttribute ¶ added in v0.2.0
func SetElementArrayAttribute(mesh *VertexObject, bufferData []uint32)
func SetLineWidth ¶
func SetLineWidth(width float32)
func SetVertexDrawMode ¶
func SetVertexDrawMode(drawMode uint32)
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) AddShader ¶
func (ctx *Context) AddShader(source string, shaderType ShaderType) error
func (*Context) GetUniform ¶
func (*Context) UseProgram ¶
func (ctx *Context) UseProgram()
type ElementArrayObject ¶ added in v0.2.0
type ElementArrayObject uint32
type PixelFormat ¶
type PixelFormat uint32
type ShaderType ¶
type ShaderType uint32
type TextureBindingId ¶
type TextureBindingId uint32
func CreateTexture2D ¶
func CreateTexture2D(slot TextureSlotId, width int, height int, pixelData []byte, pixelFormat PixelFormat, clampToEdge bool) TextureBindingId
func CreateTextureCubemap ¶
func CreateTextureCubemap(slot TextureSlotId, width int, height int, pixelData [6][]byte, pixelFormat PixelFormat, clampToEdge bool) TextureBindingId
type TextureSlotId ¶
type TextureSlotId uint32
func TextureSlot ¶
func TextureSlot(index int) TextureSlotId
type VertexArrayObject ¶
type VertexArrayObject uint32
type VertexBufferObject ¶
type VertexBufferObject uint32
type VertexObject ¶
type VertexObject struct {
Id VertexBufferObject
AttribId [32]VertexArrayObject
// contains filtered or unexported fields
}
func NewMesh ¶
func NewMesh(vertices []float32) (mesh *VertexObject)
Click to show internal directories.
Click to hide internal directories.