Rice GLES2 (from mupen64plus-ae) plugin. Compile but doesn't works well on the OpenPa...
[mupen64plus-pandora.git] / source / gles2rice / src / OGLES2FragmentShaders.h
CommitLineData
292f9317 1/*
2Copyright (C) 2005 Rice1964
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17*/
18
19#ifndef _OGL_FRAGMENT_SHADER_H_
20#define _OGL_FRAGMENT_SHADER_H_
21
22#include <vector>
23
24#include "osal_opengl.h"
25
26#include "OGLCombiner.h"
27#include "OGLExtCombiner.h"
28#include "GeneralCombiner.h"
29
30typedef struct {
31 uint32 dwMux0;
32 uint32 dwMux1;
33
34 bool fogIsUsed;
35 bool alphaTest;
36 GLuint fragmentShaderID;
37 GLuint vertexShaderID;
38 GLuint programID;
39
40 GLint PrimColorLocation;
41 GLint EnvColorLocation;
42 GLint PrimFracLocation;
43 GLint EnvFracLocation;
44 GLint AlphaRefLocation;
45 GLint FogColorLocation;
46 GLint FogMinMaxLocation;
47
48} OGLShaderCombinerSaveType;
49
50
51class COGL_FragmentProgramCombiner : public COGLColorCombiner4
52{
53public:
54 bool Initialize(void);
55 float m_AlphaRef;
56 void UpdateFog(bool bEnable);
57
58protected:
59 friend class OGLDeviceBuilder;
60
61 void DisableCombiner(void);
62 void InitCombinerCycleCopy(void);
63 void InitCombinerCycleFill(void);
64 void InitCombinerCycle12(void);
65
66 COGL_FragmentProgramCombiner(CRender *pRender);
67 ~COGL_FragmentProgramCombiner();
68
69 bool m_bFragmentProgramIsSupported;
70 std::vector<OGLShaderCombinerSaveType> m_vCompiledShaders;
71
72private:
73 virtual int ParseDecodedMux();
74 virtual void GenerateProgramStr();
75 int FindCompiledMux();
76 virtual void GenerateCombinerSetting(int index);
77 virtual void GenerateCombinerSettingConstants(int index);
78
79#ifdef DEBUGGER
80 void DisplaySimpleMuxString(void);
81#endif
82
83};
84
85
86
87class COGLFragmentShaderCombiner : public COGLColorCombiner
88{
89public:
90 bool Initialize(void);
91 void InitCombinerBlenderForSimpleTextureDraw(uint32 tile=0);
92protected:
93 friend class OGLDeviceBuilder;
94
95 void DisableCombiner(void);
96 void InitCombinerCycleCopy(void);
97 void InitCombinerCycleFill(void);
98 void InitCombinerCycle12(void);
99
100 COGLFragmentShaderCombiner(CRender *pRender);
101 ~COGLFragmentShaderCombiner();
102
103 bool m_bShaderIsSupported;
104
105#ifdef DEBUGGER
106 void DisplaySimpleMuxString(void);
107#endif
108
109};
110
111
112#endif
113