Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteShader(shader uint32)
- func NewProgram(vertexShader, geometryShader, fragmentShader uint32) (uint32, error)
- func NewShader(source string, shaderType uint32) (uint32, error)
- func NewTexture(file string, Target uint32) (uint32, error)
- func ShowGlLoop()
- type Camera
- type Shader
- type ShowGl
- type Vertex
Constants ¶
View Source
const ( // 纹理单元 TEXTURE = 0x1702 TEXTURE0 = 0x84C0 TEXTURE1 = 0x84C1 TEXTURE10 = 0x84CA TEXTURE11 = 0x84CB TEXTURE12 = 0x84CC TEXTURE13 = 0x84CD TEXTURE14 = 0x84CE TEXTURE15 = 0x84CF TEXTURE16 = 0x84D0 TEXTURE17 = 0x84D1 TEXTURE18 = 0x84D2 TEXTURE19 = 0x84D3 TEXTURE2 = 0x84C2 TEXTURE20 = 0x84D4 TEXTURE21 = 0x84D5 TEXTURE22 = 0x84D6 TEXTURE23 = 0x84D7 TEXTURE24 = 0x84D8 TEXTURE25 = 0x84D9 TEXTURE26 = 0x84DA TEXTURE27 = 0x84DB TEXTURE28 = 0x84DC TEXTURE29 = 0x84DD TEXTURE3 = 0x84C3 TEXTURE30 = 0x84DE TEXTURE31 = 0x84DF TEXTURE4 = 0x84C4 TEXTURE5 = 0x84C5 TEXTURE6 = 0x84C6 TEXTURE7 = 0x84C7 TEXTURE8 = 0x84C8 TEXTURE9 = 0x84C9 // 纹理类型 TEXTURE1D = 0x0DE0 TEXTURE1DARRAY = 0x8C18 TEXTURE2D = 0x0DE1 TEXTURE2DARRAY = 0x8C1A TEXTURE2DMULTISAMPLE = 0x9100 TEXTURE2DMULTISAMPLEARRAY = 0x9102 TEXTURE3D = 0x806F )
* 纹理变量
Variables ¶
View Source
var ShowGlList map[*glfw.Window]*ShowGl
ShowGlList 窗口列表
Functions ¶
func NewProgram ¶
NewProgram 编译着色器程序
func NewTexture ¶
NewTexture 创建材质 * file 材质文件名 * Target 纹理类型
Types ¶
type Camera ¶
type Camera struct { // 窗口 ShowGl *ShowGl // 坐标 Up mgl32.Vec3 Eye mgl32.Vec3 Center mgl32.Vec3 Projection mgl32.Mat4 }
Camera 相机类
type Shader ¶
type Shader struct { Vertex string // 顶点着色器 Geometry string // 几何着色器 Fragment string // 片面着色器 Program uint32 // 着色器 // 顶点组 QueueVertex []*Vertex // contains filtered or unexported fields }
Shader 着色器类
type ShowGl ¶
type ShowGl struct { QueueRender map[string]func() // 渲染队列 QueueShader []*Shader // 绑定的着色器 // 大小 Width int Height int AspectRatio float32 // 屏幕高宽比 // contains filtered or unexported fields }
ShowGl Gl显示类型
Click to show internal directories.
Click to hide internal directories.