]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_textures.h
added gl_nopartialtextureupdates cvar which disables use of
[xonotic/darkplaces.git] / r_textures.h
index 0ef3ab2ca3510bce4fec59a498ed95586629507e..edd7d9e58a5d5db72434ecc62e832e5daba965a8 100644 (file)
 #define TEXF_COMPARE 0x00000800
 // indicates texture should use lower precision where supported
 #define TEXF_LOWPRECISION 0x00001000
+// indicates texture should support R_UpdateTexture
+#define TEXF_ALLOWUPDATES 0x00002000
+// indicates texture should support R_FlushTexture (improving speed on multiple partial updates per draw)
+#define TEXF_MANUALFLUSHUPDATES 0x00004000
 // used for checking if textures mismatch
 #define TEXF_IMPORTANTBITS (TEXF_ALPHA | TEXF_MIPMAP | TEXF_CLAMP | TEXF_FORCENEAREST | TEXF_FORCELINEAR | TEXF_PICMIP | TEXF_COMPRESS | TEXF_COMPARE | TEXF_LOWPRECISION)
 
@@ -82,6 +86,7 @@ extern cvar_t gl_texturecompression_lightcubemaps;
 rtexture_t *R_LoadTexture2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, const unsigned char *data, textype_t textype, int flags, 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, 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, const unsigned int *palette);
+rtexture_t *R_LoadTextureRectangle(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, const unsigned char *data, textype_t textype, int flags, const unsigned int *palette);
 rtexture_t *R_LoadTextureShadowMapRectangle(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, int precision, qboolean filter);
 rtexture_t *R_LoadTextureShadowMap2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, int precision, qboolean filter);
 rtexture_t *R_LoadTextureShadowMapCube(rtexturepool_t *rtexturepool, const char *identifier, int width, int precision, qboolean filter);
@@ -91,15 +96,17 @@ void R_FreeTexture(rtexture_t *rt);
 
 // update a portion of the image data of a texture, used by lightmap updates
 // and procedural textures such as video playback.
+// if TEXF_MANUALFLUSHUPDATES is used, you MUST call R_FlushTexture to apply the updates
 void R_UpdateTexture(rtexture_t *rt, const unsigned char *data, int x, int y, int width, int height);
+// if TEXF_MANUALFLUSHUPDATES is used, call this to apply the updates,
+// otherwise this function does nothing
+void R_FlushTexture(rtexture_t *rt);
 
 // returns the renderer dependent texture slot number (call this before each
 // use, as a texture might not have been precached)
 #define R_GetTexture(rt) ((rt) ? ((rt)->texnum > 0 ? (rt)->texnum : R_RealGetTexture(rt)) : r_texture_white->texnum)
 int R_RealGetTexture (rtexture_t *rt);
 
-// returns true if the texture is transparent (useful for rendering code)
-
 // returns width of texture, as was specified when it was uploaded
 int R_TextureWidth(rtexture_t *rt);