Documentation
¶
Index ¶
- Variables
- type BlendMode
- type Color
- type CullMode
- type DepthTestMode
- type GraphicsAPI
- type Material
- type Mesh
- type MeshID
- type RenderCommand
- type RenderState
- type ShaderID
- type SpriteVertex
- type Texture
- type TextureConfig
- type TextureFilter
- type TextureID
- type TextureWrap
- type Vertex
- type VertexAttribute
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ColorWhite = Color{1, 1, 1, 1} ColorBlack = Color{0, 0, 0, 1} ColorRed = Color{1, 0, 0, 1} ColorGreen = Color{0, 1, 0, 1} ColorBlue = Color{0, 0, 1, 1} ColorYellow = Color{1, 1, 0, 1} ColorCyan = Color{0, 1, 1, 1} ColorMagenta = Color{1, 0, 1, 1} ColorTransparent = Color{0, 0, 0, 0} )
Предопределенные цвета
Functions ¶
This section is empty.
Types ¶
type DepthTestMode ¶
type DepthTestMode int
DepthTestMode режим теста глубины
const ( DepthTestNone DepthTestMode = iota DepthTestLess DepthTestLessOrEqual DepthTestGreater DepthTestGreaterOrEqual DepthTestEqual DepthTestNotEqual DepthTestAlways )
type GraphicsAPI ¶
type GraphicsAPI interface {
// Initialize инициализирует графический API
Initialize() error
// Shutdown завершает работу с графическим API
Shutdown()
// Clear очищает экран
Clear(r, g, b, a float32)
// SetViewport устанавливает область отрисовки
SetViewport(x, y, width, height int)
// Present отображает кадр
Present()
}
GraphicsAPI интерфейс для абстракции графического API
type Material ¶
type Material struct {
DiffuseTexture TextureID
SpecularTexture TextureID
NormalTexture TextureID
Shininess float32
Color mgl32.Vec4
}
Material описывает материал для рендеринга
type RenderCommand ¶
type RenderCommand struct {
Mesh MeshID
Shader ShaderID
Texture TextureID
Transform mgl32.Mat4
Material *Material
}
RenderCommand команда рендеринга
type RenderState ¶
type RenderState struct {
BlendMode BlendMode
CullMode CullMode
DepthTest DepthTestMode
DepthWrite bool
Wireframe bool
ScissorTest bool
ScissorX int
ScissorY int
ScissorWidth int
ScissorHeight int
}
RenderState состояние рендеринга
func DefaultRenderState ¶
func DefaultRenderState() RenderState
DefaultRenderState возвращает состояние рендеринга по умолчанию
type SpriteVertex ¶
SpriteVertex вершина спрайта для батчинга
type Texture ¶
Texture представляет OpenGL текстуру
func LoadTexture ¶
LoadTexture загружает текстуру из файла
type TextureConfig ¶
type TextureConfig struct {
MinFilter TextureFilter
MagFilter TextureFilter
WrapS TextureWrap
WrapT TextureWrap
GenerateMipmaps bool
}
TextureConfig конфигурация текстуры
func DefaultTextureConfig ¶
func DefaultTextureConfig() TextureConfig
DefaultTextureConfig возвращает конфигурацию текстуры по умолчанию
type TextureFilter ¶
type TextureFilter int
TextureFilter режим фильтрации текстур
const ( TextureFilterNearest TextureFilter = iota TextureFilterLinear TextureFilterMipmap )
type TextureWrap ¶
type TextureWrap int
TextureWrap режим повторения текстур
const ( TextureWrapRepeat TextureWrap = iota TextureWrapClampToEdge TextureWrapMirroredRepeat )
Click to show internal directories.
Click to hide internal directories.