Documentation
¶
Index ¶
- Constants
- func BindFramebuffer(fType, index uint32)
- func BlendFunc(sFact, dFact uint32)
- func Clear(mask uint32)
- func ClearColor(r, g, b, a float32)
- func DepthFunc(v uint32)
- func Enable(v uint32)
- func NewCube(p VertParams) (uint32, []int32, []float32)
- func NewSphere(p VertParams) (uint32, []int32, []float32)
- type Cubemap
- type Framebuffer
- type OrbitalCamera
- type Shader
- func (s *Shader) SetBool(name string, value bool) *Shader
- func (s *Shader) SetFloat(name string, value float32) *Shader
- func (s *Shader) SetInt(name string, value int32) *Shader
- func (s *Shader) SetMat4(name string, value mgl.Mat4) *Shader
- func (s *Shader) SetVec2(name string, value mgl.Vec2) *Shader
- func (s *Shader) SetVec3(name string, value mgl.Vec3) *Shader
- func (s *Shader) Use() *Shader
- type Texture
- type VAO
- type VertParams
- type Window
Constants ¶
View Source
const ( FRAMEBUFFER = 0x8D40 RENDERBUFFER = 0x8D41 DEPTH_COMPONENT16 = 0x81A5 //DEPTH24_STENCIL8 = 0x88F0 WEBGL2.0only DEPTH_ATTACHMENT = 0x8D00 //DEPTH_STENCIL_ATTACHMENT = 0x821A COLOR_ATTACHMENT0 = 0x8CE0 )
View Source
const ( COMPILE_STATUS = 0x8B81 VERTEX_SHADER = 0x8B31 FRAGMENT_SHADER = 0x8B30 )
View Source
const ( TEXTURE0 = 0x84C0 TEXTURE1 = 0x84C1 TEXTURE2 = 0x84C2 TEXTURE3 = 0x84C3 TEXTURE4 = 0x84C4 TEXTURE5 = 0x84C5 TEXTURE6 = 0x84C6 TEXTURE7 = 0x84C7 RGB = 0x1907 RGBA = 0x1908 UNSIGNED_BYTE = 0x1401 REPEAT = 0x2901 CLAMP_TO_EDGE = 0x812F MIRRORED_REPEAT = 0x8370 NEAREST = 0x2600 LINEAR = 0x2601 TEXTURE_2D = 0x0DE1 TEXTURE_MAG_FILTER = 0x2800 TEXTURE_MIN_FILTER = 0x2801 TEXTURE_WRAP_S = 0x2802 TEXTURE_WRAP_T = 0x2803 TEXTURE_WRAP_R = 0x8072 )
View Source
const ( TEXTURE_CUBE_MAP = 0x8513 TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515 )
View Source
const ( ARRAY_BUFFER = 0x8892 STATIC_DRAW = 0x88E4 POINTS = 0x0000 LINES = 0x0001 LINE_LOOP = 0x0002 LINE_STRIP = 0x0003 TRIANGLES = 0x0004 TRIANGLE_STRIP = 0x0005 TRIANGLE_FAN = 0x0006 FLOAT = 0x1406 )
View Source
const ( DEPTH_BUFFER_BIT = 0x00000100 STENCIL_BUFFER_BIT = 0x00000400 COLOR_BUFFER_BIT = 0x00004000 )
View Source
const ( DEPTH_TEST = 0x0B71 LEQUAL = 0x0203 LESS = 0x0201 BLEND = 0x0BE2 ONE_MINUS_SRC_ALPHA = 0x0303 ONE_MINUS_CONSTANT_COLOR = 0x8002 ONE_MINUS_DST_ALPHA = 0x0305 ONE_MINUS_DST_COLOR = 0x0307 ONE_MINUS_SRC_COLOR = 0x0301 SRC_ALPHA = 0x0302 )
Variables ¶
This section is empty.
Functions ¶
func BindFramebuffer ¶
func BindFramebuffer(fType, index uint32)
This function is broken... since webgl requires the framebuffer to be an object rather than an index. We can cheat it for now.
func ClearColor ¶
func ClearColor(r, g, b, a float32)
Types ¶
type Cubemap ¶
type Framebuffer ¶
type Framebuffer struct {
// contains filtered or unexported fields
}
Perhaps it makes sense to have texture textureColorbuffer as a texture. I don't understand framebuffers and usage as much as I would like to So ideally I want to revisit this for when usage needs more customization.
func NewFramebuffer ¶
func NewFramebuffer(width, height int32) *Framebuffer
func (*Framebuffer) Bind ¶
func (f *Framebuffer) Bind()
func (*Framebuffer) BindTexture ¶
func (f *Framebuffer) BindTexture(v uint32)
type OrbitalCamera ¶
type OrbitalCamera struct {
Position mgl.Vec3
ScaleFactor float32
Sensativity float32
// contains filtered or unexported fields
}
func NewOrbitalCamera ¶
func NewOrbitalCamera(w *Window, radius float32, center mgl.Vec3) *OrbitalCamera
func (*OrbitalCamera) LookAt ¶
func (c *OrbitalCamera) LookAt() mgl.Mat4
type Texture ¶
type Texture struct {
Width int32
Height int32
InternalFormat int32
ImageFormat uint32
WrapS int32
WrapT int32
FilterMin int32
FilterMax int32
// contains filtered or unexported fields
}
func NewTexture ¶
func NewTexture() *Texture
func TextureFromFile ¶
type VertParams ¶
type VertParams common.VertParams
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
func (*Window) PollEvents ¶
func (w *Window) PollEvents()
func (*Window) SwapBuffers ¶
func (w *Window) SwapBuffers()
Click to show internal directories.
Click to hide internal directories.