12 |
// |
// |
13 |
// $Id$ |
// $Id$ |
14 |
// $Log$ |
// $Log$ |
15 |
|
// Revision 1.10 2004/12/26 09:35:23 skunix |
16 |
|
// use logging functionality |
17 |
|
// |
18 |
// Revision 1.9 2004/12/26 08:03:34 skunix |
// Revision 1.9 2004/12/26 08:03:34 skunix |
19 |
// changed lambda::bind's to boost::binds |
// changed lambda::bind's to boost::binds |
20 |
// |
// |
33 |
#include <SDL.h> |
#include <SDL.h> |
34 |
#include <stdexcept> |
#include <stdexcept> |
35 |
#include <algorithm> |
#include <algorithm> |
|
#include <iostream> |
|
36 |
#include <GL/glew.h> |
#include <GL/glew.h> |
37 |
#include "log.hpp" |
#include "log.hpp" |
38 |
namespace usata |
namespace usata |
134 |
{ |
{ |
135 |
Uint32 Flags = SDL_OPENGL | (vm.fullscreen?SDL_FULLSCREEN:0); |
Uint32 Flags = SDL_OPENGL | (vm.fullscreen?SDL_FULLSCREEN:0); |
136 |
const SDL_VideoInfo* vi = SDL_GetVideoInfo(); |
const SDL_VideoInfo* vi = SDL_GetVideoInfo(); |
137 |
|
log::Stream2 logstream; |
|
std::cout << vi->video_mem << "k video ram" << std::endl; |
|
138 |
|
|
139 |
int depth = vi->vfmt->BitsPerPixel; |
int depth = vi->vfmt->BitsPerPixel; |
140 |
|
|
143 |
if (success) |
if (success) |
144 |
{ |
{ |
145 |
SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE,&depth); |
SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE,&depth); |
146 |
std::cout << "set video mode ok, GL_DEPTH_SIZE (" << depth <<")" << std::endl; |
logstream << "set video mode ok, GL_DEPTH_SIZE (" << depth <<")" << log::Commit; |
147 |
init_glew(); |
init_glew(); |
148 |
} |
} |
149 |
else |
else |
150 |
{ |
{ |
151 |
std::cerr << SDL_GetError() << std::endl; |
logstream << log::set_level(log::Level::ERROR) << SDL_GetError() << log::Commit; |
152 |
} |
} |
153 |
|
|
154 |
} |
} |