Fresco/GGI/src GGIGL.cc,1.7,1.8
Tobias Hunger <[email protected]> Mon, 27 Oct 2003 17:08:43 +0000
| Newsgroups | gmane.comp.video.fresco.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvs/fresco/Fresco/GGI/src In directory purcel:/tmp/cvs-serv5328/GGI/src Modified Files: GGIGL.cc Log Message: Make sure all classes defined by Kits are in the Kit's namespace. Do some coding style fixups while touching the files anyway. Index: GGIGL.cc =================================================================== RCS file: /cvs/fresco/Fresco/GGI/src/GGIGL.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- GGIGL.cc 4 Jan 2003 13:54:45 -0000 1.7 +++ GGIGL.cc 27 Oct 2003 17:08:41 -0000 1.8 @@ -1,7 +1,7 @@ /*$Id$ * * This source file is a part of the Fresco Project. - * Copyright (C) 2000 Stefan Seefeld <[email protected]> + * Copyright (C) 2000 Stefan Seefeld <[email protected]> * http://www.fresco.org * * This library is free software; you can redistribute it and/or @@ -27,37 +27,42 @@ using namespace Prague; using namespace Fresco; -class GGIGLContext : virtual public GLContext +namespace GGI { -public: - GGIGLContext() - : _drawable(dynamic_cast<GGI::Drawable *>(Console::instance()->drawable())) - { - ggiMesaInit(); - if (ggiMesaAttach(_drawable->visual()) < 0) - throw std::runtime_error("ggiMesaAttach() failed"); - if (ggiMesaExtendVisual(_drawable->visual(), GL_FALSE, GL_FALSE, 16, 0, 0, - 0, 0, 0, 1) < 0) - throw std::runtime_error("ggiMesaExtendVisual() failed"); - if ((_context = ggiMesaCreateContext(_drawable->visual())) == NULL) - throw std::runtime_error("ggiMesaCreateContext() failed"); - ggiMesaMakeCurrent(_context, _drawable->visual()); - } - virtual ~GGIGLContext() - { - ggiMesaDestroyContext(_context); - } - virtual void flush() + class GLContext : virtual public ::GLContext { - glFlush(); - _drawable->flush(); - } - virtual void add_to_queue(::GLContext::Callback *_cb) { - (*_cb)(); - } -private: - GGI::Drawable *_drawable; - ggi_mesa_context_t _context; -}; + public: + GLContext() : + _drawable(dynamic_cast<GGI::Drawable *>(Console::instance()->drawable())) + { + ggiMesaInit(); + if (ggiMesaAttach(_drawable->visual()) < 0) + throw std::runtime_error("ggiMesaAttach() failed"); + if (ggiMesaExtendVisual(_drawable->visual(), GL_FALSE, GL_FALSE, + 16, 0, 0, 0, 0, 0, 1) < 0) + throw std::runtime_error("ggiMesaExtendVisual() failed"); + if ((_context = ggiMesaCreateContext(_drawable->visual())) == NULL) + throw std::runtime_error("ggiMesaCreateContext() failed"); + ggiMesaMakeCurrent(_context, _drawable->visual()); + } + virtual ~GGIGLContext() + { + ggiMesaDestroyContext(_context); + } + virtual void flush() + { + glFlush(); + _drawable->flush(); + } + virtual void add_to_queue(::GLContext::Callback *_cb) + { + (*_cb)(); + } + private: + GGI::Drawable *_drawable; + ggi_mesa_context_t _context; + }; -extern "C" Console::Extension *load() { return new GGIGLContext();} +} // namespace + +extern "C" Console::Extension *load() { return new GGI::GLContext();}