// EngineStart initializes everything in order within the engine. Should be called first func EngineStart() { readFlags() Window.Start() Opengl.OGL_VERSION = *OGL_VERSION Opengl.Start() Font.LoadFonts(AssetsFonts) Image.LoadImages(AssetsImages) Opengl.CreateBuffers() Logging.Info("Engine initialization finished.") // Image.AggrImg.Print("aggr.png") }
func (w Window) init() error { sdl.GL_SetAttribute(sdl.GL_DOUBLEBUFFER, 1) sdl.GL_SetAttribute(sdl.GL_RED_SIZE, 8) sdl.GL_SetAttribute(sdl.GL_GREEN_SIZE, 8) sdl.GL_SetAttribute(sdl.GL_BLUE_SIZE, 8) sdl.GL_SetAttribute(sdl.GL_ALPHA_SIZE, 8) if err := gl.Init(); err != nil { return errors.New("Cannot initialize OGL: ") } gl.Viewport(0, 0, int32(w.Width), int32(w.Height)) Opengl.CreateBuffers(w.Width, w.Height) return nil }