STATE_bitmap_set_default_format

 

 



  The constans below are for advanced use with the function STATE_bitmap_set_default_format()
#ifndef MAKEFOURCC
    #define MAKEFOURCC(ch0, ch1, ch2, ch3)                              \
                ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |       \
                ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
#endif /* defined(MAKEFOURCC)   
#define BITMAP_FORMAT_UNKNOWN                0
#define BITMAP_FORMAT_R8G8B8                20
#define BITMAP_FORMAT_A8R8G8B8              21
#define BITMAP_FORMAT_X8R8G8B8              22
#define BITMAP_FORMAT_R5G6B5                23
#define BITMAP_FORMAT_X1R5G5B5              24
#define BITMAP_FORMAT_A1R5G5B5              25
#define BITMAP_FORMAT_A4R4G4B4              26
#define BITMAP_FORMAT_R3G3B2                27
#define BITMAP_FORMAT_A8                    28
#define BITMAP_FORMAT_A8R3G3B2              29
#define BITMAP_FORMAT_X4R4G4B4              30
#define BITMAP_FORMAT_A2B10G10R10           31
#define BITMAP_FORMAT_A8B8G8R8              32
#define BITMAP_FORMAT_X8B8G8R8              33
#define BITMAP_FORMAT_G16R16                34
#define BITMAP_FORMAT_A2R10G10B10           35
#define BITMAP_FORMAT_A16B16G16R16          36
#define BITMAP_FORMAT_A8P8                  40
#define BITMAP_FORMAT_P8                    41
#define BITMAP_FORMAT_L8                    50
#define BITMAP_FORMAT_A8L8                  51
#define BITMAP_FORMAT_A4L4                  52
#define BITMAP_FORMAT_V8U8                  60
#define BITMAP_FORMAT_L6V5U5                61
#define BITMAP_FORMAT_X8L8V8U8              62
#define BITMAP_FORMAT_Q8W8V8U8              63
#define BITMAP_FORMAT_V16U16                64
#define BITMAP_FORMAT_A2W10V10U10           67
#define BITMAP_FORMAT_UYVY                  MAKEFOURCC('U' 'Y' 'V' 'Y')
#define BITMAP_FORMAT_R8G8_B8G8             MAKEFOURCC('R' 'G' 'B' 'G')
#define BITMAP_FORMAT_YUY2                  MAKEFOURCC('Y' 'U' 'Y' '2')
#define BITMAP_FORMAT_G8R8_G8B8             MAKEFOURCC('G' 'R' 'G' 'B')
#define BITMAP_FORMAT_DXT1                  MAKEFOURCC('D' 'X' 'T' '1')
#define BITMAP_FORMAT_DXT2                  MAKEFOURCC('D' 'X' 'T' '2')
#define BITMAP_FORMAT_DXT3                  MAKEFOURCC('D' 'X' 'T' '3')
#define BITMAP_FORMAT_DXT4                  MAKEFOURCC('D' 'X' 'T' '4')
#define BITMAP_FORMAT_DXT5                  MAKEFOURCC('D' 'X' 'T' '5')
#define BITMAP_FORMAT_D16_LOCKABLE          70
#define BITMAP_FORMAT_D32                   71
#define BITMAP_FORMAT_D15S1                 73
#define BITMAP_FORMAT_D24S8                 75
#define BITMAP_FORMAT_D24X8                 77
#define BITMAP_FORMAT_D24X4S4               79
#define BITMAP_FORMAT_D16                   80
#define BITMAP_FORMAT_D32F_LOCKABLE         82
#define BITMAP_FORMAT_D24FS8                83


#define BITMAP_FORMAT_L16                   81

#define BITMAP_FORMAT_VERTEXDATA           100
#define BITMAP_FORMAT_INDEX16              101
#define BITMAP_FORMAT_INDEX32              102

#define BITMAP_FORMAT_Q16W16V16U16         110

#define BITMAP_FORMAT_MULTI2_ARGB8         MAKEFOURCC('M','E','T','1')

   Floating point surface formats

   s10e5 formats (16-bits per channel)
#define BITMAP_FORMAT_R16F                  111
#define BITMAP_FORMAT_G16R16F               112
#define BITMAP_FORMAT_A16B16G16R16F         113

   IEEE s23e8 formats (32-bits per channel)
#define BITMAP_FORMAT_R32F                  114
#define BITMAP_FORMAT_G32R32F               115
#define BITMAP_FORMAT_A32B32G32R32F         116
#define BITMAP_FORMAT_CxV8U8                117


   *** advanced function
   Set the format in which the loaded bitmaps will be converted to
   Bitmaps that were loaded with transparent_index different then -1 are not effected
   by this function.
   All bitmaps loaded after calling this function will be stored in the given format.
   To make all the bitmaps of a world use the given format, call this function before loading
   the world.
   Note that if STATE_bitmap_set_default_format() is called twice or more before the first render
   then only the last call will have effect. 
   
   The default format is BITMAP_FORMAT_DXT1 (which is a compressed format)
  
   Q: What do I need this function for ?
  
   A: Here is an example. If you want for example to control the transparency area of 
  	  a given polygon accuratelly using the alpha channel 
  	  then call this function with BITMAP_FORMAT_A8R8G8B8
  	  This will make all the bitmaps that are loaded after this call be in 32 bit format where
  	  the high order byte is used for alpha. Call STATE_polygon_translucency() with the polygon that
  	  uses the bitmap and select a translucensy mode that uses the texture alpha channel
  
   Example:
  		STATE_bitmap_set_default_format(BITMAP_FORMAT_A8R8G8B8);   setting to 32 bit format with alpha channel

 

 

Go to page 1      Select API

 

Copyright © 2007 3DSTATE Corporation. www.3dstate.com