1 // Ryzom Core MMORPG framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2012-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef NEL3D_WIDGET_H
22 #define NEL3D_WIDGET_H
24 #include "nel/misc/types_nl.h"
33 #define NEL3DWIDGET QWidget
36 #define NEL3DWIDGET QGLWidget
40 #include "../core_global.h"
48 /// Nel 3D interface to Qt
49 class CORE_EXPORT Nel3DWidget
: public NEL3DWIDGET
53 Nel3DWidget( QWidget
*parent
= NULL
);
54 virtual ~Nel3DWidget();
57 void createTextContext( std::string fontFile
);
59 NL3D::UDriver
* getDriver() const{ return driver
; }
60 NL3D::UTextContext
* getTextContext() const{ return textContext
; }
63 // Need to return NULL paintengine to Qt so that we can
64 // render the widget normally ourselves, without the image
65 // disappearing when a widget is resized or shown on top of us
66 QPaintEngine
* paintEngine() const{ return NULL
; }
69 void resize( int width
, int height
);
76 void showEvent( QShowEvent
*evnt
);
77 void resizeEvent( QResizeEvent
*evnt
);
79 #if defined(NL_OS_WINDOWS)
80 bool winEvent( MSG
*message
, long *result
);
81 #elif defined(NL_OS_MAC)
82 bool macEvent( EventHandlerCallRef caller
, EventRef event
);
83 #elif defined(NL_OS_UNIX)
84 bool x11Event( XEvent
*event
);
88 NL3D::UDriver
*driver
;
89 NL3D::UTextContext
*textContext
;