Helloo ppl.
I am trying to make an sample application that uses CGEffect. I could successfully set/ read value inside fragment when i used the following code to set the texture.
AUX_RGBImageRec *pTextureImage = auxDIBImageLoad( ".\\test.bmp" );
glGenTextures(1, &g_testTextureID);
glBindTexture(GL_TEXTURE_2D, g_testTextureID);
CGparameter p = cgGetNamedEffectParameter(effect,"samp");
cgGLSetTextureParameter(p, g_testTextureID);
cgSetSamplerState(p);
glTexImage2D( GL_TEXTURE_2D, 0, 3, pTextureImage->sizeX, pTextureImage->sizeY, 0,GL_RGB, GL_UNSIGNED_BYTE,pTextureImage->data );
But when i tried to load texture data just after the glBindTexture call and then settextureparameter its not working.
I mean why does the below sequence doent work???
glGenTextures(....)
glTexImage2D(....)
cgGetNamedEffectParameter(...)
cgGLSetTextureParameter(....)
cgSetSamplerState(...)
And also i found awfully lesser number of samples in the net tat used CGEffect/It would be big help if someone tell me some links
Thank u
I am trying to make an sample application that uses CGEffect. I could successfully set/ read value inside fragment when i used the following code to set the texture.
AUX_RGBImageRec *pTextureImage = auxDIBImageLoad( ".\\test.bmp" );
glGenTextures(1, &g_testTextureID);
glBindTexture(GL_TEXTURE_2D, g_testTextureID);
CGparameter p = cgGetNamedEffectParameter(effect,"samp");
cgGLSetTextureParameter(p, g_testTextureID);
cgSetSamplerState(p);
glTexImage2D( GL_TEXTURE_2D, 0, 3, pTextureImage->sizeX, pTextureImage->sizeY, 0,GL_RGB, GL_UNSIGNED_BYTE,pTextureImage->data );
But when i tried to load texture data just after the glBindTexture call and then settextureparameter its not working.
I mean why does the below sequence doent work???
glGenTextures(....)
glTexImage2D(....)
cgGetNamedEffectParameter(...)
cgGLSetTextureParameter(....)
cgSetSamplerState(...)
And also i found awfully lesser number of samples in the net tat used CGEffect/It would be big help if someone tell me some links
Thank u