6 void overlay(unsigned int tex, float aspect, float alpha)
8 float xscale = aspect / win_aspect;
10 glMatrixMode(GL_MODELVIEW);
13 glMatrixMode(GL_PROJECTION);
16 glScalef(xscale, 1.0, 1.0);
18 glPushAttrib(GL_ENABLE_BIT);
19 glDisable(GL_DEPTH_TEST);
20 glDisable(GL_LIGHTING);
22 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
23 glEnable(GL_TEXTURE_2D);
25 glBindTexture(GL_TEXTURE_2D, tex);
28 glColor4f(1, 1, 1, alpha);
42 glMatrixMode(GL_MODELVIEW);
46 void overlay_tex(struct texture *tex, float alpha)
48 overlay(tex->id, (float)tex->width / tex->height, alpha);