Test Program: Preloading of textures

New Message Reply Date view Thread view Subject view Author view

Neil Matson (matson++at++phoebus.ncsc.navy.mil)
Thu, 16 May 96 14:14:56 CDT


Here is the test program. When run with RM5s, it complains about tex num 513.
This is the same (expected) result when run on RM4s.

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");

}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:54 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.