added resetgl command to restart renderer in-game

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1642 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-02-12 03:30:52 +00:00
parent 968bbcca96
commit 072cc6d525
9 changed files with 229 additions and 73 deletions
+12 -5
View File
@@ -78,10 +78,6 @@ void gl_init(int w, int h, int bpp, int depth, int fsaa)
camera1 = player1;
}
void cleangl()
{
}
void line(int x1, int y1, float z1, int x2, int y2, float z2)
{
glBegin(GL_POLYGON);
@@ -528,7 +524,7 @@ void drawminimap(int w, int h)
int size = 1<<minimapres, sizelimit = min(hwtexsize, min(w, h));
while(size > sizelimit) size /= 2;
if(size!=minimaplastsize)
if(size!=minimaplastsize && minimaptex)
{
glDeleteTextures(1, &minimaptex);
minimaptex = 0;
@@ -597,6 +593,17 @@ void drawminimap(int w, int h)
glClearDepth(1.0);
}
void cleanupgl()
{
if(reflecttex) glDeleteTextures(1, &reflecttex);
if(refracttex) glDeleteTextures(1, &refracttex);
if(minimaptex) glDeleteTextures(1, &minimaptex);
reflecttex = refracttex = minimaptex = 0;
minimapdirty = true;
if(glIsEnabled(GL_MULTISAMPLE)) glDisable(GL_MULTISAMPLE);
}
int xtraverts;
VARP(hudgun, 0, 1, 1);