Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nsglrenderer.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_NSGLRENDERER_H_)
20 #define __MITSUBA_HW_NSGLRENDERER_H_
21 
22 #include <mitsuba/hw/glrenderer.h>
23 #include <mitsuba/hw/nsgldevice.h>
24 
25 #ifdef __OBJC__
26 #include <Cocoa/Cocoa.h>
27 #endif
28 
30 
31 /** \brief A MacOS X (NSGL) OpenGL Renderer
32  * \ingroup libhw
33  */
35 public:
36  /// Create a new renderer
37  NSGLRenderer(NSGLSession *session);
38 
39  /// Initialize the renderer
40  void init(Device *device, Renderer *other = NULL);
41 
42  /// Shut the renderer down
43  void shutdown();
44 
45  /// Return the rendering context
46  inline void *getContext() { return m_context; }
47 
49 protected:
50  /// Virtual destructor
51  virtual ~NSGLRenderer();
52 
53  /// Lookup an OpenGL extension
54  void *lookupExtension(const std::string &name) const;
55 private:
56 #ifdef __OBJC__
57  NSOpenGLContext *m_context;
58 #else
59  void *m_context;
60 #endif
61 };
62 
64 
65 #endif /* __MITSUBA_HW_NSGLRENDERER_H_ */
A MacOS X (NSGL) OpenGL Renderer.
Definition: nsglrenderer.h:34
virtual void init(Device *device, Renderer *other=NULL)
Initialize the renderer.
#define MTS_EXPORT_HW
Definition: platform.h:114
A MacOS X (NSGL) windowing environment session.
Definition: nsglsession.h:29
#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
void * getContext()
Return the rendering context.
Definition: nsglrenderer.h:46
Abstract renderer implementation.
Definition: renderer.h:79
virtual void shutdown()
Shut the renderer down.
OpenGL implementation of the Renderer interface.
Definition: glrenderer.h:43
#define MTS_NAMESPACE_END
Definition: platform.h:138