source: OGRE/trunk/ogrenew/RenderSystems/GL/include/gtk/OgreGTKWindow.h @ 692

Revision 692, 3.0 KB checked in by mattausch, 19 years ago (diff)

adding ogre 1.2 and dependencies

Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://ogre.sourceforge.net/
6
7Copyright (c) 2000-2005 The OGRE Team
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-----------------------------------------------------------------------------
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
37namespace Ogre {
38
39class OGREWidget : public Gtk::GL::DrawingArea
40{
41public:
42    OGREWidget(bool useDepthBuffer);
43};
44   
45class GTKWindow : public RenderWindow, public SigC::Object
46{
47public:
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 );
83protected:
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)
88private:
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
Note: See TracBrowser for help on using the repository browser.