COculusRenderContext.h
Go to the documentation of this file.
1 //==============================================================================
2 /*
3  Software License Agreement (BSD License)
4  Copyright (c) 2003-2016, CHAI3D.
5  (www.chai3d.org)
6 
7  All rights reserved.
8 
9  Redistribution and use in source and binary forms, with or without
10  modification, are permitted provided that the following conditions
11  are met:
12 
13  * Redistributions of source code must retain the above copyright
14  notice, this list of conditions and the following disclaimer.
15 
16  * Redistributions in binary form must reproduce the above
17  copyright notice, this list of conditions and the following
18  disclaimer in the documentation and/or other materials provided
19  with the distribution.
20 
21  * Neither the name of CHAI3D nor the names of its contributors may
22  be used to endorse or promote products derived from this software
23  without specific prior written permission.
24 
25  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  POSSIBILITY OF SUCH DAMAGE.
37 
38  \author <http://www.chai3d.org>
39  \author Krzysztof Kondrak
40  \author Francois Conti
41  \version 3.2.0 $Rev: 2173 $
42 */
43 //==============================================================================
44 
45 //------------------------------------------------------------------------------
46 #ifndef OVRRenderContextH
47 #define OVRRenderContextH
48 //------------------------------------------------------------------------------
49 #include "math/CMaths.h"
50 //------------------------------------------------------------------------------
51 
52 //------------------------------------------------------------------------------
53 namespace chai3d {
54 //------------------------------------------------------------------------------
55 
56 //==============================================================================
64 //==============================================================================
65 
66 //==============================================================================
76 //==============================================================================
78 {
79  //--------------------------------------------------------------------------
80  // CONSTRUCTOR & DESTRUCTOR:
81  //--------------------------------------------------------------------------
82 
83 public:
84 
87  {
88  m_fov = (float)chai3d::cDegToRad(75.0);
89  m_nearPlane = 0.1f;
90  m_farPlane = 1000.0f;
91  m_scrRatio = 0.0f;
92  m_width = 0;
93  m_height = 0;
94  m_halfWidth = 0;
95  m_halfHeight = 0;
96  m_left = 0.0f;
97  m_right = 0.0f;
98  m_bottom = 0.0f;
99  m_top = 0.0f;
100  }
101 
104 
105 
106  //--------------------------------------------------------------------------
107  // PUBLIC METHODS:
108  //--------------------------------------------------------------------------
109 
110 public:
111 
112  void init(const char *title, int x, int y, int w, int h);
113  void destroy();
114 
115 
116  //--------------------------------------------------------------------------
117  // PUBLIC MEMBERS:
118  //--------------------------------------------------------------------------
119 
120 public:
121 
122  float m_fov;
123  float m_nearPlane;
124  float m_farPlane;
125  float m_scrRatio;
126  int m_width;
127  int m_height;
130 
131  // ortho parameters
132  float m_left;
133  float m_right;
134  float m_bottom;
135  float m_top;
136 
137  cTransform m_modelViewProjectionMatrix; // global MVP used to orient the entire world
138 };
139 
140 //------------------------------------------------------------------------------
141 } // namespace chai3d
142 //------------------------------------------------------------------------------
143 
144 //------------------------------------------------------------------------------
145 #endif
146 //------------------------------------------------------------------------------
float m_nearPlane
Definition: COculusRenderContext.h:123
void destroy()
Definition: COculusRenderContext.cpp:91
float m_bottom
Definition: COculusRenderContext.h:134
float m_scrRatio
Definition: COculusRenderContext.h:125
int m_halfWidth
Definition: COculusRenderContext.h:128
double cDegToRad(const double &a_angleDeg)
cOVRRenderContext()
Constructor of cOVRRenderContext.
Definition: COculusRenderContext.h:86
cTransform m_modelViewProjectionMatrix
Definition: COculusRenderContext.h:137
float m_left
Definition: COculusRenderContext.h:132
int m_width
Definition: COculusRenderContext.h:126
This class implements a rendering context using the SDL library.
Definition: COculusRenderContext.h:77
float m_fov
Definition: COculusRenderContext.h:122
int m_halfHeight
Definition: COculusRenderContext.h:129
float m_farPlane
Definition: COculusRenderContext.h:124
float m_right
Definition: COculusRenderContext.h:133
~cOVRRenderContext()
Destructor of cOVRRenderContext.
Definition: COculusRenderContext.h:103
int m_height
Definition: COculusRenderContext.h:127
float m_top
Definition: COculusRenderContext.h:135
void init(const char *title, int x, int y, int w, int h)
Definition: COculusRenderContext.cpp:53