mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-05 07:38:19 +00:00
added fsaa and refresh rate options. tweaked scope a bit
This commit is contained in:
parent
982db98fae
commit
9e00e58e78
|
@ -134,10 +134,22 @@ int gfx_init()
|
||||||
screen_width = 320;
|
screen_width = 320;
|
||||||
screen_height = 240;
|
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)
|
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)
|
if(result != GL_TRUE)
|
||||||
{
|
{
|
||||||
dbg_msg("game", "failed to create gl context");
|
dbg_msg("game", "failed to create gl context");
|
||||||
|
|
|
@ -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_texture_compression, 0, 0, 1)
|
||||||
MACRO_CONFIG_INT(gfx_high_detail, 1, 0, 1)
|
MACRO_CONFIG_INT(gfx_high_detail, 1, 0, 1)
|
||||||
MACRO_CONFIG_INT(gfx_texture_quality, 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)
|
MACRO_CONFIG_INT(key_screenshot, 267, 32, 512)
|
||||||
|
|
||||||
|
|
|
@ -2012,7 +2012,7 @@ void render_game()
|
||||||
gfx_quads_begin();
|
gfx_quads_begin();
|
||||||
gfx_setcolor(0.65f,0.78f,0.9f,1.0f);
|
gfx_setcolor(0.65f,0.78f,0.9f,1.0f);
|
||||||
|
|
||||||
float fov = pi/4.0f;
|
float fov = pi/6.0f;
|
||||||
float fade = 0.7f;
|
float fade = 0.7f;
|
||||||
|
|
||||||
|
|
||||||
|
@ -2057,18 +2057,19 @@ void render_game()
|
||||||
gfx_quads_begin();
|
gfx_quads_begin();
|
||||||
gfx_setcolor(0.5f,0.9f,0.5f,0.25f);
|
gfx_setcolor(0.5f,0.9f,0.5f,0.25f);
|
||||||
float r=0.5f, g=1.0f, b=0.5f;
|
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(
|
gfx_quads_draw_freeform(
|
||||||
cn.x,cn.y,
|
cn.x,cn.y,
|
||||||
cn.x,cn.y,
|
cn.x,cn.y,
|
||||||
cp0f.x,cp0f.y,
|
cp0f.x,cp0f.y,
|
||||||
cp1f.x,cp1f.y);
|
cp1f.x,cp1f.y);
|
||||||
|
|
||||||
gfx_setcolorvertex(0, r, g, b, 0.1f);
|
gfx_setcolorvertex(0, r, g, b, 0.2f);
|
||||||
gfx_setcolorvertex(1, 0, 0, 0, 0.9f);
|
gfx_setcolorvertex(1, r2, g2, b2, 0.9f);
|
||||||
gfx_setcolorvertex(2, r, g, b, 0.1f);
|
gfx_setcolorvertex(2, r, g, b, 0.2f);
|
||||||
gfx_setcolorvertex(3, 0, 0, 0, 0.9f);
|
gfx_setcolorvertex(3, r2, g2, b2, 0.9f);
|
||||||
gfx_quads_draw_freeform(
|
gfx_quads_draw_freeform(
|
||||||
cn.x,cn.y,
|
cn.x,cn.y,
|
||||||
p0n.x,p0n.y,
|
p0n.x,p0n.y,
|
||||||
|
|
Loading…
Reference in a new issue