use GL_INDEX_BITS to get bpp for color buffer for renderstats (d1x r1.33)

This commit is contained in:
Bradley Bell 2004-05-20 07:02:54 +00:00
parent ad42e7c895
commit 794d1749a7
2 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2004-05-20 Matthew Mueller <donut@dakotacom.net>
* arch/ogl/ogl.c: use GL_INDEX_BITS to get bpp for color buffer
for renderstats (d1x r1.33)
2004-05-19 Matthew Mueller <donut@dakotacom.net>
* arch/ogl/gr.c, arch/ogl/ogl.c, include/ogl_init.h,

View file

@ -1,4 +1,4 @@
/* $Id: ogl.c,v 1.20 2004-05-20 05:16:00 btb Exp $ */
/* $Id: ogl.c,v 1.21 2004-05-20 07:02:54 btb Exp $ */
/*
*
* Graphics support functions for OpenGL.
@ -207,8 +207,10 @@ int ogl_texture_stats(void){
}
if (gr_renderstats)
{
int r, g, b, a, dbl, depth, res, colorsize, depthsize;
int idx, r, g, b, a, dbl, depth, res, colorsize, depthsize;
res = SWIDTH * SHEIGHT;
glGetIntegerv(GL_INDEX_BITS, &idx);
glGetIntegerv(GL_RED_BITS, &r);
glGetIntegerv(GL_GREEN_BITS, &g);
glGetIntegerv(GL_BLUE_BITS, &b);
@ -216,10 +218,10 @@ int ogl_texture_stats(void){
glGetIntegerv(GL_DOUBLEBUFFER, &dbl);
dbl += 1;
glGetIntegerv(GL_DEPTH_BITS, &depth);
colorsize = ((r + g + b + a) * res * dbl) / 8;
colorsize = (idx * res * dbl) / 8;
depthsize = res * depth / 8;
gr_printf(5, GAME_FONT->ft_h * 14 + 3 * 14, "%i(%i,%i) %iK(%iK wasted)", used, usedrgba, usedl4a4, truebytes / 1024, (truebytes - databytes) / 1024);
gr_printf(5, GAME_FONT->ft_h * 15 + 3 * 15, "r%i,g%i,b%i,a%ix%i=%iK depth%i=%iK", r, g, b, a, dbl, colorsize / 1024, depth, depthsize / 1024);
gr_printf(5, GAME_FONT->ft_h * 15 + 3 * 15, "%ibpp(r%i,g%i,b%i,a%i)x%i=%iK depth%i=%iK", idx, r, g, b, a, dbl, colorsize / 1024, depth, depthsize / 1024);
gr_printf(5, GAME_FONT->ft_h * 16 + 3 * 16, "total=%iK", (colorsize + depthsize + truebytes) / 1024);
}
// glmprintf((0,"ogl tex stats: %i(%i,%i|%i,%i,%i,%i,%i) %i(%i)b (%i(%i)wasted)\n",used,usedrgba,usedl4a4,prio0,prio1,prio2,prio3,prioh,truebytes,truetexel,truebytes-databytes,truetexel-datatexel));