Index: render.c
===================================================================
--- render.c	(revision 993)
+++ render.c	(revision 994)
@@ -16,6 +16,7 @@
 void raydium_hdr_block(signed char blocking);
 signed char raydium_shader_current(int shader);
 void raydium_shader_internal_vertex_attributes(int i);
+void raydium_osd_draw_name (char *tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
 
 // color is a GLfloat[4] (RGBA)
 void raydium_render_lightmap_color(GLfloat *color)
@@ -506,3 +507,170 @@
     maxfps=0;
    raydium_render_max_fps=maxfps;
 }
+
+
+// are faked textures package compliant ?
+void raydium_render_loading(void)
+{
+// Sad and dirty, but we *must* use hard-coded image data, since we need
+// this texture even when NO data is available yet.
+// Current font: Sans Bold. Costs something like 2 KB.
+// Tried with ATM filter first, but it looks better as-is at 128x16.
+static unsigned char texture_data[] = {
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,18,117,166,179,158,92,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,91,255,255,255,255,255,235,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,54,58,0,0,48,255,255,190,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,26,188,181,181,177,161,124,44,0,0,0,0,0,
+45,173,226,230,189,75,0,0,0,0,122,181,186,42,0,46,
+186,181,115,0,0,0,175,181,153,0,0,101,181,178,0,0,
+177,181,145,0,0,0,108,202,233,219,154,13,0,0,0,147,
+228,220,121,65,181,174,0,0,0,129,225,221,118,91,181,182,
+1,0,146,181,192,0,0,158,181,124,0,0,108,181,180,0,
+0,0,80,173,165,51,160,254,234,0,0,57,181,179,0,0,
+0,179,181,39,0,0,157,181,139,0,0,0,0,0,0,0,
+0,0,0,36,255,254,255,255,255,255,255,181,0,0,0,53,
+255,254,255,251,255,255,112,0,0,0,218,255,255,117,0,127,
+255,255,214,0,0,0,246,255,215,0,0,142,255,250,0,0,
+249,255,204,0,0,193,255,255,241,255,254,255,21,0,151,255,
+255,214,241,232,255,244,0,0,144,255,255,248,255,222,255,255,
+2,0,206,255,255,0,0,222,255,174,0,0,152,255,253,0,
+0,118,255,255,255,255,197,255,237,0,0,80,255,252,0,0,
+0,252,255,55,0,0,220,255,195,0,0,0,0,0,0,0,
+0,0,0,36,255,255,169,56,87,199,255,255,198,0,0,255,
+254,236,0,0,189,255,255,14,0,0,255,255,252,194,0,199,
+253,255,255,0,0,0,246,255,215,0,0,142,255,250,0,0,
+249,255,204,0,38,255,255,98,0,11,248,254,163,0,217,255,
+187,0,0,214,255,244,0,15,255,255,189,0,0,254,255,255,
+2,0,206,255,255,0,0,222,255,174,0,0,152,255,253,0,
+9,255,255,197,9,50,255,255,237,0,0,79,253,251,0,0,
+0,251,253,54,0,0,219,253,194,0,0,0,0,0,0,0,
+0,0,0,36,255,255,145,0,0,0,215,255,254,2,1,254,
+255,95,0,0,34,255,255,43,0,92,255,255,166,255,0,255,
+161,255,255,87,0,0,246,255,215,0,0,142,255,250,0,0,
+249,255,204,0,147,255,255,14,0,0,191,255,239,0,181,254,
+240,77,54,140,255,244,0,37,255,255,36,0,0,154,255,255,
+2,0,206,255,255,0,0,222,255,174,0,0,152,255,253,0,
+69,255,255,50,0,0,168,255,237,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,36,255,255,145,0,0,0,40,255,255,90,1,254,
+255,85,0,0,24,255,255,45,0,186,255,184,93,255,112,255,
+87,193,255,178,0,0,246,255,218,0,0,145,255,250,0,0,
+249,255,204,0,154,255,255,11,0,0,187,255,245,0,18,205,
+255,255,255,255,255,244,0,39,255,255,26,0,0,144,255,255,
+2,0,206,255,255,0,0,222,255,186,0,0,154,255,253,0,
+77,255,255,35,0,0,145,255,237,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,36,255,255,145,0,0,0,20,255,255,118,0,255,
+254,212,0,0,153,255,255,23,0,232,255,98,13,255,241,255,
+13,110,255,229,0,0,246,255,245,0,0,203,254,250,0,0,
+249,255,204,0,66,255,255,53,0,0,237,254,184,0,4,0,
+0,31,31,140,255,235,0,22,255,255,154,0,0,242,255,255,
+2,0,206,255,255,0,0,222,255,255,5,0,181,255,243,0,
+38,255,255,133,0,0,242,255,237,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,36,255,255,145,0,0,0,64,254,255,69,0,101,
+255,255,211,195,255,255,164,0,11,255,255,43,0,232,255,231,
+0,48,255,255,10,0,246,255,254,255,207,255,255,210,0,0,
+249,255,204,0,0,232,255,255,186,240,255,255,44,0,21,255,
+171,146,168,255,255,181,0,0,194,254,255,193,218,247,255,255,
+2,0,206,255,255,0,0,222,255,247,251,209,255,254,178,0,
+0,204,254,255,191,225,249,255,237,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,36,255,255,145,0,0,0,247,254,254,0,0,0,
+97,227,255,255,242,131,0,0,111,238,246,0,0,157,235,150,
+0,0,246,238,106,0,227,235,198,137,255,255,213,2,0,0,
+249,255,204,0,0,0,162,255,255,255,207,49,0,0,14,226,
+255,255,255,252,159,0,0,0,1,184,255,255,170,126,255,255,
+2,0,190,235,249,0,0,205,235,151,126,255,255,217,18,0,
+0,8,192,255,255,159,117,235,219,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,36,255,255,200,128,158,255,254,255,128,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+249,255,204,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,134,255,255,
+2,0,6,8,8,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,36,255,255,255,255,255,255,255,110,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+249,255,204,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,134,255,255,
+2,0,216,255,255,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,15,114,110,109,105,89,53,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+230,235,188,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,123,235,236,
+2,0,190,235,249,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
+
+static char *fake_texture="_loading.tga";
+static int fake_sx=128;
+static int fake_sy=16;
+
+static signed char first=1;
+
+if(first && raydium_texture_exists(fake_texture)==-1)
+    {
+    // create the "loading" texture:
+    raydium_texture_load_internal(fake_texture,fake_texture,
+                                  1,fake_sx,fake_sy,1,-1); // fake, size, bpp
+
+    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+    glTexImage2D(GL_TEXTURE_2D,0,GL_ALPHA,fake_sx,fake_sy,0,
+                 GL_ALPHA,GL_UNSIGNED_BYTE,texture_data);
+
+    first=0;
+    }
+
+// render a black screen with fake_texture in the bottom right:
+glClearColor(0,0,0,1);
+glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+raydium_osd_draw_name(fake_texture,75,0,100,5);
+glutSwapBuffers();
+
+raydium_clear_color_update(); // restore clear color
+}