[DEBUG] add resource::Program id checker
This commit is contained in:
parent
86fa583a55
commit
0d23654379
@ -50,9 +50,6 @@ void main(void) {
|
|||||||
specularLight = pow(ecNormalDotLightHalfplane, EW_material.shininess) * EW_directionalLight.specularColor * EW_material.specularFactor;
|
specularLight = pow(ecNormalDotLightHalfplane, EW_material.shininess) * EW_directionalLight.specularColor * EW_material.specularFactor;
|
||||||
specularLight = EW_directionalLight.specularColor * EW_material.specularFactor;
|
specularLight = EW_directionalLight.specularColor * EW_material.specularFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vec4 light = ambientLight + diffuseLight + specularLight;
|
vec4 light = ambientLight + diffuseLight + specularLight;
|
||||||
|
|
||||||
gl_FragColor = tmpElementColor * light;
|
gl_FragColor = tmpElementColor * light;
|
||||||
}
|
}
|
||||||
|
2
external/ege
vendored
2
external/ege
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 714662d7a923c7c451b1a02a636c8c0e3fefce5c
|
Subproject commit e0f0c1d65b779382b3a3fd793fb074e377c9a5bc
|
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
|||||||
Subproject commit f04c3dd23829c63e383d0b4988198e6db2847539
|
Subproject commit 4b3cdf01560a946189388870242a86484144863d
|
@ -329,19 +329,19 @@ void ewol::openGL::updateAllFlags() {
|
|||||||
#endif
|
#endif
|
||||||
// check if fhags has change :
|
// check if fhags has change :
|
||||||
if (l_flagsMustBeSet == l_flagsCurrent ) {
|
if (l_flagsMustBeSet == l_flagsCurrent ) {
|
||||||
//EWOL_INFO("real flag set : " << l_flagsMustBeSet << " " << l_flagsCurrent);
|
EWOL_INFO("OGL: current flag : " << (enum openGL::openGlFlags)l_flagsMustBeSet);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//EWOL_INFO("real flag set : " << l_flagsMustBeSet);
|
EWOL_INFO("OGL: set new flag : " << (enum openGL::openGlFlags)l_flagsMustBeSet);
|
||||||
for (int32_t iii=0; iii<basicFlagCount ; iii++) {
|
for (int32_t iii=0; iii<basicFlagCount ; iii++) {
|
||||||
uint32_t CurrentFlag = basicFlag[iii].curentFlag;
|
uint32_t CurrentFlag = basicFlag[iii].curentFlag;
|
||||||
if ( (l_flagsMustBeSet&CurrentFlag)!=(l_flagsCurrent&CurrentFlag) ) {
|
if ( (l_flagsMustBeSet&CurrentFlag)!=(l_flagsCurrent&CurrentFlag) ) {
|
||||||
if ( (l_flagsMustBeSet&CurrentFlag) != 0) {
|
if ( (l_flagsMustBeSet&CurrentFlag) != 0) {
|
||||||
glEnable(basicFlag[iii].OGlFlag);
|
glEnable(basicFlag[iii].OGlFlag);
|
||||||
//EWOL_INFO(" enable : " << basicFlag[iii].OGlFlag);
|
EWOL_INFO(" enable : " << (enum openGL::openGlFlags)basicFlag[iii].curentFlag);
|
||||||
} else {
|
} else {
|
||||||
glDisable(basicFlag[iii].OGlFlag);
|
glDisable(basicFlag[iii].OGlFlag);
|
||||||
//EWOL_INFO(" disable : " << basicFlag[iii].OGlFlag);
|
EWOL_INFO(" disable : " << (enum openGL::openGlFlags)basicFlag[iii].curentFlag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,6 +116,14 @@ static void checkGlError(const char* _op, int32_t _localLine) {
|
|||||||
#define LOG_OGL_INTERNAL_BUFFER_LEN (8192)
|
#define LOG_OGL_INTERNAL_BUFFER_LEN (8192)
|
||||||
static char l_bufferDisplayError[LOG_OGL_INTERNAL_BUFFER_LEN] = "";
|
static char l_bufferDisplayError[LOG_OGL_INTERNAL_BUFFER_LEN] = "";
|
||||||
|
|
||||||
|
bool ewol::resource::Program::checkIdValidity(int32_t _idElem) {
|
||||||
|
if ( _idElem < 0
|
||||||
|
|| (size_t)_idElem > m_elementList.size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return m_elementList[_idElem].m_isLinked;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t ewol::resource::Program::getAttribute(std::string _elementName) {
|
int32_t ewol::resource::Program::getAttribute(std::string _elementName) {
|
||||||
// check if it exist previously :
|
// check if it exist previously :
|
||||||
for(size_t iii=0; iii<m_elementList.size(); iii++) {
|
for(size_t iii=0; iii<m_elementList.size(); iii++) {
|
||||||
|
@ -68,6 +68,12 @@ namespace ewol {
|
|||||||
*/
|
*/
|
||||||
virtual ~Program();
|
virtual ~Program();
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Check If an Id is valid in the shader or not (sometime the shader have not some attribute, then we need to display some error)
|
||||||
|
* @return _idElem Id of the Attribute that might be sended.
|
||||||
|
* @return true The id is valid, false otherwise
|
||||||
|
*/
|
||||||
|
bool checkIdValidity(int32_t _idElem);
|
||||||
/**
|
/**
|
||||||
* @brief User request an attribute on this program.
|
* @brief User request an attribute on this program.
|
||||||
* @note The attribute is send to the fragment shaders
|
* @note The attribute is send to the fragment shaders
|
||||||
|
Loading…
x
Reference in New Issue
Block a user