1 /******************************************************************************
2 * Arachnoid Graphics Plugin for Mupen64Plus
3 * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
5 * Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *****************************************************************************/
22 #ifndef COMBINER_BASE_H_
23 #define COMBINER_BASE_H_
25 #include "CombinerStructs.h"
27 //Forward declarations
28 struct TexEnvCombiner;
30 //*****************************************************************************
32 //! Base class and interface for combiners
33 //! @see AdvancedTexEnvCombiner
34 //! @see SimpleTexEnvCombiner
35 //! @see DummyCombiner
36 //*****************************************************************************
41 //Constructor / Destructor
46 void setFillColor(float r, float g, float b, float a);
47 void setBlendColor(float r, float g, float b, float a);
48 void setPrimColor(float r, float g, float b, float a);
49 void setEnvColor(float r, float g, float b, float a);
52 void setPrimLodMin(unsigned int primLodMin) { m_primLodMin = primLodMin; };
53 void setPrimLodFrac(float primLodFrac) { m_primLodFrac = primLodFrac; };
61 //! @retval float* Returns blend color as <r,g,b,a> channels (0.0-1.0)
62 float* getBlendColor() { return m_blendColor; };
65 //! @retval float* Returns fill color as <r,g,b,a> channels (0.0-1.0)
66 float* getFillColor() { return m_fillColor; };
69 //! @retval float* Returns prim color as <r,g,b,a> channels (0.0-1.0)
70 float* getPrimColor() { return m_primColor; };
72 //! Get Environment Color
73 //! @retval float* Returns environment color as <r,g,b,a> channels (0.0-1.0)
74 float* getEnvColor() { return m_envColor; };
77 void getCombinerColor(float out[4], short colorSource, short alphaSource);
85 //! Used to initialize combiner
86 virtual void initialize() = 0;
88 //* Begin Texture Environment
89 //! Called before texture channels are updated in the RDP
90 virtual void beginTextureUpdate() = 0;
92 //* End Texture Environment
93 //! Called before texture channels are updated in the RDP
94 //! @param[in] texEnv Texture environment with textures channels to be enabled
95 virtual void endTextureUpdate(TexEnvCombiner* texEnv) = 0;
97 //* Set Texture Environment Colors
98 //! Used to send combiner color to graphics API
99 virtual void setTextureEnviromentColors(TexEnvCombiner* texEnv) = 0;
101 //* Set Texture Environment Environment
102 //! Used to enable textureing and set texture enviromnent for graphics API
103 //! @param[in] texEnv Texture environment with input data to graphics API
104 virtual void setTextureEnviroment(TexEnvCombiner* texEnv) = 0;
106 //* Create New Texture Enviornment
107 //! Allocates a new texture enviroment
108 //! @param[in] colorCombiner How to combine and get a color
109 //! @param[in] alphaCombiner How to combine and get an alpha value
110 //! @return The texture enviroment that was created
111 virtual TexEnvCombiner* createNewTextureEnviroment(Combiner* colorCombiner, Combiner *alphaCombiner) = 0;
115 CombineData m_combineData;
118 float m_fillColor[4] ; //!< <r,g,b,a>
119 float m_blendColor[4]; //!< <r,g,b,a>
120 float m_primColor[4]; //!< <r,g,b,a>
121 float m_envColor[4]; //!< <r,g,b,a>
124 unsigned int m_primLodMin;