diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-29 21:39:41 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-29 21:39:41 +0000 |
| commit | 7bc733dc10f3d01985021b7b5d6ae140dd5af6f1 (patch) | |
| tree | c9b0fcd8d128ec9abd40c10dfe4fcf245650a870 /src/engine/client/ec_gfx.c | |
| parent | 0dab7db963e2706182ea120c98f746f5e265c14c (diff) | |
| download | zcatch-7bc733dc10f3d01985021b7b5d6ae140dd5af6f1.tar.gz zcatch-7bc733dc10f3d01985021b7b5d6ae140dd5af6f1.zip | |
large update. cleaned up some code. added new effects for almost everything
Diffstat (limited to 'src/engine/client/ec_gfx.c')
| -rw-r--r-- | src/engine/client/ec_gfx.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c index 101b0279..1e4378d2 100644 --- a/src/engine/client/ec_gfx.c +++ b/src/engine/client/ec_gfx.c @@ -163,7 +163,7 @@ int gfx_init() /* open window */ if(config.gfx_fullscreen) { - int result = glfwOpenWindow(screen_width, screen_height, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN); + int result = glfwOpenWindow(screen_width, screen_height, 8, 8, 8, 8, 24, 8, GLFW_FULLSCREEN); if(result != GL_TRUE) { dbg_msg("game", "failed to create gl context"); @@ -172,19 +172,22 @@ int gfx_init() } else { - int result = glfwOpenWindow(screen_width, screen_height, 0, 0, 0, 0, 24, 0, GLFW_WINDOW); + int result = glfwOpenWindow(screen_width, screen_height, 0, 0, 0, 8, 24, 8, GLFW_WINDOW); if(result != GL_TRUE) { dbg_msg("game", "failed to create gl context"); return 0; } } - glfwSetWindowSizeCallback(screen_resize); + glGetIntegerv(GL_ALPHA_BITS, &i); + dbg_msg("gfx", "alphabits = %d", i); glGetIntegerv(GL_DEPTH_BITS, &i); dbg_msg("gfx", "depthbits = %d", i); + glGetIntegerv(GL_STENCIL_BITS, &i); + dbg_msg("gfx", "stencilbits = %d", i); glfwSetWindowTitle("Teewars"); @@ -212,6 +215,10 @@ int gfx_init() glDisable(GL_DEPTH_TEST); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); +/* glAlphaFunc(GL_GREATER, 0); + glEnable(GL_ALPHA_TEST);*/ + + gfx_mask_op(MASK_NONE, 0); /* Set all z to -5.0f */ @@ -325,6 +332,8 @@ void gfx_set_vsync(int val) int gfx_unload_texture(int index) { + if(index < 0) + return 0; glDeleteTextures(1, &textures[index].tex); textures[index].next = first_free_texture; memory_usage -= textures[index].memsize; |