Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/RenderSystems/GL/include/gtk/OgreGTKWindow.h @ 3

Last change on this file since 3 was 3, checked in by anonymous, 17 years ago

=update

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