Neil Matson (matson++at++phoebus.ncsc.navy.mil)
Thu, 16 May 96 14:14:56 CDT
Thanks,
Neil
-------------------------------------------------------------------------------
/* gfxinfo: */
/* */
/* Graphics board 0 is "REV" graphics. */
/* Managed (":0.0") 1280x1024 */
/* Display 1280x1024 ++at++ 60Hz */
/* 12 GE (GE10 rev. 0x7) */
/* 2 RM5 boards */
/* Medium pixel depth */
/* 10-bit RGBA pixels */
/* Not using Multi-Channel Option */
/* -------------------------------------------- */
/* tex_mem.c */
/* to compile: cc -o tex_mem tex_mem.c -lgl_s */
#include <stdio.h>
#include <gl.h>
#define MAX_PRELOADED_TEXTURES 513 /* TRY 512 AND VALUES GREATER */
main()
{
long w_id;
int i;
long Num_Components = 3;
long Width = 64;
long Height = 64;
unsigned long Texture_Map[64 * 64 /2] = {0}; /* 64 * 64 * 2 bytes */
float paged_texture_props[] =
{TX_MAGFILTER, TX_BILINEAR,
TX_MINFILTER, TX_BILINEAR,
TX_INTERNAL_FORMAT, TX_RGB_5,
TX_FAST_DEFINE,
TX_WRAP, TX_REPEAT,
TX_NULL };
float tv_modulate_props[] = {TV_MODULATE, TV_NULL };
/* ------------------------------------------ */
w_id = winopen("Texture memory test");
drawmode (NORMALDRAW);
RGBmode ();
doublebuffer ();
gconfig ();
subpixel (TRUE);
zbuffer (TRUE);
/* ------------------------------------------ */
tevdef(1, 0, tv_modulate_props);
tevbind(TV_ENV0, 1);
for (i=1; i<=MAX_PRELOADED_TEXTURES; i++) {
texdef2d(i, 3, Width, Height, Texture_Map, 0, paged_texture_props);
texbind(TX_TEXTURE_0, i);
printf("Preloading %d\n", i);
if (!istexloaded(TX_TEXTURE_0, 1))
printf("For %d: Texture %d not loaded!\n", i, 1);
}
printf("Texture preloading finished!\n");
}
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:54 PDT