Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
session.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 #pragma once
20 #if !defined(__MITSUBA_HW_SESSION_H_)
21 #define __MITSUBA_HW_SESSION_H_
22 
23 #include <mitsuba/mitsuba.h>
24 
26 
27 class Device;
28 
29 /** \brief Abstract windowing environment session
30  * \ingroup libhw
31  */
32 class MTS_EXPORT_HW Session : public Object {
33  friend class Device;
34 public:
35  /// Create a new session using the appropriate implementation
36  static Session *create();
37 
38  /// Initialize the session
39  virtual void init();
40 
41  /// Shut the session down
42  virtual void shutdown();
43 
44  /// Process all events and call event callbacks
45  virtual void processEvents() = 0;
46 
47  /**
48  * \brief Process all events and call event callbacks.
49  *
50  * This function will run until the \c stop parameter is set
51  * to \c true from within an event callback.
52  */
53  virtual void processEventsBlocking(bool &stop) = 0;
54 
56 protected:
57  /// Virtual destructor
58  virtual ~Session() { }
59 
60  /// Create a new session
61  Session();
62 protected:
64  std::vector<Device *> m_devices;
65 };
66 
68 
69 #endif /* __MITSUBA_HW_SESSION_H_ */
std::vector< Device * > m_devices
Definition: session.h:64
#define MTS_EXPORT_HW
Definition: platform.h:114
bool m_initialized
Definition: session.h:63
#define MTS_NAMESPACE_BEGIN
Definition: platform.h:137
An abstract drawing device.
Definition: device.h:136
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Abstract windowing environment session.
Definition: session.h:32
Parent of all Mitsuba classes.
Definition: object.h:38
#define MTS_NAMESPACE_END
Definition: platform.h:138