resource

package
v0.0.0-...-6b7bc02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RT_MESH core.ResourceType = "mesh"
)
View Source
const (
	RT_SHADER core.ResourceType = "shader"
)
View Source
const (
	RT_TEXTURE core.ResourceType = "texture"
)

Variables

This section is empty.

Functions

func CreateMesh2dResource

func CreateMesh2dResource(uri string, verticesData []float32, indexData []uint32, drawingType uint32) (core.Resource, error)

func CreateMeshBuffers

func CreateMeshBuffers(verticesData []float32, indexData []uint32) (vao, vbo, ibo uint32)

func GetCircleBorderVertices

func GetCircleBorderVertices(segments uint) (vertices []float32, indices []uint32, drawingType uint32)

func GetCircleVertices

func GetCircleVertices(segments uint) (vertices []float32, indices []uint32, drawingType uint32)

func GetEmptyMesh

func GetEmptyMesh(uri string) core.Resource

func GetEmptyShader

func GetEmptyShader(uri string) core.Resource

func GetEmptyTexture

func GetEmptyTexture(uri string) core.Resource

func GetQuadBorderVertices

func GetQuadBorderVertices() ([]float32, []uint32, uint32)

func GetQuadVertices

func GetQuadVertices() ([]float32, []uint32, uint32)

Types

type EmbededShaderSource

type EmbededShaderSource struct {
	ShaderName string
}

type FileTextureLoader

type FileTextureLoader struct{}

func NewFileTextureLoader

func NewFileTextureLoader() FileTextureLoader

func (FileTextureLoader) CanLoad

func (l FileTextureLoader) CanLoad(resourceType core.ResourceType, uri string, param core.LoaderParam) bool

func (FileTextureLoader) Load

func (l FileTextureLoader) Load(uri string, param core.LoaderParam) (core.Resource, error)

type MeshData

type MeshData struct {
	VAO     uint32
	VBO     uint32
	IBO     uint32
	VCount  int32
	Drawing uint32
}

func CreateMesh2d

func CreateMesh2d(verticesData []float32, indexData []uint32, drawingType uint32) MeshData

func (MeshData) Unload

func (m MeshData) Unload()

type ProceduralMesh2dLoader

type ProceduralMesh2dLoader struct{}

func NewProceduralMesh2dLoader

func NewProceduralMesh2dLoader() ProceduralMesh2dLoader

func (ProceduralMesh2dLoader) CanLoad

func (l ProceduralMesh2dLoader) CanLoad(resourceType core.ResourceType, uri string, param core.LoaderParam) bool

func (ProceduralMesh2dLoader) Load

type ProceduralMeshType

type ProceduralMeshType string
const (
	PMT_QUAD          ProceduralMeshType = "pmt_2d_quad"
	PMT_QUAD_BORDER   ProceduralMeshType = "pmt_2d_quad_border"
	PMT_CIRCLE        ProceduralMeshType = "pmt_2d_circle"
	PMT_CIRCLE_BORDER ProceduralMeshType = "pmt_2d_circle_border"
)

type ShaderData

type ShaderData struct {
	ProgramId uint32
	// contains filtered or unexported fields
}

func (*ShaderData) GetUniformLocation

func (s *ShaderData) GetUniformLocation(name string) int32

func (*ShaderData) SetColor

func (s *ShaderData) SetColor(color core.Color)

func (*ShaderData) SetProjectionMat

func (s *ShaderData) SetProjectionMat(projection mgl32.Mat4)

func (*ShaderData) SetTransformationMat

func (s *ShaderData) SetTransformationMat(transformation mgl32.Mat4)

func (*ShaderData) SetViewMat

func (s *ShaderData) SetViewMat(view mgl32.Mat4)

type ShaderFileSource

type ShaderFileSource struct {
	VertexShaderPath   string
	FragmentShaderPath string
}

type ShaderLoader

type ShaderLoader struct{}

func NewShaderLoader

func NewShaderLoader() ShaderLoader

func (ShaderLoader) CanLoad

func (l ShaderLoader) CanLoad(resourceType core.ResourceType, uri string, param core.LoaderParam) bool

func (ShaderLoader) Load

func (l ShaderLoader) Load(uri string, param core.LoaderParam) (core.Resource, error)

type ShaderStringSource

type ShaderStringSource struct {
	VertexShader   string
	FragmentShader string
}

type TextureData

type TextureData struct {
	Id uint32
}

type TextureParams

type TextureParams struct {
	FilePath         string
	NearestFiltering bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL