Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
x11session.h
Go to the documentation of this file.
1 /*
2  This file is part of Mitsuba, a physically based rendering system.
3 
4  Copyright (c) 2007-2014 by Wenzel Jakob and others.
5 
6  Mitsuba is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License Version 3
8  as published by the Free Software Foundation.
9 
10  Mitsuba is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #if !defined(__MITSUBA_HW_X11SESSION_H_)
20 #define __MITSUBA_HW_X11SESSION_H_
21 
22 #include <mitsuba/hw/session.h>
23 #include <GL/glx.h>
24 #include <X11/extensions/xf86vmode.h>
25 
27 
28 /** \brief X Window System (X11R6) session
29  * \ingroup libhw
30  */
32  friend class X11Device;
33  friend class GLXDevice;
34  friend class GLXRenderer;
35 public:
36  /// Create a new session
37  X11Session();
38 
39  /// Set the display name (eg. "localhost:0.0")
40  void setDisplayName(const std::string &displayname);
41 
42  /// Initialize the session
43  void init();
44 
45  /// Shut the session down
46  void shutdown();
47 
48  /// Process all events and call event callbacks
49  void processEvents();
50 
51  /**
52  * \brief Process all events and call event callbacks.
53  *
54  * This function will run until the \c stop parameter is set
55  * to \c true from within an event callback.
56  */
57  void processEventsBlocking(bool &stop);
58 
60 protected:
61  /// Virtual destructor
62  virtual ~X11Session();
63 protected:
64  std::string m_displayName;
65  Display *m_display;
66  Window m_root;
67  int m_screen;
68  bool m_hasVidMode;
69  bool m_hasGLX;
70 };
71 
73 
74 #endif /* __MITSUBA_HW_X11SESSION_H_ */
#define MTS_EXPORT_HW
Definition: platform.h:114
GLX (XFree86) renderer.
Definition: glxrenderer.h:30
virtual void processEvents()=0
Process all events and call event callbacks.
X Window System (X11R6) session.
Definition: x11session.h:31
virtual void init()
Initialize the session.
X Window System (X11R6) device / software surface.
Definition: x11device.h:30
#define MTS_NAMESPACE_BEGIN
Definition: platform.h:137
virtual void shutdown()
Shut the session down.
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
virtual void processEventsBlocking(bool &stop)=0
Process all events and call event callbacks.
Abstract windowing environment session.
Definition: session.h:32
X Windows OpenGL-capable (GLX) device.
Definition: glxdevice.h:29
#define MTS_NAMESPACE_END
Definition: platform.h:138