CCustomMaterial



Implements CustomMaterial control.

You can find more information in comments below. Overrided methods can be found in corresponding base classes and interfaces.

class CCustomMaterial :public virtual ICustomMaterial, public CControl
{
public:
    // IControl getters 
    bool isAcceptControl() override;
    bool isAcceptControl(IControl *control) override;

    // IMaterialControl methods 
    bool Activate(COpenGL *graphics, IModel *model, ICamera *camera) override;

    // ICustomMaterial getters 
    ITexture *getTexture() override;
    AnsiString getVertexShader() override;
    AnsiString getFragmentShader() override;
    int getOptionCount() override;
    String getOptionName(const int index) override;
    OptionType getOptionType(const int index) override;
    int getIntegerOptionValue(const int index) override;
    float getFloatOptionValue(const int index) override;
    Vec2f getVec2OptionValue(const int index) override;
    Vec3f getVec3OptionValue(const int index) override;
    Vec4f getVec4OptionValue(const int index) override;
    Vec2i getVec2iOptionValue(const int index) override;
    Vec3i getVec3iOptionValue(const int index) override;
    Vec4i getVec4iOptionValue(const int index) override;
    Mat4f getMat4OptionValue(const int index) override;
    AnsiString getVertexShaderErrors() override;
    AnsiString getFragmentShaderErrors() override;
    AnsiString getProgramErrors() override;

    // ICustomMaterial setters 
    bool setTexture(ITexture *value) override;
    bool setVertexShader(const AnsiString &value) override;
    bool setFragmentShader(const AnsiString &value) override;
    bool setShaders(const AnsiString &vertex, const AnsiString &fragment) override;
    bool setOption(const String &name, const int value) override;
    bool setOption(const String &name, const float value) override;
    bool setOption(const String &name, const Vec2f &value) override;
    bool setOption(const String &name, const Vec3f &value) override;
    bool setOption(const String &name, const Vec4f &value) override;
    bool setOption(const String &name, const Vec2i &value) override;
    bool setOption(const String &name, const Vec3i &value) override;
    bool setOption(const String &name, const Vec4i &value) override;
    bool setOption(const String &name, const Mat4f &value) override;

    bool LoadVertexShader(const String &filename) override;
    bool LoadFragmentShader(const String &filename) override;
    bool LoadShaders(const String &vertex_filename, const String &fragment_filename) override;

    void LockUpdate() override;
    void UnlockUpdate() override;

    CCustomMaterial();
    CCustomMaterial(IControl *parent);

    bool isUseMatrixModel() const; // Return whether app_MatrixModel uniform should be looked up and used 
    bool isUseMatrixCamera() const; // Return whether app_MatrixCamera uniform should be looked up and used 
    bool isUseHasTexture() const; // Return whether app_HasTexture uniform should be looked up and used 

    bool setUseMatrixModel(const bool value); // Set whether app_MatrixModel uniform should be looked up and used 
    bool setUseMatrixCamera(const bool value); // Set whether app_MatrixCamera uniform should be looked up and used 
    bool setUseHasTexture(const bool value); // Set whether app_HasTexture uniform should be looked up and used 
};
Namespace: nitisa::opengl
Include: OpengL/Controls/CustomMaterial/CustomMaterial.h