Documentation ¶
Index ¶
- func CompileShader(source string, shaderType uint32) (uint32, error)
- func InitGlfw(width, height int, name string) *glfw.Window
- func InitGlfw2(width, height int, name string) *glfw.Window
- func InitOpenGL(vertexShaderSource, fragmentShaderSource string) (program uint32, err error)
- func MakeProgram(vertexShaderSource, fragmentShaderSource string) (program uint32, err error)
- func MakeTexture(filepath string) uint32
- func MakeTextureByImage(img image.Image) uint32
- func MakeTextureCube(filepathArray []string) uint32
- func MakeVao(points []float32) uint32
- func MakeVaoWithAttrib(program uint32, points []float32, indexs []uint32, ...) uint32
- type Camera
- type VertAttrib
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitOpenGL ¶
func MakeProgram ¶
func MakeTexture ¶
func MakeTextureByImage ¶
func MakeTextureCube ¶
func MakeVaoWithAttrib ¶
func MakeVaoWithAttrib(program uint32, points []float32, indexs []uint32, vertAttribSlice []VertAttrib) uint32
Types ¶
type Camera ¶
type Camera struct { CameraPos mgl32.Vec3 CameraFront mgl32.Vec3 CameraUp mgl32.Vec3 Fov float64 WindowWidth int WindowHeight int }
func NewCamera ¶
func NewCamera(cameraPos mgl32.Vec3, cameraFront mgl32.Vec3, cameraUp mgl32.Vec3, windowWidth int, windowHeight int) *Camera
cameraFront 为相机的朝向. cameraPos 为相机的位置. windowWidth 窗口宽度. windowHeight 窗口高度.
func (*Camera) LookAtAndPerspective ¶
func (*Camera) Perspective ¶
func (*Camera) SetCursorPosCallback ¶
type VertAttrib ¶
Click to show internal directories.
Click to hide internal directories.