Code:
if(height > 300 && width > 300)
{
if(Cvar.Zoom == 1)
{
glPushMatrix();
glLoadIdentity();
glGetIntegerv(GL_VIEWPORT, iDim);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-0.1333, 0.1333, -0.1, 0.1, Cvar.ZoomLevel, 10000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPopMatrix();
}
}
Make ZoomLevel higher or lower depending on whether you want to
zoom in or out,
for example :
Code:
if (ScanConsole("e_ZoomIn"))
{
Cvar.ZoomLevel=Cvar.ZoomLevel+0.1;
if (Cvar.ZoomLevel > 3.0) Cvar.ZoomLevel = 3.0;
}
if (ScanConsole("e_ZoomOut"))
{
Cvar.ZoomLevel=Cvar.ZoomLevel-0.1;
if (Cvar.ZoomLevel < 0.5) Cvar.ZoomLevel = 0.5;