added fsaa and refresh rate options. tweaked scope a bit

This commit is contained in:
Magnus Auvinen 2007-10-07 19:37:51 +00:00
parent 982db98fae
commit 9e00e58e78
3 changed files with 22 additions and 7 deletions

View file

@ -135,9 +135,21 @@ int gfx_init()
screen_height = 240;
}
/* set antialiasing */
if(config.gfx_fsaa_samples)
glfwOpenWindowHint(GLFW_FSAA_SAMPLES, config.gfx_fsaa_samples);
/* set refresh rate */
if(config.gfx_refresh_rate)
glfwOpenWindowHint(GLFW_REFRESH_RATE, config.gfx_refresh_rate);
/* no resizing allowed */
glfwOpenWindowHint(GLFW_WINDOW_NO_RESIZE, 1);
/* open window */
if(config.gfx_fullscreen)
{
int result = glfwOpenWindow(screen_width, screen_height, 8, 8, 8, 0, 0, 0, GLFW_FULLSCREEN);
int result = glfwOpenWindow(screen_width, screen_height, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN);
if(result != GL_TRUE)
{
dbg_msg("game", "failed to create gl context");

View file

@ -29,6 +29,8 @@ MACRO_CONFIG_INT(gfx_display_all_modes, 0, 0, 1)
MACRO_CONFIG_INT(gfx_texture_compression, 0, 0, 1)
MACRO_CONFIG_INT(gfx_high_detail, 1, 0, 1)
MACRO_CONFIG_INT(gfx_texture_quality, 1, 0, 1)
MACRO_CONFIG_INT(gfx_fsaa_samples, 0, 0, 16)
MACRO_CONFIG_INT(gfx_refresh_rate, 0, 0, 0)
MACRO_CONFIG_INT(key_screenshot, 267, 32, 512)

View file

@ -2012,7 +2012,7 @@ void render_game()
gfx_quads_begin();
gfx_setcolor(0.65f,0.78f,0.9f,1.0f);
float fov = pi/4.0f;
float fov = pi/6.0f;
float fade = 0.7f;
@ -2057,18 +2057,19 @@ void render_game()
gfx_quads_begin();
gfx_setcolor(0.5f,0.9f,0.5f,0.25f);
float r=0.5f, g=1.0f, b=0.5f;
float r2=r*0.25f, g2=g*0.25f, b2=b*0.25f;
gfx_setcolor(r,g,b,0.1f);
gfx_setcolor(r,g,b,0.2f);
gfx_quads_draw_freeform(
cn.x,cn.y,
cn.x,cn.y,
cp0f.x,cp0f.y,
cp1f.x,cp1f.y);
gfx_setcolorvertex(0, r, g, b, 0.1f);
gfx_setcolorvertex(1, 0, 0, 0, 0.9f);
gfx_setcolorvertex(2, r, g, b, 0.1f);
gfx_setcolorvertex(3, 0, 0, 0, 0.9f);
gfx_setcolorvertex(0, r, g, b, 0.2f);
gfx_setcolorvertex(1, r2, g2, b2, 0.9f);
gfx_setcolorvertex(2, r, g, b, 0.2f);
gfx_setcolorvertex(3, r2, g2, b2, 0.9f);
gfx_quads_draw_freeform(
cn.x,cn.y,
p0n.x,p0n.y,