Example #1
0
func Viewport(x, y, width, height int) {
	defer func() {
		errstr := errDrain()
		log.Printf("gl.Viewport(%v, %v, %v, %v) %v", x, y, width, height, errstr)
	}()
	C.glViewport(C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height))
}
Example #2
0
func Viewport(
	x int32, y int32, width Sizei, height Sizei) {
	C.glViewport(
		C.GLint(x),
		C.GLint(y),
		C.GLsizei(width),
		C.GLsizei(height))
}
Example #3
0
func BeginFrame(width, height int, devicePixelRatio float32) {
	w := C.GLsizei(float32(width) * devicePixelRatio)
	h := C.GLsizei(float32(height) * devicePixelRatio)
	C.glViewport(0, 0, w, h)
	C.glClearColor(0, 0, 0, 1)
	C.glClear(C.GL_COLOR_BUFFER_BIT | C.GL_DEPTH_BUFFER_BIT | C.GL_STENCIL_BUFFER_BIT)
	C.nvgBeginFrame(vg, C.int(width), C.int(height), C.float(devicePixelRatio))
}
Example #4
0
func initialize() {
	//
	if !initialized {
		initialized = true
		scr.Switch(scr.XGA) // (scr.MaxMode())
		C.glViewport(0, 0, C.GLsizei(scr.NX()), C.GLsizei(scr.NY()))
	}
}
Example #5
0
func Viewport(x, y, width, height int) {
	C.glViewport(C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height))
}
Example #6
0
File: gl.go Project: extrame/gl
// Viewport calls glViewport
func Viewport(x int, y int, w int, h int) {
	C.glViewport(C.GLint(x), C.GLint(y), C.GLsizei(w), C.GLsizei(h))
}
Example #7
0
func (game *game) resize(width, height int) {
	game.width = width
	game.height = height
	C.glViewport(0, 0, C.GLsizei(width), C.GLsizei(height))
}
Example #8
0
File: gl.go Project: james4k/gl
//void glViewport (int x, int y, int width, int height)
func Viewport(x int, y int, width int, height int) {
	C.glViewport(C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height))
}
Example #9
0
func Viewport(x, y, with, height int) {
	C.glViewport(
		(C.GLint)(x), (C.GLint)(y),
		(C.GLsizei)(with), (C.GLsizei)(height))
}