Paste number 82960: sub texture

Paste number 82960: sub texture
Pasted by: vade
When:8 months, 1 week ago
Share:Tweet this! | http://paste.lisp.org/+1S0G
Channel:#openemu
Paste contents:
Raw Source | XML | Display As
- (void)uploadGameBufferToTexture
{
	// only do a texture submit if we have a new frame...
    if([gameCore frameFinished])
    {    
        // update our gamebuffer texture
        glEnable(GL_TEXTURE_RECTANGLE_EXT);
        glBindTexture(GL_TEXTURE_RECTANGLE_EXT, gameTexture);
        
        // this is 'optimal'
        //glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, [gameCore width], [gameCore height], GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, [gameCore videoBuffer]);

        // this definitely works

    
        glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, someRandomXoffSet, someRandomYOffset, [gameCore width], [gameCore height], [gameCore pixelFormat], [gameCore pixelType], [gameCore videoBuffer]); 
    }
}

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.