Class: ewol::Program


Synopsis:

+  const char *            getType               (void);
+ int32_t getAttribute (std::string _elementName);
+ void sendAttribute (int32_t _idElem,
int32_t _nbElement,
void * _pointer,
int32_t _jumpBetweenSample);
+ void sendAttributePointer (int32_t _idElem,
int32_t _nbElement,
ewol::VirtualBufferObject * _vbo,
int32_t _index,
int32_t _jumpBetweenSample,
int32_t _offset);
+ int32_t getUniform (std::string _elementName);
+ void uniformMatrix4fv (int32_t _idElem,
int32_t _nbElement,
mat4 _pointer,
bool _transpose);
+ void uniform1f (int32_t _idElem,
float _value1);
+ void uniform2f (int32_t _idElem,
float _value1,
float _value2);
+ void uniform3f (int32_t _idElem,
float _value1,
float _value2,
float _value3);
+ void uniform4f (int32_t _idElem,
float _value1,
float _value2,
float _value3,
float _value4);
+ void uniform1i (int32_t _idElem,
int32_t _value1);
+ void uniform2i (int32_t _idElem,
int32_t _value1,
int32_t _value2);
+ void uniform3i (int32_t _idElem,
int32_t _value1,
int32_t _value2,
int32_t _value3);
+ void uniform4i (int32_t _idElem,
int32_t _value1,
int32_t _value2,
int32_t _value3,
int32_t _value4);
+ void uniform1fv (int32_t _idElem,
int32_t _nbElement,
const float * _value);
+ void uniform2fv (int32_t _idElem,
int32_t _nbElement,
const float * _value);
+ void uniform3fv (int32_t _idElem,
int32_t _nbElement,
const float * _value);
+ void uniform4fv (int32_t _idElem,
int32_t _nbElement,
const float * _value);
+ void uniform1iv (int32_t _idElem,
int32_t _nbElement,
const int32_t * _value);
+ void uniform2iv (int32_t _idElem,
int32_t _nbElement,
const int32_t * _value);
+ void uniform3iv (int32_t _idElem,
int32_t _nbElement,
const int32_t * _value);
+ void uniform4iv (int32_t _idElem,
int32_t _nbElement,
const int32_t * _value);
+ void uniform2 (int32_t _idElem,
const vec2 & _value);
+ void uniform3 (int32_t _idElem,
const vec3 & _value);
+ void uniform4 (int32_t _idElem,
const vec4 & _value);
+ void uniform2 (int32_t _idElem,
const ivec2 & _value);
+ void uniform3 (int32_t _idElem,
const ivec3 & _value);
+ void uniform4 (int32_t _idElem,
const ivec4 & _value);
+ void use (void);
+ void setTexture0 (int32_t _idElem,
GLint _textureOpenGlID);
+ void setTexture1 (int32_t _idElem,
GLint _textureOpenGlID);
+ void unUse (void);
+ void updateContext (void);
+ void removeContext (void);
+ void removeContextToLate (void);
+ void reload (void);
+ static ewol::Program * keep (const std::string & _filename);
+ static void release (ewol::Program * & _object);
# Program (const std::string & filename);
# ~Program (void);

Object Hierarchy:

ewol::EObject
    +--> ewol::Resource
        +--> ewol::Program

Description:

//!< if this element does not exist this is false/** * @brief Program is a compilation of some fragment Shader and vertex Shader. This construct automaticly this assiciation * The input file must have the form : "myFile.prog" * The data is simple : *
* # Comment line ... paid attention at the space at the end of lines, they are considered like a part of the file ...
* # The folder is automaticly get from the program file basic folder
* filename1.vert
* filename2.frag
* filename3.vert
* filename4.frag
* 
*/

Detail:

getType ()

const char * getType(void);

Generic function that get the resouces name of his type.


getAttribute ()

int32_t getAttribute(std::string _elementName);

User request an attribute on this program.
Notes: The attribute is send to the fragment shaders


sendAttribute ()

void sendAttribute(int32_t _idElem,
                   int32_t _nbElement,
                   void * _pointer,
                   int32_t _jumpBetweenSample);

Send attribute table to the spefified ID attribure (not send if does not really exist in the openGL program).


sendAttributePointer ()

void sendAttributePointer(int32_t _idElem,
                          int32_t _nbElement,
                          ewol::VirtualBufferObject * _vbo,
                          int32_t _index,
                          int32_t _jumpBetweenSample,
                          int32_t _offset);



