From b4973888aeaea2dde6058bc06c3f6631349e7f3c Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 3 Feb 2008 01:43:03 +0000 Subject: command buffer handling engine function parsing buffered client console --- src/client/video.cc | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'src/client/video.cc') diff --git a/src/client/video.cc b/src/client/video.cc index 5772961..4018834 100644 --- a/src/client/video.cc +++ b/src/client/video.cc @@ -30,20 +30,7 @@ void Video::reset() { ratio = (float) width / (float) height; - // Our shading model--Gouraud (smooth). - gl::shademodel(GL_SMOOTH); - // Culling - gl::cullface( GL_BACK ); - gl::frontface(GL_CCW ); - gl::enable( GL_CULL_FACE ); - - // Depth buffer writing - gl::depthmask(GL_TRUE); - gl::enable(GL_DEPTH_TEST); - - // Alpha blending - gl::blendfunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Set the clear color gl::clearcolor( 0, 0, 0, 0 ); @@ -64,18 +51,18 @@ void Video::init() int flags = 0; if( SDL_Init(SDL_INIT_VIDEO) < 0 ) { - con_warn << "SDL_Init() failed: " << SDL_GetError() << std::endl; + std::cerr << "SDL_Init() failed: " << SDL_GetError() << std::endl; return; } const SDL_VideoInfo* sdl_videoinfo = SDL_GetVideoInfo(); if( !sdl_videoinfo) { - con_warn << "SDL_GetVideoInfo() failed: " << SDL_GetError() << std::endl; + std::cerr << "SDL_GetVideoInfo() failed: " << SDL_GetError() << std::endl; return; } - width = 800; - height = 600; + width = 1024; + height = 768; bpp = sdl_videoinfo->vfmt->BitsPerPixel; SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 ); @@ -88,7 +75,7 @@ void Video::init() flags = SDL_OPENGL | SDL_FULLSCREEN; if(!SDL_SetVideoMode(width, height, bpp, flags )) { - con_warn << "SDL_SetVideoMode() failed: " << SDL_GetError() << std::endl; + std::cerr << "SDL_SetVideoMode() failed: " << SDL_GetError() << std::endl; return; } @@ -103,7 +90,10 @@ void Video::init() void Video::draw(float elapsed) { - view.draw(elapsed); + if (core::game() && core::game()->ready()) + view.draw(elapsed); + + SDL_GL_SwapBuffers(); } void Video::shutdown() -- cgit v1.2.3