Changeset 1116

Show
Ignore:
Timestamp:
09/15/08 15:03:07
Author:
dan
Message:

ALPHA texture support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libs/opengl/api/opengl/GL.hx

    r1112 r1116  
    918918 
    919919        /** <nekobind><cptr name="pixels" type="unsigned char" min-size="(width*height)"/></nekobind> **/ 
     920        public static function texSubImageALPHA( target:Int, x:Int, y:Int, width:Int, height:Int, pixels:Dynamic ) :Void; 
     921 
     922        /** <nekobind><cptr name="pixels" type="unsigned char" min-size="(width*height)"/></nekobind> **/ 
    920923        public static function texImageClearFT( target:Int, width:Int, height:Int ) :Void; 
    921924         
  • trunk/libs/opengl/src/additions.c

    r1031 r1116  
    3737        GL_LUMINANCE, GL_UNSIGNED_BYTE, (unsigned char *)data ); 
    3838   // glPopClientAttrib();     
     39} 
     40 
     41void glTexSubImageALPHA( unsigned int tex, int x, int y, int w, int h, const unsigned char *data ) { 
     42    glTexSubImage2D( GL_TEXTURE_2D, 0, x, y, w, h, 
     43        GL_ALPHA, GL_UNSIGNED_BYTE, (unsigned char *)data ); 
    3944} 
    4045 
  • trunk/xinf/inity/ColorSpace.hx

    r1036 r1116  
    1010        BGRA; 
    1111        GRAY; 
     12        ALPHA; 
    1213        Other(depth:Int,channels:Int); 
    1314} 
     
    1819                return 
    1920                        switch( cs ) { 
    20                                 case RGB
     21                                case RGB,BGR
    2122                                        width*3; 
    22                                 case RGBA
     23                                case RGBA,BGRA
    2324                                        width*4; 
    24                                 case BGR: 
    25                                         width*3; 
    26                                 case BGRA: 
    27                                         width*4; 
    28                                 case GRAY: 
     25                                case GRAY,ALPHA: 
    2926                                        width; 
    3027                                case Other(d,c): 
  • trunk/xinf/inity/Texture.hx

    r1063 r1116  
    4949                                case BGRA: GL.RGBA; 
    5050                                case GRAY: GL.LUMINANCE; 
     51                                case ALPHA:  
     52                                        trace("INTENSITY!"); GL.INTENSITY; 
    5153                                default: GL.RGBA; 
    5254                        } 
     
    8890                                case GRAY: 
    8991                                        GL.texSubImageGRAY( texture, pos.x, pos.y, size.x, size.y, data ); 
     92                                case ALPHA: 
     93                                        GL.texSubImageALPHA( texture, pos.x, pos.y, size.x, size.y, data ); 
    9094                                default: 
    9195                                        throw("unknown colorspace "+cspace );