diff options
author | Stijn Buys <ingar@osirion.org> | 2008-02-03 01:43:03 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-02-03 01:43:03 +0000 |
commit | b4973888aeaea2dde6058bc06c3f6631349e7f3c (patch) | |
tree | 010de10692b330d7634ad3090fb94d14c101f484 /src/client/video.cc | |
parent | 67f8a7a783e550cab8e6a77d997b31815ee8cd7e (diff) |
command buffer handling
engine function parsing
buffered client console
Diffstat (limited to 'src/client/video.cc')
-rw-r--r-- | src/client/video.cc | 28 |
1 files changed, 9 insertions, 19 deletions
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() |