Exemplo n.º 1
0
ImagePtr create_image_from_texture(const gl::Texture &the_texture)
{
    ImagePtr ret;
    if(!the_texture){ return ret; }
#if !defined(KINSKI_GLES)
    ret = Image::create(the_texture.width(), the_texture.height(), 4);
    the_texture.bind();
    glGetTexImage(the_texture.target(), 0, GL_RGBA, GL_UNSIGNED_BYTE, ret->data);
    ret->flip();
#endif
    return ret;
}