Exemplo n.º 1
0
 bool CgDxShader::setTextureVariable(const char* name, const TexturePtr& tex) {
     if(mProgram && tex) {
         CGparameter param = cgGetNamedParameter(mProgram, name);
         if(_check_error(mContext) && param) {
             cgD3D11SetTextureParameter(param, (ID3D11Resource*)tex->getTextureId());
             return _check_error(mContext);
         }
     }
     return false;
 }
Exemplo n.º 2
0
 bool CgGLShader::setTextureVariable(const char* name, const TexturePtr& tex) {
     if(mProgram && tex) {
         CGparameter param = cgGetNamedParameter(mProgram, name);
         if(_check_error(mContext) && param) {
             cgGLSetTextureParameter(param, (GLuint)tex->getTextureId());
             cgSetSamplerState(param);
             return _check_error(mContext);
         }
     }
     return false;
 }
Exemplo n.º 3
0
void Framebuffer::texture(
      const TexturePtr& texture,
      const AttachmentType& attachment,
      const GLint& level,
      const GLint& layer)
{
   //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, renderTex, 0);
   if(texture->getTarget() == Texture::Texture2D) {
      glFramebufferTexture2D(getTarget(), attachment, texture->getTarget(), texture->getTextureId(), 0);
   }

}