protected override void OnActivated(Registry registry) { if (registry.TryGetSingletonComponent(out OrthoCameraComponent cameraComponent)) { Renderer2D.Init(cameraComponent, new Color4(0, 0, 0, 1)); } }
protected override void Init() { LineRenderer.Init(); Renderer2D.Init(); //Renderer.EnableDepthTest(true); Log.EnableGLDebugging(LogLevel.Warn); Renderer.SetClearColor(0.05f, 0.05f, 0.05f); }
/// <summary> /// Loads light helpers. /// </summary> public override void PostLoad() { GraphicsUtil.CheckError("PostLoad - Pre"); SysConsole.Output(OutputType.INIT, "GameEngine loading render helpers..."); RenderHelper = new Renderer2D(Textures, Shaders); RenderHelper.Init(); GraphicsUtil.CheckError("PostLoad - RenderHelper Done"); SysConsole.Output(OutputType.INIT, "GameEngine loading 2D light helpers..."); LoadLightHelpers(); GraphicsUtil.CheckError("PostLoad - Post"); }
protected override void Init() { Profiler.BeginScope($"{nameof(EditorApplication)}.{nameof(EditorApplication.Init)}"); LineRenderer.Init(); Renderer2D.Init(); CrossEngine.Logging.Log.EnableGLDebugging(LogLevel.Warn); Renderer.SetClearColor(0.05f, 0.05f, 0.05f); Profiler.EndScope(); }
protected override void OnActivated(Registry registry) { if (registry.TryGetSingletonComponent(out OrthoCameraComponent camera)) { Renderer2D.Init(camera); } else { Log.Print("No Camera."); } }
/// <summary> /// Loads all content for the game, and starts the systems. /// </summary> /// <param name="sender">Irrelevant.</param> /// <param name="e">Irrelevant.</param> private void Window_Load(object sender, EventArgs e) { SysConsole.Output(OutputType.INIT, "GameClient starting load sequence..."); GL.Viewport(0, 0, Window.Width, Window.Height); GL.Enable(EnableCap.Texture2D); GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill); GL.Disable(EnableCap.CullFace); GraphicsUtil.CheckError("GEB - Initial"); SysConsole.Output(OutputType.INIT, "GameClient loading file helpers..."); Files = new FileHandler(); Files.Init(); SysConsole.Output(OutputType.INIT, "GameClient loading shader helpers..."); Shaders = new ShaderEngine(); Shaders.InitShaderSystem(); SysConsole.Output(OutputType.INIT, "GameClient loading texture helpers..."); Textures = new TextureEngine(); Textures.InitTextureSystem(Files); GraphicsUtil.CheckError("GEB - Textures"); SysConsole.Output(OutputType.INIT, "GameClient loading font helpers..."); GLFonts = new GLFontEngine(Textures, Shaders); GLFonts.Init(Files); FontSets = new FontSetEngine(GLFonts) { FixTo = Shaders.ColorMult2DShader }; // TODO: FGE/Core->Languages engine! FontSets.Init((subdata) => null, () => Ortho, () => GlobalTickTime); GraphicsUtil.CheckError("GEB - Fonts"); SysConsole.Output(OutputType.INIT, "GameClient loading 2D/UI render helper..."); MainUI = new ViewUI2D(this); SysConsole.Output(OutputType.INIT, "GameEngine loading model engine..."); Animations = new AnimationEngine(); Models = new ModelEngine(); Models.Init(Animations, this); SysConsole.Output(OutputType.INIT, "GameEngine loading render helper..."); Rendering3D = new Renderer(Textures, Shaders, Models); Rendering3D.Init(); Rendering2D = new Renderer2D(Textures, Shaders); Rendering2D.Init(); SysConsole.Output(OutputType.INIT, "GameClient calling engine load..."); CurrentEngine.Load(); SysConsole.Output(OutputType.INIT, "GameClient calling external load event..."); OnWindowLoad?.Invoke(); SysConsole.Output(OutputType.INIT, "GameClient is ready and loaded! Starting main game loop..."); GraphicsUtil.CheckError("GEB - Loaded"); Loaded = true; }