summaryrefslogtreecommitdiffhomepage
path: root/src/raylib.h
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2018-01-06 13:43:48 +0100
committerraysan5 <[email protected]>2018-01-06 13:43:48 +0100
commit7caa3201d51a04b739122ffadac476493bd05395 (patch)
tree4a150c33300fdc0c58621e59a9657c1422f6a6e0 /src/raylib.h
parent1f0f8c33fa8c1033dcf3037524504f2317f5777a (diff)
downloadraylib-7caa3201d51a04b739122ffadac476493bd05395.tar.gz
raylib-7caa3201d51a04b739122ffadac476493bd05395.zip
Improved pixel formats support
- Renamed enum TextureFormat to PixelFormat for consistency - Added support for pixel format UNCOMPRESSED_R32 - Using GetPixelDataSize() where required
Diffstat (limited to 'src/raylib.h')
-rw-r--r--src/raylib.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/raylib.h b/src/raylib.h
index a2f28661..c44653e8 100644
--- a/src/raylib.h
+++ b/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