Plus/include/gtk/OgreGTKGLSupport.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org
6 
7 Copyright (c) 2000-2009 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef INCL_OGRE_GTKGLSUPPORT_H
30 #define INCL_OGRE_GTKGLSUPPORT_H
31 
32 #include "OgreGL3PlusSupport.h"
33 
34 #include <gtkmm/main.h>
35 #include <gtkglmm.h>
36 
37 namespace Ogre {
38 
39 class OGREWidget;
40 
47 class GTKGLSupport : public GL3PlusSupport, public Singleton<GTKGLSupport>
48 {
49 public:
50  GTKGLSupport();
51  void addConfig();
52  void setConfigOptions(const String& name, const String& value);
54  RenderWindow* createWindow(bool autoCreateWindow,
55  GL3PlusRenderSystem* renderSystem, const String& windowTitle);
56  RenderWindow* newWindow(const String& name, unsigned int width, unsigned int height,
57  unsigned int colourDepth, bool fullScreen, int left, int top,
58  bool depthBuffer, RenderWindow* parentWindowHandle,
59  bool vsync);
60  void start();
61  void stop();
62  void begin_context(RenderTarget *_target = 0);
63  void end_context();
64  void initialiseExtensions(void);
65  bool checkMinGLVersion(const String& v) const;
66  bool checkExtension(const String& ext) const;
67  void* getProcAddress(const String& procname);
68 
69  Glib::RefPtr<const Gdk::GL::Context> getMainContext() const;
70 
86  static GTKGLSupport& getSingleton(void);
102  static GTKGLSupport* getSingletonPtr(void);
103 private:
104  int _context_ref;
105  Gtk::Main _kit;
106  //OGREWidget* _ogre_widget;
107 
108  Glib::RefPtr<Gdk::GL::Context> _main_context;
109  Glib::RefPtr<Gdk::GL::Window> _main_window;
110 }; // class GTKGLSupport
111 
112 }; // namespace Ogre
113 
114 #endif // INCL_OGRE_GTKGLSUPPORT_H
Ogre::GTKGLSupport::stop
void stop()
Stop anything special.
Ogre::GTKGLSupport::validateConfig
String validateConfig()
Make sure all the extra options are valid.
Ogre::GTKGLSupport::_main_window
Glib::RefPtr< Gdk::GL::Window > _main_window
Definition: include/gtk/OgreGTKGLSupport.h:109
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::GTKGLSupport::_context_ref
int _context_ref
Definition: include/gtk/OgreGTKGLSupport.h:104
Ogre::GTKGLSupport::initialiseExtensions
void initialiseExtensions(void)
Initialises GL extensions, must be done AFTER the GL context has been established.
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::GTKGLSupport::_main_context
Glib::RefPtr< Gdk::GL::Context > _main_context
Definition: include/gtk/OgreGTKGLSupport.h:108
Ogre::GTKGLSupport::end_context
void end_context()
Ogre::GTKGLSupport::getProcAddress
void * getProcAddress(const String &procname)
Get the address of a function.
Ogre::GTKGLSupport::getSingletonPtr
static GTKGLSupport * getSingletonPtr(void)
Override standard Singleton retrieval.
Ogre::GTKGLSupport::getSingleton
static GTKGLSupport & getSingleton(void)
Override standard Singleton retrieval.
Ogre::GTKGLSupport::checkExtension
bool checkExtension(const String &ext) const
Check if an extension is available.
Ogre::GTKGLSupport::newWindow
RenderWindow * newWindow(const String &name, unsigned int width, unsigned int height, unsigned int colourDepth, bool fullScreen, int left, int top, bool depthBuffer, RenderWindow *parentWindowHandle, bool vsync)
Ogre::GTKGLSupport::setConfigOptions
void setConfigOptions(const String &name, const String &value)
Ogre::GTKGLSupport::begin_context
void begin_context(RenderTarget *_target=0)
Ogre::GTKGLSupport::GTKGLSupport
GTKGLSupport()
Ogre::GTKGLSupport::addConfig
void addConfig()
Add any special config values to the system.
OgreGL3PlusSupport.h
Ogre::GTKGLSupport::start
void start()
Start anything special.
Ogre::GTKGLSupport::_kit
Gtk::Main _kit
Definition: include/gtk/OgreGTKGLSupport.h:105
Ogre::GTKGLSupport::createWindow
RenderWindow * createWindow(bool autoCreateWindow, GLRenderSystem *renderSystem, const String &windowTitle)
Ogre::GTKGLSupport::checkMinGLVersion
bool checkMinGLVersion(const String &v) const
Ogre::GTKGLSupport::getMainContext
Glib::RefPtr< const Gdk::GL::Context > getMainContext() const

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15