Thread: [OPENGL] RGBA16 e BGRA16 Textures

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    69

    [OPENGL] RGBA16 e BGRA16 Textures

    How they can be used textures with pixel formats RGBA16 (R5:G5:B5:A1)
    and BGRA16 (B5:G5:R5:A1) in an OpenGL application,
    withouth converting them to RGBA32 ones ?

    I need it for using 16-bit BMP files (which are always BGRA16) as textures ,
    and i prefer not to convert them because the RGBA32
    ones imply heavy texture transfers from/to video memory
    (2 times slower than RGBA16 ones)

  2. #2
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    don't know how universal the support of these is, although i've successfully used 5 6 5 reverse

    Code:
    #define GL_UNSIGNED_BYTE_3_3_2            0x8032
    #define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
    #define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
    #define GL_UNSIGNED_INT_8_8_8_8           0x8035
    #define GL_UNSIGNED_INT_10_10_10_2        0x8036
    #define GL_RESCALE_NORMAL                 0x803A
    #define GL_UNSIGNED_BYTE_2_3_3_REV        0x8362
    #define GL_UNSIGNED_SHORT_5_6_5           0x8363
    #define GL_UNSIGNED_SHORT_5_6_5_REV       0x8364
    #define GL_UNSIGNED_SHORT_4_4_4_4_REV     0x8365
    #define GL_UNSIGNED_SHORT_1_5_5_5_REV     0x8366
    #define GL_UNSIGNED_INT_8_8_8_8_REV       0x8367
    hello, internet!

  3. #3
    Registered User
    Join Date
    Mar 2005
    Posts
    69
    Quote Originally Posted by moi
    don't know how universal the support of these is, although i've successfully used 5 6 5 reverse

    Code:
    #define GL_UNSIGNED_BYTE_3_3_2            0x8032
    #define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
    #define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
    #define GL_UNSIGNED_INT_8_8_8_8           0x8035
    #define GL_UNSIGNED_INT_10_10_10_2        0x8036
    #define GL_RESCALE_NORMAL                 0x803A
    #define GL_UNSIGNED_BYTE_2_3_3_REV        0x8362
    #define GL_UNSIGNED_SHORT_5_6_5           0x8363
    #define GL_UNSIGNED_SHORT_5_6_5_REV       0x8364
    #define GL_UNSIGNED_SHORT_4_4_4_4_REV     0x8365
    #define GL_UNSIGNED_SHORT_1_5_5_5_REV     0x8366
    #define GL_UNSIGNED_INT_8_8_8_8_REV       0x8367
    perhaps ,for using 16 bit RGBA textures i have to call glTexImage2D as this
    Code:
    #define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
    
    glTexImage2D(GL_TEXTURE_2D,GL_RGBA_16,width,height,
                           border,GL_RGBA,GL_UNSIGNED_SHORT,pixels);
    
    // or GL_UNSIGNED_SHORT_5_5_5_1 instead of GL_UNSIGNED_SHORT
    ok thank you
    Last edited by Lionel; 03-03-2006 at 06:12 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Textures
    By fighter92 in forum Game Programming
    Replies: 1
    Last Post: 03-21-2009, 10:57 AM
  2. loading textures from resources (dx8/9)
    By X PaYnE X in forum Game Programming
    Replies: 1
    Last Post: 12-25-2005, 04:44 PM
  3. OpenGL, loading BMP Textures?
    By Zeusbwr in forum Game Programming
    Replies: 12
    Last Post: 12-09-2004, 05:16 PM
  4. the effects of textures on my frame rate
    By DavidP in forum Game Programming
    Replies: 37
    Last Post: 10-03-2003, 11:24 AM
  5. Q3A textures
    By glUser3f in forum Game Programming
    Replies: 11
    Last Post: 09-04-2003, 03:40 AM