libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moShaderCG.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moShaderCG.h
4 
5  ****************************************************************************
6  * *
7  * This source is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This code is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * General Public License for more details. *
16  * *
17  * A copy of the GNU General Public License is available on the World *
18  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19  * obtain it by writing to the Free Software Foundation, *
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  ****************************************************************************
23 
24  Copyright (C) 2006 Fabricio Costa
25 
26  Authors:
27  Fabricio Costa
28 
29 
30  Description:
31  Class for Cg shaders.
32 
33 *******************************************************************************/
34 
35 #ifndef __MO_SHADER_CG_H__
36 #define __MO_SHADER_CG_H__
37 
38 #include "moShader.h"
39 
40 #ifdef SHADER_CG
41 
42 #ifdef MO_MACOSX
43  #include <cg.h>
44  #include <cgGL.h>
45 #else
46  #include <Cg/cg.h>
47  #include <Cg/cgGL.h>
48 #endif
49 
53 class LIBMOLDEO_API moShaderCG : public moShader
54 {
55 public:
59  moShaderCG();
63  ~moShaderCG();
64 
69  virtual MOboolean Init();
74  virtual MOboolean Finish();
75 
80  virtual void CreateVertShader(moText vert_source);
85  virtual void CreateFragShader(moText frag_source);
91  virtual void CreateShader(moText vert_source, moText frag_source);
96  virtual void LoadVertShader(moText vert_filename);
101  virtual void LoadFragShader(moText frag_filename);
108  virtual void LoadShader(moText vert_filename, moText frag_filename);
109 
113  virtual void StartShader();
117  virtual void StopShader();
118 
124  CGparameter GetVertParameter(moText pName);
130  CGparameter GetFragParameter(moText pName);
131 protected:
132  CGcontext m_cgContext;
133  CGprogram m_cgFragmentShader;
134  CGprogram m_cgVertexShader;
135  CGprofile m_cgFragmentProfile;
136  CGprofile m_cgVertexProfile;
137 
138  void compileVertShader(moText vert_source);
139  void compileFragShader(moText frag_source);
140 };
141 
142 #endif
143 
144 #endif
145 
virtual MOboolean Init()
Definition: moShader.cpp:214
#define MOboolean
Definition: moTypes.h:385
virtual void CreateShader(const moText &vert_source, const moText &frag_source)=0
virtual MOboolean Finish()
Definition: moShader.cpp:219
virtual void CreateFragShader(const moText &frag_source)=0
#define LIBMOLDEO_API
Definition: moTypes.h:180
virtual void StartShader()
Definition: moShader.cpp:228
clase de para manejar textos
Definition: moText.h:75
virtual void LoadShader(const moText &vert_filename, const moText &frag_filename)=0
virtual void compileFragShader(const moText &frag_source)=0
virtual void CreateVertShader(const moText &vert_source)=0
virtual void LoadVertShader(const moText &vert_filename)=0
virtual void StopShader()
Definition: moShader.cpp:233
virtual void compileVertShader(const moText &vert_source)=0
virtual void LoadFragShader(const moText &frag_filename)=0