smrendererv3/SMCode/SM.OGL/GLSystem.cs
Michel Fedde 03b3942732 Holidays 12.10. -> 25.10.2020
~ Moved code around in files.

SM.Base:
+ PostProcessing-system
+ OnInitialization() for Scenes.
+ Shader-Extensions
+ Added option to not react while unfocused to the window.
+ Added Screenshots to the window.
+ Connected the log system to the SM.OGL-action system.

~ Replaced IShader with abstract MaterialShader.
~ When a log compression folder doesn't exist, it will create one.

SM.OGL:
+ Added support for UniformArrays
+ Added ShaderPreProcessing
+ Added Shader Extensions.
+ Added Debug actions.
+ SM.OGL settings

~ Framebuffer Size is automaticly changed, when the window and scale is set.

SM2D:
+ Added easy shader drawing.
2020-10-24 15:10:36 +02:00

58 lines
No EOL
1.7 KiB
C#

#region usings
using System.Linq;
using OpenTK.Graphics.OpenGL4;
#endregion
namespace SM.OGL
{
/// <summary>
/// Contains data and settings about the current OpenGL system.
/// </summary>
public class GLSystem
{
private static bool _init;
/// <summary>
/// Contains the device version of OpenGL.
/// </summary>
public static Version DeviceVersion { get; private set; }
/// <summary>
/// Contains the shader version for GLSL.
/// </summary>
public static Version ShadingVersion { get; private set; }
/// <summary>
/// Contains the extensions for OpenGL.
/// </summary>
public static string[] Extensions { get; private set; }
/// <summary>
/// Checks if proper Debugging is for this system available.
/// <para>Determent, if the system has the "KHR_debug"-extension. </para>
/// </summary>
public static bool Debugging { get; private set; }
/// <summary>
/// Initialize the system data.
/// <para>Does nothing after the data was already collected.</para>
/// </summary>
public static void INIT_SYSTEM()
{
if (_init) return;
DeviceVersion = Version.CreateGLVersion(GL.GetString(StringName.Version));
ShadingVersion = Version.CreateGLVersion(GL.GetString(StringName.ShadingLanguageVersion));
Extensions = GL.GetString(StringName.Extensions).Split(' ');
Debugging = Extensions.Contains("khr_debug");
if (Debugging) GLDebugging.EnableDebugging();
_init = true;
}
}
}