package
0.0.0-20220611142855-c75633e8f939
Repository: https://github.com/vbsw/archive.git
Documentation: pkg.go.dev
# README
OGLWin Demo
About
OGLWin Demo is a demo for the Go package oglwin (https://github.com/vbsw/oglwin).
OGLWin Demo is created by Vitali Baumtrok [email protected] and published at https://github.com/vbsw/oglwin-demo.
Copying
You can redistribute OGLWin Demo and/or modify it under the terms of the Boost Software License, version 1.0. (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
OGLWin Demo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Boost Software License for more details.
Dependencies
To compile OGLWin (and this demo) under Linux you need following packages (or similar)
libc6-dev
libX11-dev
libgl1-mesa-dev
Example
package main
import (
"fmt"
"github.com/vbsw/oglwin"
)
func main ( ) {
window, _ := oglwin.New(true, 0)
window.SetWH(640, 360)
window.Show()
for window.NextEvent() {
switch window.EventCode() {
case oglwin.KEY_PRESSED:
fmt.Println("Key", window.KeyCode())
if ( window.KeyCode() == 9 ) {
window.Destroy()
}
case oglwin.REDRAW:
fmt.Println("resize ", window.W(), "x", window.H())
window.SwapBuffers()
}
}
}