1
0
Fork 0
forked from fte/fteqw

Slight improvement on antialiasing, like the cvar being registered and stuff.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2124 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-03-15 20:48:48 +00:00
parent a0964b50e9
commit ca278f79e0
3 changed files with 9 additions and 3 deletions

View file

@ -94,6 +94,7 @@ static cvar_t vid_fullscreen = SCVARF("vid_fullscreen", "1", CVAR_ARCHIVE|CVAR_R
static cvar_t vid_width = SCVARF("vid_width", "640", CVAR_ARCHIVE|CVAR_RENDERERLATCH); //more readable defaults to match conwidth/conheight.
static cvar_t vid_height = SCVARF("vid_height", "480", CVAR_ARCHIVE|CVAR_RENDERERLATCH);
static cvar_t vid_refreshrate = SCVARF("vid_displayfrequency", "0", CVAR_ARCHIVE|CVAR_RENDERERLATCH);
static cvar_t vid_multisample = SCVARF("vid_multisample", "0", CVAR_ARCHIVE|CVAR_RENDERERLATCH);
cvar_t gl_texturemode = SCVAR("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST");
cvar_t gl_motionblur = SCVARF("gl_motionblur", "0", CVAR_ARCHIVE);
@ -302,6 +303,7 @@ void GLRenderer_Init(void)
Cvar_Register (&gl_mindist, GLRENDEREROPTIONS);
Cvar_Register (&vid_conwidth, GLRENDEREROPTIONS);
Cvar_Register (&vid_conheight, GLRENDEREROPTIONS);
Cvar_Register (&vid_multisample, GLRENDEREROPTIONS);
Cvar_Register (&gl_fontedgeclamp, GRAPHICALNICETIES);
Cvar_Register (&gl_font, GRAPHICALNICETIES);
@ -1875,6 +1877,7 @@ TRACE(("dbg: R_RestartRenderer_f\n"));
newr.allow_modex = vid_allow_modex.value;
newr.multisample = vid_multisample.value;
newr.bpp = vid_bpp.value;
newr.fullscreen = vid_fullscreen.value;
newr.rate = vid_refreshrate.value;

View file

@ -34,6 +34,7 @@ typedef struct {
qboolean fullscreen;
int bpp;
int rate;
int multisample; //for opengl antialiasing (which requires context stuff)
float streach;
char glrenderer[MAX_QPATH];
r_qrenderer_t renderer;

View file

@ -1081,13 +1081,15 @@ BOOL CheckForcePixelFormat(rendererstate_t *info)
TRACE(("dbg: bSetupPixelFormat: attempting wglChoosePixelFormatARB (multisample 4)\n"));
hDC = GetDC(mainwindow);
valid = qwglChoosePixelFormatARB(hDC,iAttributes,fAttributes,1,&pixelformat,&numFormats);
if (!valid || numFormats < 1)
while ((!valid || numFormats < 1) && iAttributes[19] > 1)
{ //failed, switch wgl_samples to 2
iAttributes[19] = 2;
TRACE(("dbg: bSetupPixelFormat: attempting wglChoosePixelFormatARB (multisample 2)\n"));
iAttributes[19] /= 2;
TRACE(("dbg: bSetupPixelFormat: attempting wglChoosePixelFormatARB (smaller multisample)\n"));
valid = qwglChoosePixelFormatARB(hDC,iAttributes,fAttributes,1,&pixelformat,&numFormats);
}
ReleaseDC(mainwindow, hDC);
if (valid && numFormats > 0)
{