smrendererv3/SMCode/SM.OGL/Texture/TextureBase.cs
Michel Fedde 5bb690e45f 2021-15-03
+ GenericTransformation.InWorldSpace (Merges the object transformation and the last master transformation)
+ Ray class for Raycasting (may not work correctly)
+ Util.CallGarbageCollector() can call the garbage collector.
+ GLWindow.WindowFlags allow to easly switch between Window <-> Borderless Window (this will cause the window to fill the entire screen) <-> Exclusive Fullscreen.

~ Made the bloom-texture scale a constructor-parameter.

SM.OGL:
+ OpenGL-GarbageCollector integration.
+ BoundingBox.GetBounds(Matrix4, out Vector3,out Vector3) allows for easy transformation of the bounding box.
+ GLObjects can now marked as not compiled. Where it always returns false at WasCompiled.

SM2D:
~ Improved the Mouse2D.MouseOver Algorithm.
2021-03-15 18:11:58 +01:00

53 lines
No EOL
1.5 KiB
C#

#region usings
using OpenTK.Graphics.OpenGL4;
#endregion
namespace SM.OGL.Texture
{
/// <summary>
/// Works as a basis for textures.
/// </summary>
public abstract class TextureBase : GLObject
{
/// <inheritdoc />
protected override bool AutoCompile { get; } = true;
/// <inheritdoc />
public override ObjectLabelIdentifier TypeIdentifier { get; } = ObjectLabelIdentifier.Texture;
public PixelInformation PixelInformation;
public TextureTarget Target { get; set; } = TextureTarget.Texture2D;
/// <summary>
/// The texture filter.
/// <para>Default: <see cref="TextureMinFilter.Linear" /></para>
/// </summary>
public virtual TextureMinFilter Filter { get; set; } = TextureMinFilter.Linear;
/// <summary>
/// The wrap mode.
/// <para>Default: <see cref="TextureWrapMode.Repeat" /></para>
/// </summary>
public virtual TextureWrapMode WrapMode { get; set; } = TextureWrapMode.Repeat;
/// <summary>
/// The Width of the texture
/// </summary>
public virtual int Width { get; protected set; }
/// <summary>
/// The height of the texture
/// </summary>
public virtual int Height { get; protected set; }
public override void Dispose()
{
GL.DeleteTexture(_id);
base.Dispose();
}
}
}