Ejemplo n.º 1
0
/*
 * Return the color buffer associated with an OSMesa context.
 * Input:  c - the OSMesa context
 * Output:  width, height - size of buffer in pixels
 *          format - buffer format (OSMESA_FORMAT)
 *          buffer - pointer to depth buffer values
 * Return:  GL_TRUE or GL_FALSE to indicate success or failure.
 *
 * New in Mesa 3.3.
 */
func GetColorBuffer(c Context, width *int, height *int,
	format *Format, buffer *unsafe.Pointer) {

	var width_ C.GLint
	var height_ C.GLint
	var format_ C.GLint
	var buffer_ unsafe.Pointer

	C.OSMesaGetDepthBuffer(C.OSMesaContext(c), &width_, &height_,
		&format_, &buffer_)

	*width = int(width_)
	*height = int(height_)
	*format = Format(format_)
	*buffer = buffer_

}
Ejemplo n.º 2
0
/*
 * Return the depth buffer associated with an OSMesa context.
 * Input:  c - the OSMesa context
 * Output:  width, height - size of buffer in pixels
 *          bytesPerValue - bytes per depth value (2 or 4)
 *          buffer - pointer to depth buffer values
 * Return:  GL_TRUE or GL_FALSE to indicate success or failure.
 *
 * New in Mesa 2.4.
 */
func GetDepthBuffer(c Context, width *int, height *int,
	bytesPerValue *int, buffer *unsafe.Pointer) {

	var width_ C.GLint
	var height_ C.GLint
	var bytesPerValue_ C.GLint
	var buffer_ unsafe.Pointer

	C.OSMesaGetDepthBuffer(C.OSMesaContext(c), &width_, &height_,
		&bytesPerValue_, &buffer_)

	*width = int(width_)
	*height = int(height_)
	*bytesPerValue = int(bytesPerValue_)
	*buffer = buffer_

}