private void Init() { _gl = GL.GetApi(new GlfwContext(_glfw, _window)); Assets.Init(_gl); Input.Init(_glfw, _window); _glFons = new GLFons(_gl); _fons = _glFons.Create(512, 512, (int)FonsFlags.ZeroTopleft); _fons.AddFont("stdfont", "./fonts/DroidSerif-Regular.ttf"); _world = new World.World(this); _ui = new Ui(this); }
private void Init() { var context = new GlfwContext(_glfw, _window); _gl = GL.GetApi(context); _legacyGl = Silk.NET.OpenGL.Legacy.GL.GetApi(context); ResourceManager.Init(_gl); Input.Init(_glfw, _window); _glFons = new GLFons(_legacyGl); _fons = _glFons.Create(512, 512, (int)FonsFlags.ZeroTopleft); _fons.AddFont("stdfont", "./Assets/Fonts/DroidSerif-Regular.ttf"); _camera = new Camera(0.0f, 0.0f, 0.0f, 0.0f); _stateManager.AddState("Main Menu", new MenuState()); _stateManager.AddState("Level Selector", new LevelSelectorState()); _stateManager.AddState("Game", new GameState()); MusicMaster.Start(); }
/// <param name="fontIndex">Specifies which font face to load from a .ttf/.ttc file</param> public static int CreateFontAtIndex(this Nvg nvg, string name, string fileName, int fontIndex) { Fontstash fons = nvg.fontManager.Fontstash; return(fons.AddFont(name, fileName, fontIndex)); }