/* Copyright (C) 2003 Rice1964 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _OGLEXT_COMBINER_H_ #define _OGLEXT_COMBINER_H_ #include "OGLCombiner.h" #include "GL/gl.h" typedef struct { BYTE arg0; BYTE arg1; BYTE arg2; } OGLExt1CombType; typedef struct { union { struct { GLenum rgbOp; GLenum alphaOp; }; GLenum ops[2]; }; union { struct { BYTE rgbArg0; BYTE rgbArg1; BYTE rgbArg2; BYTE alphaArg0; BYTE alphaArg1; BYTE alphaArg2; }; OGLExt1CombType Combs[2]; }; //float scale; //Will not be used } OGLExtCombinerType; typedef struct { DWORD dwMux0; DWORD dwMux1; OGLExtCombinerType units[8]; int numOfUnits; } OGLExtCombinerSaveType; //======================================================================== class COGLExtColorCombiner : public COGLColorCombiner { public: bool Initialize(void); protected: friend class OGLDeviceBuilder; void InitCombinerCycle12(void); void InitCombinerCycleFill(void); COGLExtColorCombiner(CDaedalusRender *pRender); ~COGLExtColorCombiner() {}; bool m_bOGLExtCombinerSupported; // Is this OGL extension combiner supported by the video card driver? bool m_bSupportModAdd_ATI; bool m_bSupportModSub_ATI; int m_maxTexUnits; int m_lastIndex; DWORD m_dwLastMux0; DWORD m_dwLastMux1; #ifdef _DEBUG void DisplaySimpleMuxString(void); #endif private: std::vector m_vCompiledSettings; virtual int ParseDecodedMux(); virtual int ParseDecodedMux2Units(); virtual int SaveParsedResult(OGLExtCombinerSaveType &result); virtual int FindCompiledMux(); virtual void GenerateCombinerSetting(int index); virtual void GenerateCombinerSettingConstants(int index); static GLenum MapRGBArgs(BYTE arg); static GLenum MapRGBArgFlags(BYTE arg); static GLenum MapAlphaArgs(BYTE arg); static GLenum MapAlphaArgFlags(BYTE arg); static GLenum RGBArgsMap[]; static const char* GetOpStr(GLenum op); }; #endif