//#####################################################################
// Copyright 2021, Craig Schroeder.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
#ifndef __SHADER_FLAGS__
#define __SHADER_FLAGS__
#include <compare>
namespace PhysBAM{
enum class SHADER_TYPE
{
    regular,
    segment,
    arrow,
    sphere,
    box,
    regular_poly,
    matrix,
    diamond
};
struct SHADER_FLAGS
{
    int in_dim=-1; // 0=pts, 1=lines, 2=tris
    int out_dim=-1; // 0=pts, 1=lines, 2=tris
    int col=-1; // 0=none, 1=const, 2=per-vertex
    int bg_col=-1; // 0=none, 1=const, 2=per-vertex
    bool select=false;
    bool flat_col=false;
    int dim=-1; // TV::m

    // regular
    // segment (X[],dX[])
    // arrow (X[],dX[])
    // sphere (X[],radius[])
    // box (X[],size) (2D only)
    // regular_poly (X[],radius[],sides,initial_rotate)   (2D only)
    // matrix (X[],mat[])
    // diamond (X[],size) (2D only)
    SHADER_TYPE special=SHADER_TYPE::regular;

    void Simplify()
    {
        if(select)
        {
            col=0;
            bg_col=0;
            flat_col=true;
        }
        if(out_dim<2) bg_col=0;
    }
    
    auto operator<=>(const SHADER_FLAGS& t) const = default;
};
}
#endif
