示例#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()
}
示例#2
0
func (me *WindowOptions) SetSize(width, height int) {
	if me.width, me.height = width, height; me.Created() {
		glfw.SetWindowSize(width, height)
	}
}
示例#3
0
func (me *window) SetSize(width, height int) {
	glfw.SetWindowSize(width, height)
}