本文整理匯總了Golang中github.com/banthar/gl.Hint函數的典型用法代碼示例。如果您正苦於以下問題:Golang Hint函數的具體用法?Golang Hint怎麽用?Golang Hint使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Hint函數的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: initGL
func initGL() {
gl.ShadeModel(gl.SMOOTH)
gl.ClearColor(0, 0, 0, 0)
gl.ClearDepth(1)
gl.Enable(gl.DEPTH_TEST)
gl.DepthFunc(gl.LEQUAL)
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
}
示例2: initGL
func initGL() {
gl.EnableClientState(gl.VERTEX_ARRAY)
gl.ShadeModel(gl.SMOOTH)
gl.ClearColor(0, 0, 0, 0)
gl.ClearDepth(1)
gl.DepthFunc(gl.LEQUAL)
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
gl.Enable(gl.DEPTH_TEST)
gl.Enable(gl.BLEND)
gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
}
示例3: initGL
// general OpenGL initialization
func initGL() {
LoadGLTexture("data/star.bmp")
gl.Enable(gl.TEXTURE_2D)
gl.Enable(gl.BLEND)
gl.BlendFunc(gl.SRC_ALPHA, gl.ONE)
gl.ShadeModel(gl.SMOOTH)
gl.ClearColor(0.0, 0.0, 0.0, 0.5)
gl.ClearDepth(1.0)
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
}
示例4: initGL
func initGL() (err error) {
if err = loadTextures(); err != nil {
return
}
gl.ShadeModel(gl.SMOOTH)
gl.ClearColor(0, 0, 0, 0)
gl.ClearDepth(1)
gl.DepthFunc(gl.LEQUAL)
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
gl.Enable(gl.DEPTH_TEST)
gl.Enable(gl.TEXTURE_2D)
return
}
示例5: Perspective
func (self *Viewport) Perspective(fovy, aspect, zNear, zFar float64) {
gl.MatrixMode(gl.PROJECTION)
gl.LoadIdentity()
var xmin, xmax, ymin, ymax float64
ymax = zNear * math.Tan(fovy*math.Pi/360.0)
ymin = -ymax
xmin = ymin * aspect
xmax = ymax * aspect
gl.Frustum(xmin, xmax, ymin, ymax, zNear, zFar)
gl.MatrixMode(gl.MODELVIEW)
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
gl.DepthMask(true)
}
示例6: initGL
// general OpenGL initialization
func initGL() {
gl.Enable(gl.TEXTURE_2D)
gl.ShadeModel(gl.SMOOTH)
gl.ClearColor(0.0, 0.0, 0.0, 0.5)
gl.ClearDepth(1.0)
gl.Enable(gl.DEPTH_TEST)
gl.DepthFunc(gl.LEQUAL)
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
// Setup the light
gl.Lightfv(gl.LIGHT1, gl.AMBIENT, lightAmbient[:]) // ambient lighting
gl.Lightfv(gl.LIGHT1, gl.DIFFUSE, lightDiffuse[:]) // make it diffuse
gl.Lightfv(gl.LIGHT1, gl.POSITION, lightPosition[:]) // and place it
gl.Enable(gl.LIGHT1) // and finally turn it on.
gl.Color4f(1.0, 1.0, 1.0, 0.5) // Full Brightness, 50% Alpha ( NEW )
gl.BlendFunc(gl.SRC_ALPHA, gl.ONE) // Blending Function For Translucency Based On Source Alpha Value ( NEW )
}
示例7: initGL
// general OpenGL initialization
func initGL() {
// enable smooth shading
gl.ShadeModel(gl.SMOOTH)
// Set the background to black
gl.ClearColor(0.0, 0.0, 0.0, 0.0)
// Depth buffer setup
gl.ClearDepth(1.0)
// Enable depth testing
gl.Enable(gl.DEPTH_TEST)
// The type of test
gl.DepthFunc(gl.LEQUAL)
// Nicest perspective correction
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
}
示例8: initGL
// general OpenGL initialization
func initGL() {
LoadGLTextures("data/mud.bmp")
gl.Enable(gl.TEXTURE_2D)
gl.ShadeModel(gl.SMOOTH)
gl.ClearColor(0.0, 0.0, 0.0, 0.0)
gl.ClearDepth(1.0)
gl.Enable(gl.DEPTH_TEST)
gl.DepthFunc(gl.LEQUAL)
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
gl.Lightfv(gl.LIGHT1, gl.AMBIENT, lightAmbient[:])
gl.Lightfv(gl.LIGHT1, gl.DIFFUSE, lightDiffuse[:])
gl.Lightfv(gl.LIGHT1, gl.POSITION, lightPosition[:])
gl.Enable(gl.LIGHT1)
gl.Color4f(1.0, 1.0, 1.0, 0.5)
gl.BlendFunc(gl.SRC_ALPHA, gl.ONE)
}
示例9: initGL
// general OpenGL initialization
func initGL() {
gl.Enable(gl.TEXTURE_2D)
gl.ShadeModel(gl.SMOOTH)
gl.ClearColor(0.0, 0.0, 0.0, 0.5)
gl.ClearDepth(1.0)
gl.Enable(gl.DEPTH_TEST)
gl.DepthFunc(gl.LEQUAL)
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
// Setup the light
gl.Lightfv(gl.LIGHT1, gl.AMBIENT, lightAmbient1[:]) // ambient lighting
gl.Lightfv(gl.LIGHT1, gl.DIFFUSE, lightDiffuse1[:]) // make it diffuse
gl.Lightfv(gl.LIGHT1, gl.POSITION, lightPosition1[:]) // and place it
gl.Enable(gl.LIGHT1) // and finally turn it on.
gl.Lightfv(gl.LIGHT2, gl.AMBIENT, lightAmbient2[:]) // ambient lighting
gl.Lightfv(gl.LIGHT2, gl.DIFFUSE, lightDiffuse2[:]) // make it diffuse
gl.Lightfv(gl.LIGHT2, gl.POSITION, lightPosition2[:]) // and place it
gl.Enable(gl.LIGHT2) // and finally turn it on.
}
示例10: initGL
func initGL() {
gl.ShadeModel(gl.SMOOTH)
gl.ClearColor(0, 0, 0, 0)
gl.ClearDepth(1)
gl.Enable(gl.DEPTH_TEST)
gl.DepthFunc(gl.LEQUAL)
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.NICEST)
globalState.light[0] = 0
globalState.light[1] = 20
globalState.light[2] = -10
globalState.light[3] = 1
gl.Lightfv(gl.LIGHT1, gl.AMBIENT, []float32{1, 1, 1})
gl.Lightfv(gl.LIGHT1, gl.DIFFUSE, []float32{1, 1, 1})
gl.Lightfv(gl.LIGHT1, gl.POSITION, globalState.light[:])
gl.Enable(gl.LIGHT1)
gl.Enable(gl.LIGHTING)
}
示例11: initGame
func initGame() {
viewport.Zoomstd()
viewport.Rotx(25)
viewport.Roty(70)
picker = NewPicker()
sdl.Init(sdl.INIT_VIDEO)
if ttf.Init() != 0 {
panic("Could not initalize fonts")
}
sdl.GL_SetAttribute(sdl.GL_DOUBLEBUFFER, 1)
screen := sdl.SetVideoMode(1024, 600, 32, sdl.OPENGL|sdl.RESIZABLE)
if screen == nil {
sdl.Quit()
panic("Couldn't set GL video mode: " + sdl.GetError() + "\n")
}
if gl.Init() != 0 {
panic("gl error")
}
sdl.WM_SetCaption("Amberfell", "amberfell")
gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)
// gl.ShadeModel(gl.FLAT)
gl.Enable(gl.BLEND)
gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
gl.ShadeModel(gl.SMOOTH)
gl.Enable(gl.LIGHTING)
gl.Enable(gl.LIGHT0)
gl.Enable(gl.LIGHT1)
gl.Enable(gl.COLOR_MATERIAL)
gl.MatrixMode(gl.PROJECTION)
gl.LoadIdentity()
gl.MatrixMode(gl.MODELVIEW)
gl.LoadIdentity()
gl.ClearDepth(1.0) // Depth Buffer Setup
gl.Enable(gl.DEPTH_TEST) // Enables Depth Testing
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.FASTEST)
gl.Enable(gl.TEXTURE_2D)
// LoadMapTextures()
LoadPlayerTextures()
LoadWolfTextures()
InitItems()
pauseFont = NewFont("res/Jura-DemiBold.ttf", 48, color.RGBA{255, 255, 255, 0})
consoleFont = NewFont("res/Jura-DemiBold.ttf", 16, color.RGBA{255, 255, 255, 0})
inventoryItemFont = NewFont("res/Jura-DemiBold.ttf", 14, color.RGBA{240, 240, 240, 0})
textures[TEXTURE_PICKER] = loadTexture("res/dial.png")
terrainTexture = loadTexture("res/tiles.png")
itemsTexture = loadTexture("res/items.png")
gVertexBuffer = NewVertexBuffer(10000, terrainTexture)
gGuiBuffer = NewVertexBuffer(1000, terrainTexture)
WolfModel = LoadModel("res/wolf.mm3d")
TheWorld = NewWorld()
ThePlayer = new(Player)
ThePlayer.Init(0, PLAYER_START_X, PLAYER_START_Z)
inventory = NewInventory()
viewport.Reshape(int(screen.W), int(screen.H))
PreloadChunks(400)
}