示例#1
0
文件: renderbuffer.go 项目: Nvveen/gl
// void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
func GetRenderbufferParameteriv(target, pname GLenum, params []int32) {
	if len(params) == 0 {
		panic(ErrorInputSize)
	}

	C.glGetRenderbufferParameteriv(C.GLenum(target), C.GLenum(pname), (*C.GLint)(&params[0]))
}
示例#2
0
文件: gles2.go 项目: remogatto/egles
func GetRenderbufferParameteriv(
	target Enum, pname Enum, params *int32) {
	C.glGetRenderbufferParameteriv(
		C.GLenum(target),
		C.GLenum(pname),
		(*C.GLint)(params))
}
示例#3
0
func TexImage2D(target TextureTarget, level int, internalformat InternalFormat, width, height int, format TextureFormat, datatype DataType, pixels []uint8) {
	if pixels != nil {
		C.glTexImage2D(C.GLenum(target), C.GLint(level), C.GLint(internalformat), C.GLsizei(width), C.GLsizei(height), 0, C.GLenum(format), C.GLenum(datatype), unsafe.Pointer(&pixels[0]))
	} else {
		C.glTexImage2D(C.GLenum(target), C.GLint(level), C.GLint(internalformat), C.GLsizei(width), C.GLsizei(height), 0, C.GLenum(format), C.GLenum(datatype), unsafe.Pointer(nil))
	}
}
示例#4
0
// void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
func GetRenderbufferParameteriv(target, pname GLenum, params []int32) {
	if len(params) == 0 {
		panic("Invalid params size")
	}

	C.glGetRenderbufferParameteriv(C.GLenum(target), C.GLenum(pname), (*C.GLint)(&params[0]))
}
示例#5
0
文件: gles2.go 项目: remogatto/egles
func BlendEquationSeparate(
	modeRGB Enum, modeAlpha Enum) {
	C.glBlendEquationSeparate(
		C.GLenum(modeRGB),
		C.GLenum(modeAlpha))

}
示例#6
0
文件: gles2.go 项目: remogatto/egles
func TexParameterf(
	target Enum, pname Enum, param float32) {
	C.glTexParameterf(
		C.GLenum(target),
		C.GLenum(pname),
		C.GLfloat(param))
}
示例#7
0
文件: gles2.go 项目: remogatto/egles
func TexParameteriv(
	target Enum, pname Enum, params *int32) {
	C.glTexParameteriv(
		C.GLenum(target),
		C.GLenum(pname),
		(*C.GLint)(params))
}
示例#8
0
文件: gles2.go 项目: remogatto/egles
func TexParameterfv(
	target Enum, pname Enum, params *float32) {
	C.glTexParameterfv(
		C.GLenum(target),
		C.GLenum(pname),
		(*C.GLfloat)(params))
}
示例#9
0
文件: gles2.go 项目: remogatto/egles
func TexParameteri(
	target Enum, pname Enum, param int32) {
	C.glTexParameteri(
		C.GLenum(target),
		C.GLenum(pname),
		C.GLint(param))
}
示例#10
0
文件: es2.go 项目: nick-fedesna/egles
func CopyTexImage2D(target uint, level int, internalformat uint,
	x, y, width, height, border int) {
	C.glCopyTexImage2D(
		C.GLenum(target), C.GLint(level), C.GLenum(internalformat),
		C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height),
		C.GLint(border))
}
示例#11
0
文件: gles2.go 项目: remogatto/egles
func StencilOp(
	fail Enum, zfail Enum, zpass Enum) {
	C.glStencilOp(
		C.GLenum(fail),
		C.GLenum(zfail),
		C.GLenum(zpass))
}
示例#12
0
文件: gles2.go 项目: remogatto/egles
func BlendFunc(
	sfactor Enum, dfactor Enum) {
	C.glBlendFunc(
		C.GLenum(sfactor),
		C.GLenum(dfactor))

}
示例#13
0
文件: es2.go 项目: nick-fedesna/egles
func GetShaderPrecisionFormat(shadertype, precisiontype uint) (
	range_ int32, precision int32) {
	C.glGetShaderPrecisionFormat(
		C.GLenum(shadertype), C.GLenum(precisiontype),
		(*C.GLint)(&range_), (*C.GLint)(&precision))
	return
}
示例#14
0
文件: gl.go 项目: extrame/gl
// Set calls glBufferData with appropriate arguments to load the data pointed to by data into the buffer. usage is passed along verbatim. targ is used for binding and it should most likely be ARRAY_BUFFER.
func (buf *Buffer) Set(targ int, data interface{}, usage int) {
	buf.Bind(targ)
	p, t, ts, s := toCtype(data)
	C.glBufferData(C.GLenum(targ), C.GLsizeiptr(s), p, C.GLenum(usage))
	buf.t = t
	buf.ts = ts
	buf.Unbind(targ)
}
示例#15
0
文件: es2.go 项目: nick-fedesna/egles
func CompressedTexImage2D(target uint, level int, internalformat uint,
	width, height, border, imageSize int, data Void) {
	C.glCompressedTexImage2D(
		C.GLenum(target), C.GLint(level), C.GLenum(internalformat),
		C.GLsizei(width), C.GLsizei(height),
		C.GLint(border), C.GLsizei(imageSize),
		unsafe.Pointer(data))
}
示例#16
0
文件: es2.go 项目: nick-fedesna/egles
func TexSubImage2D(target uint, level, xoffset, yoffset, width, height int,
	format, type_ uint, pixels Void) {

	C.glTexSubImage2D(C.GLenum(target), C.GLint(level),
		C.GLint(xoffset), C.GLint(yoffset), C.GLsizei(width), C.GLsizei(height),
		C.GLenum(format), C.GLenum(type_),
		unsafe.Pointer(pixels))
}
示例#17
0
文件: es2.go 项目: nick-fedesna/egles
func GetFramebufferAttachmentParameteriv(
	target, attachment, pname uint, params []int32) []int32 {
	C.glGetFramebufferAttachmentParameteriv(
		C.GLenum(target), C.GLenum(attachment),
		C.GLenum(pname), (*C.GLint)(&params[0]))
	return params

}
示例#18
0
文件: gles2.go 项目: remogatto/egles
func GetFramebufferAttachmentParameteriv(
	target Enum, attachment Enum, pname Enum, params *int32) {
	C.glGetFramebufferAttachmentParameteriv(
		C.GLenum(target),
		C.GLenum(attachment),
		C.GLenum(pname),
		(*C.GLint)(params))
}
示例#19
0
文件: gles2.go 项目: remogatto/egles
func StencilFuncSeparate(
	face Enum, func_ Enum, ref int32, mask uint32) {
	C.glStencilFuncSeparate(
		C.GLenum(face),
		C.GLenum(func_),
		C.GLint(ref),
		C.GLuint(mask))
}
示例#20
0
文件: es2.go 项目: nick-fedesna/egles
func CompressedTexSubImage2D(target uint, level, xoffset, yoffset int,
	width, height int, format uint, imageSize int, data Void) {
	C.glCompressedTexSubImage2D(
		C.GLenum(target), C.GLint(level),
		C.GLint(xoffset), C.GLint(yoffset),
		C.GLsizei(width), C.GLsizei(height),
		C.GLenum(format), C.GLsizei(imageSize),
		unsafe.Pointer(data))
}
示例#21
0
文件: gles2.go 项目: remogatto/egles
func DrawElements(
	mode Enum, count Sizei,
	type_ Enum, indices Void) {
	C.glDrawElements(
		C.GLenum(mode),
		C.GLsizei(count),
		C.GLenum(type_),
		unsafe.Pointer(indices))
}
示例#22
0
文件: gles2.go 项目: remogatto/egles
func FramebufferRenderbuffer(
	target Enum, attachment Enum,
	renderbuffertarget Enum, renderbuffer uint32) {
	C.glFramebufferRenderbuffer(
		C.GLenum(target),
		C.GLenum(attachment),
		C.GLenum(renderbuffertarget),
		C.GLuint(renderbuffer))
}
示例#23
0
文件: gles2.go 项目: remogatto/egles
func StencilOpSeparate(
	face Enum, fail Enum,
	zfail Enum, zpass Enum) {
	C.glStencilOpSeparate(
		C.GLenum(face),
		C.GLenum(fail),
		C.GLenum(zfail),
		C.GLenum(zpass))
}
示例#24
0
文件: gles2.go 项目: remogatto/egles
func GetShaderPrecisionFormat(
	shadertype Enum, precisiontype Enum,
	range_ *int32, precision *int32) {
	C.glGetShaderPrecisionFormat(
		C.GLenum(shadertype),
		C.GLenum(precisiontype),
		(*C.GLint)(range_),
		(*C.GLint)(precision))
}
示例#25
0
文件: gles2.go 项目: remogatto/egles
func RenderbufferStorage(
	target Enum, internalformat Enum,
	width Sizei, height Sizei) {
	C.glRenderbufferStorage(
		C.GLenum(target),
		C.GLenum(internalformat),
		C.GLsizei(width),
		C.GLsizei(height))
}
示例#26
0
文件: gles2.go 项目: remogatto/egles
func BufferData(
	target Enum, size SizeiPtr,
	data Void, usage Enum) {
	C.glBufferData(
		C.GLenum(target),
		C.GLsizeiptr(size),
		unsafe.Pointer(data),
		C.GLenum(usage))

}
示例#27
0
文件: gles2.go 项目: remogatto/egles
func BlendFuncSeparate(
	srcRGB Enum, dstRGB Enum,
	srcAlpha Enum, dstAlpha Enum) {
	C.glBlendFuncSeparate(
		C.GLenum(srcRGB),
		C.GLenum(dstRGB),
		C.GLenum(srcAlpha),
		C.GLenum(dstAlpha))

}
示例#28
0
func Build2DMipmaps(target uint32, internalFormat int, width, height int, format, typ uint32, data unsafe.Pointer) int {
	return int(C.gluBuild2DMipmaps(
		C.GLenum(target),
		C.GLint(internalFormat),
		C.GLsizei(width),
		C.GLsizei(height),
		C.GLenum(format),
		C.GLenum(typ),
		data))
}
示例#29
0
文件: gles2.go 项目: remogatto/egles
func FramebufferTexture2D(
	target Enum, attachment Enum,
	textarget Enum, texture uint32, level int32) {
	C.glFramebufferTexture2D(
		C.GLenum(target),
		C.GLenum(attachment),
		C.GLenum(textarget),
		C.GLuint(texture),
		C.GLint(level))
}
示例#30
0
func Build2DMipmaps(target gl.GLenum, internalFormat gl.GLint, width, height gl.GLsizei, format, kind gl.GLenum, data unsafe.Pointer) gl.GLint {
	return gl.GLint(C.gluBuild2DMipmaps(
		C.GLenum(target),
		C.GLint(internalFormat),
		C.GLsizei(width),
		C.GLsizei(height),
		C.GLenum(format),
		C.GLenum(kind),
		data,
	))
}