Plus/include/gtk/OgreGTKWindow.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_GTKWINDOW_H
30 #define INCL_OGRE_GTKWINDOW_H
31 
32 #include "OgreRenderWindow.h"
33 
34 #include <gtkmm/main.h>
35 #include <gtkmm/window.h>
36 #include <gtkglmm.h>
37 
38 #include <GL/gl.h>
39 
40 namespace Ogre {
41 
42 class OGREWidget : public Gtk::GL::DrawingArea
43 {
44 public:
45  OGREWidget(bool useDepthBuffer);
46 };
47 
48 class GTKWindow : public RenderWindow, public SigC::Object
49 {
50 public:
51  GTKWindow();
52  ~GTKWindow();
53 
58  bool pump_events();
59 
63  OGREWidget* get_ogre_widget();
64 
65  void create(const String& name, unsigned int width, unsigned int height, unsigned int colourDepth,
66  bool fullScreen, int left, int top, bool depthBuffer,
67  void* miscParam, ...);
68 
69  void setFullscreen(bool fullScreen, unsigned int width, unsigned int height);
70  void destroy(void);
71  bool isActive(void) const;
72  bool isClosed(void) const;
73  void reposition(int left, int top);
74  void resize(unsigned int width, unsigned int height);
75  void swapBuffers();
76  void copyContentsToMemory(const PixelBox &dst, FrameBuffer buffer);
77 
78  bool requiresTextureFlipping() const { return false; }
79 
86  void getCustomAttribute( const String& name, void* pData );
87 protected:
88  // Signal handlers
89  bool on_delete_event(GdkEventAny* event);
90  bool on_expose_event(GdkEventExpose* event);
91  // bool SimpleGLScene::on_configure_event(GdkEventConfigure* event)
92 private:
93  //Gtk::Main* kit;
94  Gtk::Window *mGtkWindow;
95  OGREWidget* ogre;
96 }; // class GTKWindow
97 
98 }; // namespace Ogre
99 
100 #endif // INCL_OGRE_GTKWINDOW_H
OGREWidget(bool useDepthBuffer)
_StringBase String
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...

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 Sun Oct 22 2017 04:04:15