/// <summary> /// Clean up. /// </summary> public static void Dispose() { PointManager.Dispose(); PointRenderable.Dispose(); PlaneRenderable.Dispose(); ShaderManager.Dispose(); PaletteManager.Dispose(); }
/// <summary> /// Initialization process. /// </summary> public static void Load() { Camera.Load(); // Set variables to the settings default. Factor1 = new Vector2(Settings.Factor1X, Settings.Factor1Y); IMax = Settings.IMax; SquaredLimit = Settings.Limit * Settings.Limit; // Load in all the shaders found. foreach (var name in FileManager.GetGraphShaderNames()) { ShaderManager.Add(name); } // Load all palettes found. foreach (var name in FileManager.GetPaletteImageNames()) { PaletteManager.Add(name); } // Set the default shader for points ChangeShader(Settings.PointShader, true); // Activate the default shader and palette. ChangeShader(Settings.DefaultShader); ChangePalette(Settings.DefaultPalette); // Configure GL properly. GL.ClearColor(Color4.Black); GL.Enable(EnableCap.Blend); GL.LineWidth(2f); // generate a GL Buffer with a plane in it and load it into GPU storage. PointRenderable.Load(); PlaneRenderable.Load(); // Initialize the crosshair. crosshair1 = new Point(Vector3.Zero, Color4.Black, 0.012f); crosshair2 = new Point(new Vector3(0, 0, -0.000001f), Color4.White); // Check for GL errors. Utils.CheckError("Load"); }
/// <summary> /// Renders the point: The stored data of this point gets piped into the shader via uniforms. /// Then, the static PointRenderable renders the vertice buffer. /// </summary> public void Render() { MasterRenderer.DefaultManager.UniformModelView(Camera.InverseScaleMatrix * objectMatrix); MasterRenderer.DefaultManager.UniformColor(Color); PointRenderable.Render(); }