Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreGTKGLSupport.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004 (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://ogre.sourceforge.net/
00006 
00007 Copyright (c) 2000-2005 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 
00026 #ifndef INCL_OGRE_GTKGLSUPPORT_H
00027 #define INCL_OGRE_GTKGLSUPPORT_H
00028 
00029 #include "OgreGLSupport.h"
00030 
00031 #include <gtkmm/main.h>
00032 #include <gtkglmm.h>
00033 
00034 namespace Ogre {
00035 
00036 class OGREWidget;
00037 
00044 class GTKGLSupport : public GLSupport, public Singleton<GTKGLSupport>
00045 {
00046 public:
00047     GTKGLSupport();
00048     void addConfig();
00049     void setConfigOptions(const String& name, const String& value);
00050     String validateConfig();
00051     RenderWindow* createWindow(bool autoCreateWindow, 
00052                                GLRenderSystem* renderSystem, const String& windowTitle);
00053     RenderWindow* newWindow(const String& name, unsigned int width, unsigned int height, 
00054                             unsigned int colourDepth, bool fullScreen, int left, int top,
00055                             bool depthBuffer, RenderWindow* parentWindowHandle,
00056                             bool vsync);
00057     void start();
00058     void stop();
00059     void begin_context(RenderTarget *_target = 0);
00060     void end_context();
00061     void initialiseExtensions(void);
00062     bool checkMinGLVersion(const String& v) const;
00063     bool checkExtension(const String& ext) const;
00064     void* getProcAddress(const String& procname);
00065 
00066     Glib::RefPtr<const Gdk::GL::Context> getMainContext() const; 
00067 
00083     static GTKGLSupport& getSingleton(void);
00099     static GTKGLSupport* getSingletonPtr(void);
00100 private:
00101     int _context_ref;
00102     Gtk::Main _kit;
00103     //OGREWidget* _ogre_widget;
00104 
00105     Glib::RefPtr<Gdk::GL::Context> _main_context;
00106     Glib::RefPtr<Gdk::GL::Window> _main_window;
00107 }; // class GTKGLSupport
00108 
00109 }; // namespace Ogre
00110 
00111 #endif // INCL_OGRE_GTKGLSUPPORT_H

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:42 2006