|
Texture Resources
-
Texture resources are finite and the amount of available
texture varies among implementations
-
An application may evaluate whether sufficient resources
exist
-
glGetIntegerv(GL_MAX_TEXTURE_SIZE, ...) will show the total
texture memory
-
Be aware that pixel format
will greatly affect texture utilization (as well as mipmaps and borders)
-
A texture proxy is a
place holder which allows more accurate queries
glTexImage2D(GL_PROXY_TEXTURE_2D,
0, GL_RGBA8,
64, 64, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D,
0,
GL_TEXTURE_INTERNAL_FORMAT,
&proxyComponents);
printf ("Proxying 64x64 level 0 RGBA8
texture (level 0)\n");
if (proxyComponents
== GL_RGBA8)
printf ("proxy
allocation succeeded\n");
else
printf ("proxy
allocation failed\n");
-
Unfortunately proxies to not report existing
texture usage.
|
|