11 |
// http://www.fsf.org/licenses/gpl.html. |
// http://www.fsf.org/licenses/gpl.html. |
12 |
// |
// |
13 |
// $Id$ |
// $Id$ |
|
// $Log$ |
|
|
// Revision 1.10 2004/12/26 09:35:23 skunix |
|
|
// use logging functionality |
|
|
// |
|
|
// Revision 1.9 2004/12/26 08:03:34 skunix |
|
|
// changed lambda::bind's to boost::binds |
|
|
// |
|
|
// Revision 1.8 2004/12/25 19:21:44 skunix |
|
|
// removed extra stuff |
|
|
// |
|
|
// Revision 1.7 2004/12/23 19:05:11 skunix |
|
|
// added usata::time::get_ticks |
|
|
// |
|
|
// Revision 1.6 2004/12/22 23:35:19 Descender |
|
|
// |
|
|
// Fix license headers |
|
|
// |
|
14 |
|
|
15 |
#include "system.hpp" |
#include "system.hpp" |
16 |
#include <SDL.h> |
#include <SDL.h> |
35 |
throw std::runtime_error((const char*)(glewGetErrorString(err))); |
throw std::runtime_error((const char*)(glewGetErrorString(err))); |
36 |
} |
} |
37 |
|
|
38 |
log::Stream s(&log::server); |
log::stream << "GLEW initialized\n"; |
|
s << "GLEW initialized\n"; |
|
|
|
|
39 |
return; |
return; |
40 |
} |
} |
41 |
|
|
115 |
{ |
{ |
116 |
Uint32 Flags = SDL_OPENGL | (vm.fullscreen?SDL_FULLSCREEN:0); |
Uint32 Flags = SDL_OPENGL | (vm.fullscreen?SDL_FULLSCREEN:0); |
117 |
const SDL_VideoInfo* vi = SDL_GetVideoInfo(); |
const SDL_VideoInfo* vi = SDL_GetVideoInfo(); |
118 |
log::Stream2 logstream; |
log::BufferedStream logstream; |
119 |
|
|
120 |
int depth = vi->vfmt->BitsPerPixel; |
int depth = vi->vfmt->BitsPerPixel; |
121 |
|
|
124 |
if (success) |
if (success) |
125 |
{ |
{ |
126 |
SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE,&depth); |
SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE,&depth); |
127 |
logstream << "set video mode ok, GL_DEPTH_SIZE (" << depth <<")" << log::Commit; |
logstream << "set video mode ok, GL_DEPTH_SIZE (" << depth <<")" << log::commit; |
128 |
init_glew(); |
init_glew(); |
129 |
} |
} |
130 |
else |
else |
131 |
{ |
{ |
132 |
logstream << log::set_level(log::Level::ERROR) << SDL_GetError() << log::Commit; |
logstream << log::set_level(log::Level::ERROR) << SDL_GetError() << log::commit; |
133 |
} |
} |
134 |
|
|
135 |
} |
} |