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.
This commit is contained in:
parent
2c00dbd31a
commit
03b3942732
102 changed files with 2683 additions and 1398 deletions
|
|
@ -1,53 +1,84 @@
|
|||
using System;
|
||||
#region usings
|
||||
|
||||
using System;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace SM.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// A global helper class for randomization.
|
||||
/// A global helper class for randomization.
|
||||
/// </summary>
|
||||
public class Randomize
|
||||
{
|
||||
/// <summary>
|
||||
/// The randomizer.
|
||||
/// The randomizer.
|
||||
/// </summary>
|
||||
public static Random Randomizer = new Random();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the seed for the randomizer.
|
||||
/// Sets the seed for the randomizer.
|
||||
/// </summary>
|
||||
/// <param name="seed">The specified seed.</param>
|
||||
public static void SetSeed(int seed) { Randomizer = new Random(seed); }
|
||||
public static void SetSeed(int seed)
|
||||
{
|
||||
Randomizer = new Random(seed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a double and checks if its under the tolerance.
|
||||
/// Generates a double and checks if its under the tolerance.
|
||||
/// </summary>
|
||||
public static bool GetBool(float tolerance) { return Randomizer.NextDouble() < tolerance; }
|
||||
public static bool GetBool(float tolerance)
|
||||
{
|
||||
return Randomizer.NextDouble() < tolerance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a integer.
|
||||
/// Generates a integer.
|
||||
/// </summary>
|
||||
public static int GetInt() { return Randomizer.Next(); }
|
||||
/// <summary>
|
||||
/// Generates a integer with a maximum.
|
||||
/// </summary>
|
||||
public static int GetInt(int max) { return Randomizer.Next(max); }
|
||||
/// <summary>
|
||||
/// Generates a integer with a minimum and maximum
|
||||
/// </summary>
|
||||
public static int GetInt(int min, int max) { return Randomizer.Next(min, max); }
|
||||
public static int GetInt()
|
||||
{
|
||||
return Randomizer.Next();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a float between 0 and 1.
|
||||
/// Generates a integer with a maximum.
|
||||
/// </summary>
|
||||
public static float GetFloat() { return (float)Randomizer.NextDouble(); }
|
||||
/// <summary>
|
||||
/// Generates a float between 0 and the specified maximum.
|
||||
/// </summary>
|
||||
public static float GetFloat(float max) { return (float)Randomizer.NextDouble() * max; }
|
||||
/// <summary>
|
||||
/// Generates a float between the specified minimum and the specified maximum.
|
||||
/// </summary>
|
||||
public static float GetFloat(float min, float max) { return (float)Randomizer.NextDouble() * max + min; }
|
||||
public static int GetInt(int max)
|
||||
{
|
||||
return Randomizer.Next(max);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a integer with a minimum and maximum
|
||||
/// </summary>
|
||||
public static int GetInt(int min, int max)
|
||||
{
|
||||
return Randomizer.Next(min, max);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a float between 0 and 1.
|
||||
/// </summary>
|
||||
public static float GetFloat()
|
||||
{
|
||||
return (float) Randomizer.NextDouble();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a float between 0 and the specified maximum.
|
||||
/// </summary>
|
||||
public static float GetFloat(float max)
|
||||
{
|
||||
return (float) Randomizer.NextDouble() * max;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a float between the specified minimum and the specified maximum.
|
||||
/// </summary>
|
||||
public static float GetFloat(float min, float max)
|
||||
{
|
||||
return (float) Randomizer.NextDouble() * max + min;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue