Cafu Engine
EditorMaterialEngine.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_EDITOR_MATERIAL_ENGINE_HPP_INCLUDED
8 #define CAFU_EDITOR_MATERIAL_ENGINE_HPP_INCLUDED
9 
10 #include "wx/image.h"
11 #include "EditorMaterial.hpp"
12 
13 
14 /// This class implements the EditorMaterialI for materials that we
15 /// have a material for in the MaterialSystems material manager.
17 {
18  public:
19 
20  EngineMaterialT(MaterialT* MatSysMaterial_);
21  ~EngineMaterialT();
22 
23  int GetWidth() const;
24  int GetHeight() const;
25 
26  const wxString& GetName() const { return Name; }
27 
28  void Draw(wxDC& dc, const wxRect& DestRect, int NameBoxHeight, bool DrawNameBox) const;
29  const wxImage& GetImage() const;
30 
31  MatSys::RenderMaterialT* GetRenderMaterial(bool PreviewMode) const;
32  MaterialT* GetMaterial() const { return MatSysMaterial; }
33  bool IsTranslucent() const;
34  bool ShowInMaterialBrowser() const;
35 
36 
37  private:
38 
39  const wxString Name;
40  MaterialT* MatSysMaterial;
41  mutable MatSys::RenderMaterialT* MatSysRenderMaterial_Normal;
42  mutable MatSys::RenderMaterialT* MatSysRenderMaterial_Editor;
43  mutable MaterialT* Material_Editor; ///< The material with which the MatSysRenderMaterial_Editor is built.
44  mutable wxImage* m_BrowserImage;
45 };
46 
47 #endif
This class represents a surface render material.
Definition: RenderMaterial.hpp:25
bool ShowInMaterialBrowser() const
Returns whether the material should be shown for selection in the materials browser.
Definition: EditorMaterialEngine.cpp:176
MatSys::RenderMaterialT * GetRenderMaterial(bool PreviewMode) const
Returns the render material of this material.
Definition: EditorMaterialEngine.cpp:138
This class represents a surface material ("A datastructural representation of a scripts material def...
Definition: Material.hpp:22
This class implements the EditorMaterialI for materials that we have a material for in the MaterialSy...
Definition: EditorMaterialEngine.hpp:16
Definition: EditorMaterial.hpp:21
bool IsTranslucent() const
Returns whether this material is rendered translucently.
Definition: EditorMaterialEngine.cpp:184
MaterialT * GetMaterial() const
Returns the material object.
Definition: EditorMaterialEngine.hpp:32