using System.Collections.Generic;
using OpenTK;
using SM.Base.Scene;
using SM.OGL.Mesh;
namespace SM.Base.Contexts
{
///
/// Contains important information for drawing.
///
public struct DrawContext
{
///
/// This says if it was forced to use the viewport camera.
///
public bool ForceViewport;
///
/// The current world matrix.
///
public Matrix4 World;
///
/// The current view matrix.
///
public Matrix4 View;
///
/// The drawing instances.
/// If there is only one, it's index 0
///
public Instance[] Instances;
///
/// The mesh.
///
public GenericMesh Mesh;
///
/// The material.
///
public Material Material;
///
/// Contains the currently used render pipeline.
///
public RenderPipeline ActivePipeline;
///
/// The current world scale.
///
public Vector2 WorldScale;
///
/// Returns the appropriate shader.
/// Returns the material shader, if available, otherwise it will take the default shader from the render pipeline.
///
public IShader Shader => Material.CustomShader ?? ActivePipeline._defaultShader;
}
}