Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreGTKWindow.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004 (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://ogre.sourceforge.net/
00006 
00007 Copyright (c) 2000-2005 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 
00026 #ifndef INCL_OGRE_GTKWINDOW_H
00027 #define INCL_OGRE_GTKWINDOW_H
00028 
00029 #include "OgreRenderWindow.h"
00030 
00031 #include <gtkmm/main.h>
00032 #include <gtkmm/window.h>
00033 #include <gtkglmm.h>
00034 
00035 #include <GL/gl.h>
00036 
00037 namespace Ogre {
00038 
00039 class OGREWidget : public Gtk::GL::DrawingArea
00040 {
00041 public:
00042     OGREWidget(bool useDepthBuffer);
00043 };
00044     
00045 class GTKWindow : public RenderWindow, public SigC::Object
00046 {
00047 public:
00048     GTKWindow();
00049     ~GTKWindow();
00050 
00055     bool pump_events();
00056 
00060     OGREWidget* get_ogre_widget();
00061 
00062     void create(const String& name, unsigned int width, unsigned int height, unsigned int colourDepth,
00063                 bool fullScreen, int left, int top, bool depthBuffer, 
00064                 void* miscParam, ...);
00065 
00066     void destroy(void);
00067     bool isActive(void) const;
00068     bool isClosed(void) const;
00069     void reposition(int left, int top);
00070     void resize(unsigned int width, unsigned int height);
00071     void swapBuffers(bool waitForVSync);
00072     void writeContentsToFile(const String& filename);
00073 
00074     bool requiresTextureFlipping() const { return false; }
00075 
00082     void getCustomAttribute( const String& name, void* pData );
00083 protected:
00084     // Signal handlers
00085     bool on_delete_event(GdkEventAny* event);
00086     bool on_expose_event(GdkEventExpose* event);
00087     // bool SimpleGLScene::on_configure_event(GdkEventConfigure* event) 
00088 private:
00089     //Gtk::Main* kit;
00090     Gtk::Window *mGtkWindow;
00091     OGREWidget* ogre;
00092 }; // class GTKWindow
00093 
00094 }; // namespace Ogre
00095 
00096 #endif // INCL_OGRE_GTKWINDOW_H

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:46 2006