disable water reflections on pre-DX8ish hardware by default
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1971 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+1
-1
@@ -504,7 +504,7 @@ int main(int argc, char **argv)
|
||||
SDL_ShowCursor(0);
|
||||
|
||||
initlog("gl");
|
||||
|
||||
gl_checkextensions();
|
||||
gl_init(scr_w, scr_h, usedcolorbits, useddepthbits, usedfsaa);
|
||||
|
||||
notexture = textureload("packages/misc/notexture.png");
|
||||
|
||||
@@ -155,7 +155,7 @@ struct mitemtextinput : mitemtext
|
||||
mitemtextinput(gmenu *parent, char *text, char *value, char *action, char *hoveraction, color *bgcolor) : mitemtext(parent, text, action, hoveraction, bgcolor), defaultvalueexp(value), modified(false)
|
||||
{
|
||||
s_strcpy(input.buf, value);
|
||||
};
|
||||
}
|
||||
|
||||
virtual int width() { return text_width(input.buf) + text_width(text); }
|
||||
|
||||
@@ -194,7 +194,7 @@ struct mitemtextinput : mitemtext
|
||||
modified = false;
|
||||
}
|
||||
|
||||
virtual void select() { };
|
||||
virtual void select() { }
|
||||
|
||||
void setdefaultvalue()
|
||||
{
|
||||
|
||||
@@ -182,6 +182,7 @@ extern serverinfo *getconnectedserverinfo();
|
||||
extern void pingservers();
|
||||
|
||||
// rendergl
|
||||
extern void gl_checkextensions();
|
||||
extern void gl_init(int w, int h, int bpp, int depth, int fsaa);
|
||||
extern void cleangl();
|
||||
extern void line(int x1, int y1, float z1, int x2, int y2, float z2);
|
||||
|
||||
+33
-23
@@ -21,30 +21,8 @@ void *getprocaddress(const char *name)
|
||||
return SDL_GL_GetProcAddress(name);
|
||||
}
|
||||
|
||||
void gl_init(int w, int h, int bpp, int depth, int fsaa)
|
||||
void gl_checkextensions()
|
||||
{
|
||||
//#define fogvalues 0.5f, 0.6f, 0.7f, 1.0f
|
||||
|
||||
glViewport(0, 0, w, h);
|
||||
glClearDepth(1.0);
|
||||
glDepthFunc(GL_LESS);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
|
||||
glEnable(GL_FOG);
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
glFogf(GL_FOG_DENSITY, 0.25);
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
|
||||
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
|
||||
glPolygonOffset(-3.0, -3.0);
|
||||
|
||||
glCullFace(GL_FRONT);
|
||||
glEnable(GL_CULL_FACE);
|
||||
|
||||
const char *vendor = (const char *)glGetString(GL_VENDOR);
|
||||
const char *exts = (const char *)glGetString(GL_EXTENSIONS);
|
||||
const char *renderer = (const char *)glGetString(GL_RENDERER);
|
||||
@@ -71,6 +49,38 @@ void gl_init(int w, int h, int bpp, int depth, int fsaa)
|
||||
hasMDA = true;
|
||||
}
|
||||
|
||||
if(!strstr(exts, "GL_EXT_fragment_program"))
|
||||
{
|
||||
// not a required extension, but ensures the card has enough power to do reflections
|
||||
extern int waterreflect, waterrefract;
|
||||
waterreflect = waterrefract = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void gl_init(int w, int h, int bpp, int depth, int fsaa)
|
||||
{
|
||||
//#define fogvalues 0.5f, 0.6f, 0.7f, 1.0f
|
||||
|
||||
glViewport(0, 0, w, h);
|
||||
glClearDepth(1.0);
|
||||
glDepthFunc(GL_LESS);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
|
||||
glEnable(GL_FOG);
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
glFogf(GL_FOG_DENSITY, 0.25);
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
|
||||
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
|
||||
glPolygonOffset(-3.0, -3.0);
|
||||
|
||||
glCullFace(GL_FRONT);
|
||||
glEnable(GL_CULL_FACE);
|
||||
|
||||
if(fsaa) glEnable(GL_MULTISAMPLE);
|
||||
|
||||
inittmus();
|
||||
|
||||
Reference in New Issue
Block a user