1 | /*
|
---|
2 | -----------------------------------------------------------------------------
|
---|
3 | This source file is part of OGRE
|
---|
4 | (Object-oriented Graphics Rendering Engine)
|
---|
5 | For the latest info, see http://ogre.sourceforge.net/
|
---|
6 |
|
---|
7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
8 | Also see acknowledgements in Readme.html
|
---|
9 |
|
---|
10 | This program is free software; you can redistribute it and/or modify it under
|
---|
11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
13 | version.
|
---|
14 |
|
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
18 |
|
---|
19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
23 | -----------------------------------------------------------------------------
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef INCL_OGRE_GTKWINDOW_H
|
---|
27 | #define INCL_OGRE_GTKWINDOW_H
|
---|
28 |
|
---|
29 | #include "OgreRenderWindow.h"
|
---|
30 |
|
---|
31 | #include <gtkmm/main.h>
|
---|
32 | #include <gtkmm/window.h>
|
---|
33 | #include <gtkglmm.h>
|
---|
34 |
|
---|
35 | #include <GL/gl.h>
|
---|
36 |
|
---|
37 | namespace Ogre {
|
---|
38 |
|
---|
39 | class OGREWidget : public Gtk::GL::DrawingArea
|
---|
40 | {
|
---|
41 | public:
|
---|
42 | OGREWidget(bool useDepthBuffer);
|
---|
43 | };
|
---|
44 |
|
---|
45 | class GTKWindow : public RenderWindow, public SigC::Object
|
---|
46 | {
|
---|
47 | public:
|
---|
48 | GTKWindow();
|
---|
49 | ~GTKWindow();
|
---|
50 |
|
---|
51 | /**
|
---|
52 | * Pump the main loop to actually generate events
|
---|
53 | * @returns false when there are no events left to pump
|
---|
54 | */
|
---|
55 | bool pump_events();
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * Get the actual widget that is housing OGRE's GL view.
|
---|
59 | */
|
---|
60 | OGREWidget* get_ogre_widget();
|
---|
61 |
|
---|
62 | void create(const String& name, unsigned int width, unsigned int height, unsigned int colourDepth,
|
---|
63 | bool fullScreen, int left, int top, bool depthBuffer,
|
---|
64 | void* miscParam, ...);
|
---|
65 |
|
---|
66 | void destroy(void);
|
---|
67 | bool isActive(void) const;
|
---|
68 | bool isClosed(void) const;
|
---|
69 | void reposition(int left, int top);
|
---|
70 | void resize(unsigned int width, unsigned int height);
|
---|
71 | void swapBuffers(bool waitForVSync);
|
---|
72 | void writeContentsToFile(const String& filename);
|
---|
73 |
|
---|
74 | bool requiresTextureFlipping() const { return false; }
|
---|
75 |
|
---|
76 | /**
|
---|
77 | * Get a custom, GTK specific attribute. The specific attributes
|
---|
78 | * are:
|
---|
79 | * GTKMMWINDOW The Gtk::Window instance (Rendering window)
|
---|
80 | * GTKGLMMWIDGET The Gtk::GL::DrawingArea instance (Ogre widget)
|
---|
81 | */
|
---|
82 | void getCustomAttribute( const String& name, void* pData );
|
---|
83 | protected:
|
---|
84 | // Signal handlers
|
---|
85 | bool on_delete_event(GdkEventAny* event);
|
---|
86 | bool on_expose_event(GdkEventExpose* event);
|
---|
87 | // bool SimpleGLScene::on_configure_event(GdkEventConfigure* event)
|
---|
88 | private:
|
---|
89 | //Gtk::Main* kit;
|
---|
90 | Gtk::Window *mGtkWindow;
|
---|
91 | OGREWidget* ogre;
|
---|
92 | }; // class GTKWindow
|
---|
93 |
|
---|
94 | }; // namespace Ogre
|
---|
95 |
|
---|
96 | #endif // INCL_OGRE_GTKWINDOW_H
|
---|