/[usata]/usata2/src/system.cpp
ViewVC logotype

Diff of /usata2/src/system.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by skunix, Sat Dec 25 19:21:44 2004 UTC revision 1.9 by skunix, Sun Dec 26 08:03:34 2004 UTC
# Line 12  Line 12 
12  //  //
13  // $Id$  // $Id$
14  // $Log$  // $Log$
15    // Revision 1.9  2004/12/26 08:03:34  skunix
16    // changed lambda::bind's to boost::binds
17    //
18  // Revision 1.8  2004/12/25 19:21:44  skunix  // Revision 1.8  2004/12/25 19:21:44  skunix
19  // removed extra stuff  // removed extra stuff
20  //  //
# Line 25  Line 28 
28    
29  #include "system.hpp"  #include "system.hpp"
30  #include <SDL.h>  #include <SDL.h>
 #include <GL/gl.h>  
31  #include <stdexcept>  #include <stdexcept>
32  #include <algorithm>  #include <algorithm>
33  #include <iostream>  #include <iostream>
34    #include <GL/glew.h>
35    #include "log.hpp"
36  namespace usata  namespace usata
37  {  {
38    
39    
40  namespace system  namespace system
41  {  {
42                    static bool glew_was_init = false;
43                    void init_glew()
44                    {
45                            if (glew_was_init)
46                                    return; // everything is ok :)
47                            GLenum err = glewInit();
48                            if (err != GLEW_OK)
49                            {
50                                    throw std::runtime_error((const char*)(glewGetErrorString(err)));
51                            }
52    
53                            log::Stream s(&log::server);
54                            s << "GLEW initialized\n";
55            
56                            return;
57                    }
58    
59    
60          static bool initialized = false;          static bool initialized = false;
61          void init()          void init()
62          {          {
# Line 120  namespace system Line 143  namespace system
143                  {                  {
144                          SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE,&depth);                          SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE,&depth);
145                          std::cout << "set video mode ok, GL_DEPTH_SIZE (" << depth <<")" << std::endl;                          std::cout << "set video mode ok, GL_DEPTH_SIZE (" << depth <<")" << std::endl;
146                            init_glew();
147                  }                  }
148                  else                  else
149                  {                  {

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26