Esempio n. 1
0
func flushBuffer() {
	for {

		w := <-windowFlushBuffer

		w.win.MakeContextCurrent()

		imgWidth := w.buffer.Rect.Max.X
		imgHeight := w.buffer.Rect.Max.Y

		windowWidth, windowHeight := w.Size()

		// gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)
		gl.RasterPos2f(-1, 1)
		gl.PixelZoom(1, -1)
		gl.Viewport(0, 0, windowWidth, windowHeight)
		gl.DrawPixels(imgWidth, imgHeight, gl.RGBA, gl.UNSIGNED_BYTE, &w.buffer.Pix[0])

		w.win.SwapBuffers()

		windowFlushBufferDone <- true
	}
}
Esempio n. 2
0
func bitmap_output(x, y float32, str string, font glut.BitmapFont) {
	gl.RasterPos2f(x, y)
	for _, ch := range str {
		font.Character(ch)
	}
}