示例#1
0
// LoadTextureImage2D uploads the image specified by the parameter img to
// OpenGL texture memory (using the glTexImage2D function).
//
// Note: If the glfw.BuildMipmapsBit flag is set, all mipmap levels for the
// loaded texture are generated and uploaded to texture memory.
//
// Note: The read image is always rescaled to the nearest larger power of
// two resolution using bilinear interpolation.
//
// Note: Unless the glfw.OriginUlBit flag is set, the first pixel in img.Data
// is the lower left corner of the image. Otherwise the first pixel is the upper
// left corner.
//
// Note: For single component images (i.e. gray scale), Format is set to
// GL_ALPHA if the glfw.AlphaMapBit flag is set, otherwise Format is set to GL_LUMINANCE.
//
// Note: ReadImage supports the Truevision Targa version 1 file format
// (.TGA). Supported pixel formats are: 8-bit gray scale, 8-bit paletted
// (24/32-bit color), 24-bit true color and 32-bit true color + alpha.
func (i *Image) LoadTextureImage2D(flags int) bool {
	return int(C.glfwLoadTextureImage2D(&i.img, C.int(flags))) == 1
}
示例#2
0
文件: image.go 项目: skelterjohn/glfw
func (this *Image) LoadTextureImage2D(flags int) int {
	return int(C.glfwLoadTextureImage2D(this.ptr, C.int(flags)))
}