getUniform ()

int32_t getUniform(std::string _elementName);

User request an Uniform on this program.
Notes: uniform value is availlable for all the fragment shader in the program (only one value for all)


uniformMatrix4fv ()

void uniformMatrix4fv(int32_t _idElem,
                      int32_t _nbElement,
                      mat4 _pointer,
                      bool _transpose);

Send a uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform1f ()

void uniform1f(int32_t _idElem,
               float _value1);

Send 1 float uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform2f ()

void uniform2f(int32_t _idElem,
               float _value1,
               float _value2);

Send 2 float uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform3f ()

void uniform3f(int32_t _idElem,
               float _value1,
               float _value2,
               float _value3);

Send 3 float uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform4f ()

void uniform4f(int32_t _idElem,
               float _value1,
               float _value2,
               float _value3,
               float _value4);

Send 4 float uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform1i ()

void uniform1i(int32_t _idElem,
               int32_t _value1);

Send 1 signed integer uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform2i ()

void uniform2i(int32_t _idElem,
               int32_t _value1,
               int32_t _value2);

Send 2 signed integer uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform3i ()

void uniform3i(int32_t _idElem,
               int32_t _value1,
               int32_t _value2,
               int32_t _value3);

Send 3 signed integer uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform4i ()

void uniform4i(int32_t _idElem,
               int32_t _value1,
               int32_t _value2,
               int32_t _value3,
               int32_t _value4);

Send 4 signed integer uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform1fv ()

void uniform1fv(int32_t _idElem,
                int32_t _nbElement,
                const float * _value);

Send "vec1" uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform2fv ()

void uniform2fv(int32_t _idElem,
                int32_t _nbElement,
                const float * _value);

Send "vec2" uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform3fv ()

void uniform3fv(int32_t _idElem,
                int32_t _nbElement,
                const float * _value);

Send "vec3" uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform4fv ()

void uniform4fv(int32_t _idElem,
                int32_t _nbElement,
                const float * _value);

Send "vec4" uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform1iv ()

void uniform1iv(int32_t _idElem,
                int32_t _nbElement,
                const int32_t * _value);

Send "ivec1" uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform2iv ()

void uniform2iv(int32_t _idElem,
                int32_t _nbElement,
                const int32_t * _value);

Send "ivec2" uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform3iv ()

void uniform3iv(int32_t _idElem,
                int32_t _nbElement,
                const int32_t * _value);

Send "ivec3" uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform4iv ()

void uniform4iv(int32_t _idElem,
                int32_t _nbElement,
                const int32_t * _value);

Send "ivec4" uniform element to the spefified ID (not send if does not really exist in the openGL program)


uniform2 ()

void uniform2(int32_t _idElem,
              const vec2 & _value);



uniform3 ()

void uniform3(int32_t _idElem,
              const vec3 & _value);



uniform4 ()

void uniform4(int32_t _idElem,
              const vec4 & _value);



uniform2 ()

void uniform2(int32_t _idElem,
              const ivec2 & _value);



uniform3 ()

void uniform3(int32_t _idElem,
              const ivec3 & _value);



uniform4 ()

void uniform4(int32_t _idElem,
              const ivec4 & _value);



use ()

void use(void);

Request the processing of this program


setTexture0 ()

void setTexture0(int32_t _idElem,
                 GLint _textureOpenGlID);

set the testure Id on the specify uniform element.


setTexture1 ()

void setTexture1(int32_t _idElem,
                 GLint _textureOpenGlID);



unUse ()

void unUse(void);

Stop the processing of this program


updateContext ()

void updateContext(void);

This load/reload the data in the opengl context, needed when removed previously.


removeContext ()

void removeContext(void);

remove the data from the opengl context.


removeContextToLate ()

void removeContextToLate(void);

Special android spec! It inform us that all context is removed and after notify us...


reload ()

void reload(void);

Relode the shader from the file. used when a request of resouces reload is done.
Notes: this is really usefull when we tested the new themes or shader developpements.


ewol::keep ()

static ewol::Program * keep(const std::string & _filename);

keep the resource pointer.
Notes: Never free this pointer by your own...


ewol::release ()

static void release(ewol::Program * & _object);

release the keeped resources


ewol::Program ()

Program(const std::string & filename);

Contructor of an opengl Program.


ewol::~Program ()

~Program(void);

Destructor, remove the current Program.