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.
Return: The define char of his name.
getAttribute ()
int32_t getAttribute(std::string _elementName);
User request an attribute on this program.
Notes: The attribute is send to the fragment shaders
Parameter [input]: _elementName Name of the requested attribute.
Return: An abstract ID of the current attribute (this value is all time availlable, even if the program will be reloaded)
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).
Parameter [input]: _idElem Id of the Attribute that might be sended.
Parameter [input]: _nbElement Specifies the number of elements that are to be modified.
Parameter [input]: _pointer Pointer on the data that might be sended.
Parameter [input]: _jumpBetweenSample Number of byte to jump between 2 vertex (this permit to enterlace informations)
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)
Parameter [input]: _elementName Name of the requested uniform.
Return: An abstract ID of the current uniform (this value is all time availlable, even if the program will be reloaded)
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Specifies the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array.
Parameter [input]: _pointer Pointer on the data that might be sended
Parameter [input]: _transpose Transpose the matrix (needed all the taime in the normal openGl access (only not done in the openGL-ES2 due to the fact we must done it ourself)
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
Parameter [input]: _value3 Value to send at the Uniform
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
Parameter [input]: _value3 Value to send at the Uniform
Parameter [input]: _value4 Value to send at the Uniform
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
Parameter [input]: _value3 Value to send at the Uniform
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
Parameter [input]: _value3 Value to send at the Uniform
Parameter [input]: _value4 Value to send at the Uniform
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
Parameter [input]: _idElem Id of the Attribute that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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.
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _textureOpenGlID Real openGL texture ID
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...
Parameter [input]: _filename Name of the openGL program.
Return: pointer on the resource or NULL if an error occured.
ewol::release ()
static void release(ewol::Program * & _object);
release the keeped resources
Parameter [input] [output]: reference on the object pointer
ewol::Program ()
Program(const std::string & filename);
Contructor of an opengl Program.
Parameter [input]: filename Standard file name format. see
ewol::~Program ()
~Program(void);
Destructor, remove the current Program.
getType ()
const char * getType(void);
Generic function that get the resouces name of his type.
-
Return: The define char of his name.
getAttribute ()
int32_t getAttribute(std::string _elementName);
User request an attribute on this program.
Notes: The attribute is send to the fragment shaders
-
Parameter [input]: _elementName Name of the requested attribute.
Return: An abstract ID of the current attribute (this value is all time availlable, even if the program will be reloaded)
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).
-
Parameter [input]: _idElem Id of the Attribute that might be sended.
Parameter [input]: _nbElement Specifies the number of elements that are to be modified.
Parameter [input]: _pointer Pointer on the data that might be sended.
Parameter [input]: _jumpBetweenSample Number of byte to jump between 2 vertex (this permit to enterlace informations)
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)
-
Parameter [input]: _elementName Name of the requested uniform.
Return: An abstract ID of the current uniform (this value is all time availlable, even if the program will be reloaded)
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Specifies the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array.
Parameter [input]: _pointer Pointer on the data that might be sended
Parameter [input]: _transpose Transpose the matrix (needed all the taime in the normal openGl access (only not done in the openGL-ES2 due to the fact we must done it ourself)
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
Parameter [input]: _value3 Value to send at the Uniform
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
Parameter [input]: _value3 Value to send at the Uniform
Parameter [input]: _value4 Value to send at the Uniform
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
Parameter [input]: _value3 Value to send at the Uniform
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _value1 Value to send at the Uniform
Parameter [input]: _value2 Value to send at the Uniform
Parameter [input]: _value3 Value to send at the Uniform
Parameter [input]: _value4 Value to send at the Uniform
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
-
Parameter [input]: _idElem Id of the Attribute that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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)
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _nbElement Number of element sended
Parameter [input]: _value Pointer on the data
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.
-
Parameter [input]: _idElem Id of the uniform that might be sended.
Parameter [input]: _textureOpenGlID Real openGL texture ID
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...
-
Parameter [input]: _filename Name of the openGL program.
Return: pointer on the resource or NULL if an error occured.
ewol::release ()
static void release(ewol::Program * & _object);
release the keeped resources
-
Parameter [input] [output]: reference on the object pointer
ewol::Program ()
Program(const std::string & filename);
Contructor of an opengl Program.
-
Parameter [input]: filename Standard file name format. see
ewol::~Program ()
~Program(void);
Destructor, remove the current Program.