third_party/virtualbox/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
/**
 * Convert SVGA blend op value to its OpenGL equivalent
 */
Convert SVGA blend op value to its OpenGL equivalent
Convert SVGA blend op value to its OpenGL equivalent
static GLenum vmsvga3dBlendOp2GL(uint32_t blendOp)
{
    switch (blendOp)
    {
    case SVGA3D_BLENDOP_ZERO:
        return GL_ZERO;
    case SVGA3D_BLENDOP_ONE:
        return GL_ONE;
    case SVGA3D_BLENDOP_SRCCOLOR:
        return GL_SRC_COLOR;
    case SVGA3D_BLENDOP_INVSRCCOLOR:
        return GL_ONE_MINUS_SRC_COLOR;
    case SVGA3D_BLENDOP_SRCALPHA:
        return GL_SRC_ALPHA;
    case SVGA3D_BLENDOP_INVSRCALPHA:
        return GL_ONE_MINUS_SRC_ALPHA;
    case SVGA3D_BLENDOP_DESTALPHA:
        return GL_DST_ALPHA;
    case SVGA3D_BLENDOP_INVDESTALPHA:
        return GL_ONE_MINUS_DST_ALPHA;
    case SVGA3D_BLENDOP_DESTCOLOR:
        return GL_DST_COLOR;
    case SVGA3D_BLENDOP_INVDESTCOLOR:
        return GL_ONE_MINUS_DST_COLOR;
    case SVGA3D_BLENDOP_SRCALPHASAT:
        return GL_SRC_ALPHA_SATURATE;
    case SVGA3D_BLENDOP_BLENDFACTOR:
        return GL_CONSTANT_ALPHA;       
    case SVGA3D_BLENDOP_INVBLENDFACTOR:
        return GL_ONE_MINUS_CONSTANT_ALPHA;       
    default:
        AssertFailed();
        return GL_ONE;
    }
}
static GLenum vmsvga3dBlendOp2GL ( uint32_t blendOp ) { switch ( blendOp ) { case SVGA3D_BLENDOP_ZERO : return GL_ZERO ; case SVGA3D_BLENDOP_ONE : return GL_ONE ; case SVGA3D_BLENDOP_SRCCOLOR : return GL_SRC_COLOR ; case SVGA3D_BLENDOP_INVSRCCOLOR : return GL_ONE_MINUS_SRC_COLOR ; case SVGA3D_BLENDOP_SRCALPHA : return GL_SRC_ALPHA ; case SVGA3D_BLENDOP_INVSRCALPHA : return GL_ONE_MINUS_SRC_ALPHA ; case SVGA3D_BLENDOP_DESTALPHA : return GL_DST_ALPHA ; case SVGA3D_BLENDOP_INVDESTALPHA : return GL_ONE_MINUS_DST_ALPHA ; case SVGA3D_BLENDOP_DESTCOLOR : return GL_DST_COLOR ; case SVGA3D_BLENDOP_INVDESTCOLOR : return GL_ONE_MINUS_DST_COLOR ; case SVGA3D_BLENDOP_SRCALPHASAT : return GL_SRC_ALPHA_SATURATE ; case SVGA3D_BLENDOP_BLENDFACTOR : return GL_CONSTANT_ALPHA ; case SVGA3D_BLENDOP_INVBLENDFACTOR : return GL_ONE_MINUS_CONSTANT_ALPHA ; default : AssertFailed ( ) ; return GL_ONE ; } }
Convert SVGA blend op value to its OpenGL equivalent
Convert SVGA blend op value to its OpenGL equivalent
/** @todo correct?? */ /** @todo correct?? */