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,36 +1,37 @@
|
|||
using System.Drawing;
|
||||
using OpenTK;
|
||||
#region usings
|
||||
|
||||
using System.Drawing;
|
||||
using OpenTK.Graphics;
|
||||
using SM.Base.Contexts;
|
||||
using SM.Base.Scene;
|
||||
using SM.Base.Textures;
|
||||
using SM.Base.Types;
|
||||
using SM2D.Scene;
|
||||
using SM2D.Types;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace SM2D.Drawing
|
||||
{
|
||||
public class DrawTexture : DrawColor
|
||||
{
|
||||
public static float MasterScale = .25f;
|
||||
public bool ManualSize = false;
|
||||
|
||||
public float Scale = 1;
|
||||
public bool ManualSize = false;
|
||||
public Texture Texture
|
||||
|
||||
public DrawTexture()
|
||||
{
|
||||
get => (Texture) _material.Texture;
|
||||
set => _material.Texture = value;
|
||||
}
|
||||
|
||||
public DrawTexture() {}
|
||||
|
||||
protected DrawTexture(Color4 color) : base(color) { }
|
||||
protected DrawTexture(Color4 color) : base(color)
|
||||
{
|
||||
}
|
||||
|
||||
public DrawTexture(Bitmap map) : this(map, Color4.White)
|
||||
{ }
|
||||
{
|
||||
}
|
||||
|
||||
public DrawTexture(Bitmap map, Color4 color) : this((Texture)map, color)
|
||||
{ }
|
||||
public DrawTexture(Bitmap map, Color4 color) : this((Texture) map, color)
|
||||
{
|
||||
}
|
||||
|
||||
public DrawTexture(Texture texture, Color4 color)
|
||||
{
|
||||
|
|
@ -38,9 +39,17 @@ namespace SM2D.Drawing
|
|||
_material.Tint = color;
|
||||
}
|
||||
|
||||
public Texture Texture
|
||||
{
|
||||
get => (Texture) _material.Texture;
|
||||
set => _material.Texture = value;
|
||||
}
|
||||
|
||||
protected override void DrawContext(ref DrawContext context)
|
||||
{
|
||||
if (!ManualSize) Transform.Size = new CVector2(Texture.Map.Width * MasterScale * Scale, Texture.Map.Height * MasterScale * Scale);
|
||||
if (!ManualSize)
|
||||
Transform.Size = new CVector2(Texture.Map.Width * MasterScale * Scale,
|
||||
Texture.Map.Height * MasterScale * Scale);
|
||||
base.DrawContext(ref context);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue