-// important technical note:
-// fragment textures must have a width that is compatible with the fragment
-// update system, to get a compliant size, use R_CompatibleFragmentWidth
-int R_CompatibleFragmentWidth(int width, int textype, int flags);
-
-// these two functions add a texture to a pool, and may precache (upload) it
-// a normal static texture
-rtexture_t *R_LoadTexture (rtexturepool_t *rtexturepool, char *identifier, int width, int height, qbyte *data, int textype, int flags);
-// a procedurally generated texture, often animated over time, note: generate can be NULL (for odd uses)
-rtexture_t *R_ProceduralTexture (rtexturepool_t *rtexturepool, char *identifier, int width, int height, int textype, int flags, int (*generate)(qbyte *buffer, int width, int height, void *parameterdata, int parameterdatasize), void *parameterdata, int parameterdatasize);
+// the color/normal/etc cvars should be checked by callers of R_LoadTexture* functions to decide whether to add TEXF_COMPRESS to the flags
+extern struct cvar_s gl_texturecompression;
+extern struct cvar_s gl_texturecompression_color;
+extern struct cvar_s gl_texturecompression_normal;
+extern struct cvar_s gl_texturecompression_gloss;
+extern struct cvar_s gl_texturecompression_glow;
+extern struct cvar_s gl_texturecompression_2d;
+extern struct cvar_s gl_texturecompression_q3bsplightmaps;
+extern struct cvar_s gl_texturecompression_q3bspdeluxemaps;
+extern struct cvar_s gl_texturecompression_sky;
+extern struct cvar_s gl_texturecompression_lightcubemaps;
+extern struct cvar_s gl_texturecompression_reflectmask;
+extern struct cvar_s r_texture_dds_load;
+extern struct cvar_s r_texture_dds_save;
+
+// add a texture to a pool and optionally precache (upload) it
+// (note: data == NULL is perfectly acceptable)
+// (note: palette must not be NULL if using TEXTYPE_PALETTE)
+rtexture_t *R_LoadTexture2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, const unsigned char *data, textype_t textype, int flags, int miplevel, const unsigned int *palette);
+rtexture_t *R_LoadTexture3D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, int depth, const unsigned char *data, textype_t textype, int flags, int miplevel, const unsigned int *palette);
+rtexture_t *R_LoadTextureCubeMap(rtexturepool_t *rtexturepool, const char *identifier, int width, const unsigned char *data, textype_t textype, int flags, int miplevel, const unsigned int *palette);
+rtexture_t *R_LoadTextureShadowMap2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, textype_t textype, qbool filter);
+rtexture_t *R_LoadTextureRenderBuffer(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, textype_t textype);
+rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filename, qbool srgb, int flags, qbool *hasalphaflag, float *avgcolor, int miplevel, qbool optionaltexture);
+
+// saves a texture to a DDS file
+int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qbool skipuncompressed, qbool hasalpha);