mirror of
https://github.com/raysan5/raylib.git
synced 2025-11-22 01:56:17 +00:00
Improved pixel formats support
- Renamed enum TextureFormat to PixelFormat for consistency - Added support for pixel format UNCOMPRESSED_R32 - Using GetPixelDataSize() where required
This commit is contained in:
15
src/raylib.h
15
src/raylib.h
@@ -341,7 +341,7 @@ typedef struct Image {
|
||||
int width; // Image base width
|
||||
int height; // Image base height
|
||||
int mipmaps; // Mipmap levels, 1 by default
|
||||
int format; // Data format (TextureFormat type)
|
||||
int format; // Data format (PixelFormat type)
|
||||
} Image;
|
||||
|
||||
// Texture2D type
|
||||
@@ -351,7 +351,7 @@ typedef struct Texture2D {
|
||||
int width; // Texture base width
|
||||
int height; // Texture base height
|
||||
int mipmaps; // Mipmap levels, 1 by default
|
||||
int format; // Data format (TextureFormat type)
|
||||
int format; // Data format (PixelFormat type)
|
||||
} Texture2D;
|
||||
|
||||
// RenderTexture2D type, for texture rendering
|
||||
@@ -571,18 +571,19 @@ typedef enum {
|
||||
#define MAP_DIFFUSE MAP_ALBEDO
|
||||
#define MAP_SPECULAR MAP_METALNESS
|
||||
|
||||
// Texture formats
|
||||
// Pixel formats
|
||||
// NOTE: Support depends on OpenGL version and platform
|
||||
typedef enum {
|
||||
UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha)
|
||||
UNCOMPRESSED_GRAY_ALPHA, // 16 bpp (2 channels)
|
||||
UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels)
|
||||
UNCOMPRESSED_R5G6B5, // 16 bpp
|
||||
UNCOMPRESSED_R8G8B8, // 24 bpp
|
||||
UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha)
|
||||
UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha)
|
||||
UNCOMPRESSED_R8G8B8A8, // 32 bpp
|
||||
UNCOMPRESSED_R32G32B32, // 32 bit per channel (float) - HDR
|
||||
UNCOMPRESSED_R32G32B32A32, // 32 bit per channel (float) - HDR
|
||||
UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
|
||||
UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
|
||||
UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
|
||||
COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
|
||||
COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
|
||||
COMPRESSED_DXT3_RGBA, // 8 bpp
|
||||
@@ -594,7 +595,7 @@ typedef enum {
|
||||
COMPRESSED_PVRT_RGBA, // 4 bpp
|
||||
COMPRESSED_ASTC_4x4_RGBA, // 8 bpp
|
||||
COMPRESSED_ASTC_8x8_RGBA // 2 bpp
|
||||
} TextureFormat;
|
||||
} PixelFormat;
|
||||
|
||||
// Texture parameters: filter mode
|
||||
// NOTE 1: Filtering considers mipmaps if available in the texture
|
||||
|
||||
Reference in New Issue
Block a user