Documentation ¶
Index ¶
- func RenderCommandClear()
- func RenderCommandDrawIndexed(vertexArray VertexArray, indexCount uint32)
- func RenderCommandInit()
- func RenderCommandSetClearColor(color *glm.Vec4)
- func RenderCommandSetViewport(x, y, width, height uint32)
- func Renderer2DBeginScene(camera *OrthographicCamera)
- func Renderer2DDrawQuad(quad *Quad2D)
- func Renderer2DEndScene()
- func Renderer2DInit()
- func Renderer2DResetStats()
- func Renderer2DShutdown()
- func RendererBeginScene(camera *OrthographicCamera)
- func RendererEndScene()
- func RendererInit()
- func RendererOnWindowResize(width, height uint32)
- func RendererSubmit(shader Shader, vertexArray VertexArray, transform *glm.Mat4)
- func ShaderDataTypeSize(dataType ShaderDataType) uint32
- func ShaderDataTypeToOpenGLType(dataType ShaderDataType) uint32
- type API
- type BufferElement
- type BufferLayout
- type GraphicsContext
- type IndexBuffer
- type OpenGLContext
- type OpenGLShader
- func (shader *OpenGLShader) Bind()
- func (shader *OpenGLShader) Delete()
- func (shader *OpenGLShader) GetName() string
- func (shader *OpenGLShader) Unbind()
- func (shader *OpenGLShader) UploadUniformFloat(name string, value float32)
- func (shader *OpenGLShader) UploadUniformFloat2(name string, value *glm.Vec2)
- func (shader *OpenGLShader) UploadUniformFloat3(name string, value *glm.Vec3)
- func (shader *OpenGLShader) UploadUniformFloat4(name string, value *glm.Vec4)
- func (shader *OpenGLShader) UploadUniformInt(name string, value int32)
- func (shader *OpenGLShader) UploadUniformIntArray(name string, values []int32)
- func (shader *OpenGLShader) UploadUniformMat2(name string, matrix *glm.Mat2)
- func (shader *OpenGLShader) UploadUniformMat3(name string, matrix *glm.Mat3)
- func (shader *OpenGLShader) UploadUniformMat4(name string, matrix *glm.Mat4)
- type OrthographicCamera
- func (camera *OrthographicCamera) GetPosition() *glm.Vec3
- func (camera *OrthographicCamera) GetProjectionMatrix() *glm.Mat4
- func (camera *OrthographicCamera) GetRotation() float32
- func (camera *OrthographicCamera) GetViewMatrix() *glm.Mat4
- func (camera *OrthographicCamera) GetViewProjectionMatrix() *glm.Mat4
- func (camera *OrthographicCamera) SetPosition(position *glm.Vec3)
- func (camera *OrthographicCamera) SetProjection(left, right, bottom, top float32)
- func (camera *OrthographicCamera) SetRotation(rotation float32)
- type Quad2D
- type RendererAPI
- type Shader
- type ShaderDataType
- type ShaderLibrary
- type Statistics
- type Texture
- type VertexArray
- type VertexBuffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderCommandClear ¶
func RenderCommandClear()
func RenderCommandDrawIndexed ¶
func RenderCommandDrawIndexed(vertexArray VertexArray, indexCount uint32)
func RenderCommandInit ¶
func RenderCommandInit()
func RenderCommandSetViewport ¶
func RenderCommandSetViewport(x, y, width, height uint32)
func Renderer2DBeginScene ¶
func Renderer2DBeginScene(camera *OrthographicCamera)
func Renderer2DDrawQuad ¶
func Renderer2DDrawQuad(quad *Quad2D)
func Renderer2DEndScene ¶
func Renderer2DEndScene()
func Renderer2DInit ¶
func Renderer2DInit()
func Renderer2DResetStats ¶
func Renderer2DResetStats()
func Renderer2DShutdown ¶
func Renderer2DShutdown()
func RendererBeginScene ¶
func RendererBeginScene(camera *OrthographicCamera)
func RendererEndScene ¶
func RendererEndScene()
func RendererInit ¶
func RendererInit()
func RendererOnWindowResize ¶
func RendererOnWindowResize(width, height uint32)
func RendererSubmit ¶
func RendererSubmit(shader Shader, vertexArray VertexArray, transform *glm.Mat4)
func ShaderDataTypeSize ¶
func ShaderDataTypeSize(dataType ShaderDataType) uint32
func ShaderDataTypeToOpenGLType ¶
func ShaderDataTypeToOpenGLType(dataType ShaderDataType) uint32
Types ¶
type BufferElement ¶
type BufferElement struct { DataType ShaderDataType Name string Normalized bool Offset uint32 Size uint32 }
func NewBufferElement ¶
func NewBufferElement(dataType ShaderDataType, name string, normalized bool) *BufferElement
func (*BufferElement) GetComponentCount ¶
func (element *BufferElement) GetComponentCount() uint32
type BufferLayout ¶
type BufferLayout struct {
// contains filtered or unexported fields
}
func NewBufferLayout ¶
func NewBufferLayout(elements []*BufferElement) *BufferLayout
func (*BufferLayout) GetElements ¶
func (layout *BufferLayout) GetElements() *[]*BufferElement
func (*BufferLayout) GetStride ¶
func (layout *BufferLayout) GetStride() uint32
type GraphicsContext ¶
type GraphicsContext interface { Init() SwapBuffers() }
type IndexBuffer ¶
type IndexBuffer interface { Delete() Bind() Unbind() GetCount() (count uint32) }
func NewIndexBuffer ¶
func NewIndexBuffer(indices []uint32) IndexBuffer
type OpenGLContext ¶
type OpenGLContext struct {
// contains filtered or unexported fields
}
func NewOpenGLContext ¶
func NewOpenGLContext(window *glfw.Window) *OpenGLContext
func (*OpenGLContext) Init ¶
func (context *OpenGLContext) Init()
func (*OpenGLContext) SwapBuffers ¶
func (context *OpenGLContext) SwapBuffers()
type OpenGLShader ¶
type OpenGLShader struct {
// contains filtered or unexported fields
}
should become private
func (*OpenGLShader) Bind ¶
func (shader *OpenGLShader) Bind()
func (*OpenGLShader) Delete ¶
func (shader *OpenGLShader) Delete()
func (*OpenGLShader) GetName ¶
func (shader *OpenGLShader) GetName() string
func (*OpenGLShader) Unbind ¶
func (shader *OpenGLShader) Unbind()
func (*OpenGLShader) UploadUniformFloat ¶
func (shader *OpenGLShader) UploadUniformFloat(name string, value float32)
func (*OpenGLShader) UploadUniformFloat2 ¶
func (shader *OpenGLShader) UploadUniformFloat2(name string, value *glm.Vec2)
func (*OpenGLShader) UploadUniformFloat3 ¶
func (shader *OpenGLShader) UploadUniformFloat3(name string, value *glm.Vec3)
func (*OpenGLShader) UploadUniformFloat4 ¶
func (shader *OpenGLShader) UploadUniformFloat4(name string, value *glm.Vec4)
func (*OpenGLShader) UploadUniformInt ¶
func (shader *OpenGLShader) UploadUniformInt(name string, value int32)
func (*OpenGLShader) UploadUniformIntArray ¶
func (shader *OpenGLShader) UploadUniformIntArray(name string, values []int32)
func (*OpenGLShader) UploadUniformMat2 ¶
func (shader *OpenGLShader) UploadUniformMat2(name string, matrix *glm.Mat2)
func (*OpenGLShader) UploadUniformMat3 ¶
func (shader *OpenGLShader) UploadUniformMat3(name string, matrix *glm.Mat3)
func (*OpenGLShader) UploadUniformMat4 ¶
func (shader *OpenGLShader) UploadUniformMat4(name string, matrix *glm.Mat4)
type OrthographicCamera ¶
type OrthographicCamera struct {
// contains filtered or unexported fields
}
func NewOrthographicCamera ¶
func NewOrthographicCamera(left, right, bottom, top float32) *OrthographicCamera
func (*OrthographicCamera) GetPosition ¶
func (camera *OrthographicCamera) GetPosition() *glm.Vec3
func (*OrthographicCamera) GetProjectionMatrix ¶
func (camera *OrthographicCamera) GetProjectionMatrix() *glm.Mat4
func (*OrthographicCamera) GetRotation ¶
func (camera *OrthographicCamera) GetRotation() float32
func (*OrthographicCamera) GetViewMatrix ¶
func (camera *OrthographicCamera) GetViewMatrix() *glm.Mat4
func (*OrthographicCamera) GetViewProjectionMatrix ¶
func (camera *OrthographicCamera) GetViewProjectionMatrix() *glm.Mat4
func (*OrthographicCamera) SetPosition ¶
func (camera *OrthographicCamera) SetPosition(position *glm.Vec3)
func (*OrthographicCamera) SetProjection ¶
func (camera *OrthographicCamera) SetProjection(left, right, bottom, top float32)
func (*OrthographicCamera) SetRotation ¶
func (camera *OrthographicCamera) SetRotation(rotation float32)
type Quad2D ¶
type RendererAPI ¶
type RendererAPI interface { Init() SetClearColor(color *glm.Vec4) Clear() DrawIndexed(vertexArray VertexArray, indexCount uint32) SetViewport(x uint32, y uint32, width uint32, height uint32) }
func NewRendererAPI ¶
func NewRendererAPI() RendererAPI
type Shader ¶
type Shader interface { Delete() Bind() Unbind() GetName() (name string) }
func NewShaderFromPath ¶
func NewShaderFromSrc ¶
type ShaderDataType ¶
type ShaderDataType int
const ( ShaderDataTypeNone ShaderDataType = 0 ShaderDataTypeFloat ShaderDataType = 1 ShaderDataTypeFloat2 ShaderDataType = 2 ShaderDataTypeFloat3 ShaderDataType = 3 ShaderDataTypeFloat4 ShaderDataType = 4 ShaderDataTypeMat3 ShaderDataType = 5 ShaderDataTypeMat4 ShaderDataType = 6 ShaderDataTypeInt ShaderDataType = 7 ShaderDataTypeInt2 ShaderDataType = 8 ShaderDataTypeInt3 ShaderDataType = 9 ShaderDataTypeInt4 ShaderDataType = 10 ShaderDataTypeBool ShaderDataType = 11 )
type ShaderLibrary ¶
type ShaderLibrary struct {
// contains filtered or unexported fields
}
func NewShaderLibrary ¶
func NewShaderLibrary() *ShaderLibrary
func (*ShaderLibrary) Add ¶
func (library *ShaderLibrary) Add(shader Shader)
func (*ShaderLibrary) Get ¶
func (library *ShaderLibrary) Get(name string) Shader
func (*ShaderLibrary) LoadFromPath ¶
func (library *ShaderLibrary) LoadFromPath(path string) Shader
type Statistics ¶
func Renderer2DStats ¶
func Renderer2DStats() Statistics
func (Statistics) GetTotalIndexCount ¶
func (stats Statistics) GetTotalIndexCount() uint32
func (Statistics) GetTotalVertexCount ¶
func (stats Statistics) GetTotalVertexCount() uint32
type Texture ¶
type Texture interface { Delete() GetWidth() (width uint32) GetHeight() (height uint32) SetData(data unsafe.Pointer) Bind(slot uint32) }
func NewTexture2DEmpty ¶
func NewTexture2DFromPath ¶
type VertexArray ¶
type VertexArray interface { Delete() Bind() Unbind() AddVertexBuffer(vertexBuffer VertexBuffer) SetIndexBuffer(indexBuffer IndexBuffer) GetVertexBuffers() (vertexBuffers []VertexBuffer) GetIndexBuffer() (indexBuffer IndexBuffer) }
func NewVertexArray ¶
func NewVertexArray() VertexArray
type VertexBuffer ¶
type VertexBuffer interface { Delete() Bind() Unbind() SetLayout(layout *BufferLayout) GetLayout() (layout *BufferLayout) SetData(data interface{}, size uint32) }
func NewEmptyVertexBuffer ¶
func NewEmptyVertexBuffer(size uint32) VertexBuffer
func NewVertexBuffer ¶
func NewVertexBuffer(vertices []float32) VertexBuffer
Click to show internal directories.
Click to hide internal directories.