Patch for Adding GL_ALPHA support

2006-12-20
2013-05-02
  • If someone with more of a clue then me could add this to the code base it would be great.
    I used it for hooking FreeType and OpenIL together.

    chrisd AT plaidworld com

    // HERE

    in "il.h"

    // Matches OpenGL's right now.
    #define IL_COLOUR_INDEX     0x1900
    #define IL_COLOR_INDEX      0x1900

    // ADDED FOR GL ALPHA SUPPORT - CSD
    #define IL_ALPHA            0x1906

    #define IL_RGB              0x1907
    #define IL_RGBA             0x1908
    #define IL_BGR              0x80E0
    #define IL_BGRA             0x80E1
    #define IL_LUMINANCE        0x1909
    #define IL_LUMINANCE_ALPHA  0x190A

    // AND

    ILenum ilutGLFormat(ILenum Format, ILubyte Bpp)
    {
        if (Format == IL_RGB || Format == IL_BGR) {
            if (ilutIsEnabled(ILUT_OPENGL_CONV)) {
                return GL_RGB8;
            }
        }
        else if (Format == IL_RGBA || Format == IL_BGRA) {
            if (ilutIsEnabled(ILUT_OPENGL_CONV)) {
                return GL_RGBA8;
            }
        }
       
        // ADDED FOR GL ALPHA SUPPORT - CSD //
        if (Format == IL_ALPHA ) {
            if (ilutIsEnabled(ILUT_OPENGL_CONV)) {
                return GL_ALPHA;
            }
        }

        return Bpp;
    }

     
    • Denton Woods
      Denton Woods
      2009-01-08

      Way late like everything else with me being away from DevIL for years, but I just wanted to point out that IL_ALPHA is valid now.