|
@@ -96,7 +96,11 @@ import (
|
|
|
func main() {
|
|
func main() {
|
|
|
|
|
|
|
|
// Creates window and OpenGL context
|
|
// Creates window and OpenGL context
|
|
|
- win, err := window.New("glfw", 800, 600, "Hello G3N", false)
|
|
|
|
|
|
|
+ wmgr, err := window.Manager("glfw")
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ panic(err)
|
|
|
|
|
+ }
|
|
|
|
|
+ win, err := wmgr.CreateWindow(800, 600, "Hello G3N", false)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
panic(err)
|
|
panic(err)
|
|
|
}
|
|
}
|
|
@@ -113,7 +117,7 @@ func main() {
|
|
|
|
|
|
|
|
// Sets the OpenGL viewport size the same as the window size
|
|
// Sets the OpenGL viewport size the same as the window size
|
|
|
// This normally should be updated if the window is resized.
|
|
// This normally should be updated if the window is resized.
|
|
|
- width, height := win.GetSize()
|
|
|
|
|
|
|
+ width, height := win.Size()
|
|
|
gs.Viewport(0, 0, int32(width), int32(height))
|
|
gs.Viewport(0, 0, int32(width), int32(height))
|
|
|
|
|
|
|
|
// Creates scene for 3D objects
|
|
// Creates scene for 3D objects
|
|
@@ -163,7 +167,7 @@ func main() {
|
|
|
|
|
|
|
|
// Update window and checks for I/O events
|
|
// Update window and checks for I/O events
|
|
|
win.SwapBuffers()
|
|
win.SwapBuffers()
|
|
|
- win.PollEvents()
|
|
|
|
|
|
|
+ wmgr.PollEvents()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|