Beispiel #1
0
// This should be used to resize the window during tests, to ensure that it is
// correctly resized before execution continues.
// Causes buffers to swap.
func SetWindowSize(width, height int) {
	glfw.SetWindowSize(width, height)
	// Need to wait for the reshape event, otherwise it happens at an arbitrary
	// point in the future (some unknown number of SwapBuffers())
	//glfw.PollEvents() // Doesn't work
	//glfw.WaitEvents() // might be racy (ideally, we'd need to send an event)
	time.Sleep(10 * time.Millisecond)
	glfw.SwapBuffers()
}
Beispiel #2
0
func (me *WindowOptions) SetSize(width, height int) {
	if me.width, me.height = width, height; me.Created() {
		glfw.SetWindowSize(width, height)
	}
}
Beispiel #3
0
func (me *window) SetSize(width, height int) {
	glfw.SetWindowSize(width, height)
}