root/cafu/trunk/CaWE/EditorMaterial.hpp

Revision 457, 3.1 KB (checked in by Carsten, 4 months ago)

Using UltraEdit's multi-line search-and-replace-in-files feature, replaced


^#ifndef _(CAFU|CF|CFS|CA)_(.*)_$
^#define _\1_\2_$

with

#ifndef CAFU_\2_INCLUDED
#define CAFU_\2_INCLUDED

and


^#ifndef _(.*)_HPP_$
^#define _\1_HPP_$

with

#ifndef CAFU_\1_HPP_INCLUDED
#define CAFU_\1_HPP_INCLUDED

Closes #91.

Line 
1/*
2=================================================================================
3This file is part of Cafu, the open-source game engine and graphics engine
4for multiplayer, cross-platform, real-time 3D action.
5Copyright (C) 2002-2012 Carsten Fuchs Software.
6
7Cafu is free software: you can redistribute it and/or modify it under the terms
8of the GNU General Public License as published by the Free Software Foundation,
9either version 3 of the License, or (at your option) any later version.
10
11Cafu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13PURPOSE. See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Cafu. If not, see <http://www.gnu.org/licenses/>.
17
18For support and more information about Cafu, visit us at <http://www.cafu.de>.
19=================================================================================
20*/
21
22#ifndef CAFU_EDITOR_MATERIAL_HPP_INCLUDED
23#define CAFU_EDITOR_MATERIAL_HPP_INCLUDED
24
25#include "wx/wx.h"
26
27
28namespace MatSys { class RenderMaterialT; }
29
30class MaterialT;
31class wxDC;
32class wxImage;
33class wxRect;
34
35
36class EditorMaterialI
37{
38    public:
39
40    virtual ~EditorMaterialI() { }
41
42    virtual int GetWidth() const=0;
43    virtual int GetHeight() const=0;
44
45    virtual const wxString& GetName() const=0;
46
47    // Called to draw this texture onto dc into DestRect.
48    // DestRect includes the NameBoxHeight, that is, the intended height of the texture is only DestRect.GetHeight()-NameBoxHeight.
49    // The drawing of the name box (background rectangle + font) is setup by the caller.
50    // On changes, make sure that the previous values for pens, brushes etc. are restored.
51    virtual void Draw(wxDC& dc, const wxRect& DestRect, int NameBoxHeight, bool DrawNameBox) const=0;
52    virtual const wxImage& GetImage() const=0;
53
54    /// Returns the render material of this material.
55    /// @param PreviewMode   If true, the render material for 3D preview mode is returned (as it would appear in Cafu).
56    ///        If false, the render material for the 3D edit mode is returned (derived from the meta_editorImage, better for editing in CaWE).
57    virtual MatSys::RenderMaterialT* GetRenderMaterial(bool PreviewMode) const=0;
58
59    /// Returns the material object.
60    virtual MaterialT* GetMaterial() const=0;
61
62    /// Returns whether this material is rendered translucently.
63    /// Translucent materials are typically implemented with "alpha blending" and require rendering in back-to-front order.
64    /// Classes that derive from MapElementT typically use this to determine the return value for their MapElementT::IsTranslucent() method.
65    /// @see MapElementT::IsTranslucent()
66    virtual bool IsTranslucent() const=0;
67
68    /// Returns whether the material should be shown for selection in the materials browser.
69    /// Useful for letting sprite and model materials out.
70    virtual bool ShowInMaterialBrowser() const=0;
71};
72
73#endif
Note: See TracBrowser for help on using the browser.