Skip to content

Commit 79da0d8

Browse files
author
Damien Mabin
committed
Fix tuple for mac
Fix mouse and trackpad issue on macosX
1 parent 0ed4fe7 commit 79da0d8

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ screenshot.bmp
1010
Thumbs.db
1111
OpenGL-tutorial_v*
1212
**.mtl
13+
.DS_Store

common/controls.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ void computeMatricesFromInputs(){
4848
glfwGetCursorPos(window, &xpos, &ypos);
4949

5050
// Reset mouse position for next frame
51-
glfwSetCursorPos(window, 1024/2, 768/2);
51+
glfwSetCursorPos(window, 0, 0);
5252

5353
// Compute new orientation
54-
horizontalAngle += mouseSpeed * float(1024/2 - xpos );
55-
verticalAngle += mouseSpeed * float( 768/2 - ypos );
54+
horizontalAngle += mouseSpeed * float(-xpos );
55+
verticalAngle += mouseSpeed * float(-ypos );
5656

5757
// Direction : Spherical coordinates to Cartesian coordinates conversion
5858
glm::vec3 direction(

external/assimp-3.0.1270/code/BoostWorkaround/boost/tuple/tuple.hpp

+19-19
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ namespace boost {
175175
// Get a specific tuple element
176176
template <unsigned N>
177177
typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () {
178-
return m.get<N>();
178+
return m.template get<N>();
179179
}
180180

181181
// ... and the const version
182182
template <unsigned N>
183183
const typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () const {
184-
return m.get<N>();
184+
return m.template get<N>();
185185
}
186186

187187

@@ -208,14 +208,14 @@ namespace boost {
208208
template <unsigned N,typename T0,typename T1,typename T2,typename T3,typename T4>
209209
inline typename tuple<T0,T1,T2,T3,T4>::very_long::template type_getter<N>::type& get (
210210
tuple<T0,T1,T2,T3,T4>& m) {
211-
return m.get<N>();
211+
return m.template get<N>();
212212
}
213213

214214
// ... and the const version
215215
template <unsigned N,typename T0,typename T1,typename T2,typename T3,typename T4>
216216
inline const typename tuple<T0,T1,T2,T3,T4>::very_long::template type_getter<N>::type& get (
217217
const tuple<T0,T1,T2,T3,T4>& m) {
218-
return m.get<N>();
218+
return m.template get<N>();;
219219
}
220220

221221
// Constructs a tuple with 5 elements
@@ -224,11 +224,11 @@ namespace boost {
224224
const T1& t1,const T2& t2,const T3& t3,const T4& t4) {
225225

226226
tuple <T0,T1,T2,T3,T4> t;
227-
t.get<0>() = t0;
228-
t.get<1>() = t1;
229-
t.get<2>() = t2;
230-
t.get<3>() = t3;
231-
t.get<4>() = t4;
227+
t.template get<0>() = t0;
228+
t.template get<1>() = t1;
229+
t.template get<2>() = t2;
230+
t.template get<3>() = t3;
231+
t.template get<4>() = t4;
232232
return t;
233233
}
234234

@@ -237,10 +237,10 @@ namespace boost {
237237
inline tuple <T0,T1,T2,T3> make_tuple (const T0& t0,
238238
const T1& t1,const T2& t2,const T3& t3) {
239239
tuple <T0,T1,T2,T3> t;
240-
t.get<0>() = t0;
241-
t.get<1>() = t1;
242-
t.get<2>() = t2;
243-
t.get<3>() = t3;
240+
t.template get<0>() = t0;
241+
t.template get<1>() = t1;
242+
t.template get<2>() = t2;
243+
t.template get<3>() = t3;
244244
return t;
245245
}
246246

@@ -249,9 +249,9 @@ namespace boost {
249249
inline tuple <T0,T1,T2> make_tuple (const T0& t0,
250250
const T1& t1,const T2& t2) {
251251
tuple <T0,T1,T2> t;
252-
t.get<0>() = t0;
253-
t.get<1>() = t1;
254-
t.get<2>() = t2;
252+
t.template get<0>() = t0;
253+
t.template get<1>() = t1;
254+
t.template get<2>() = t2;
255255
return t;
256256
}
257257

@@ -260,16 +260,16 @@ namespace boost {
260260
inline tuple <T0,T1> make_tuple (const T0& t0,
261261
const T1& t1) {
262262
tuple <T0,T1> t;
263-
t.get<0>() = t0;
264-
t.get<1>() = t1;
263+
t.template get<0>() = t0;
264+
t.template get<1>() = t1;
265265
return t;
266266
}
267267

268268
// Constructs a tuple with 1 elements (no comment ...)
269269
template <typename T0>
270270
inline tuple <T0> make_tuple (const T0& t0) {
271271
tuple <T0> t;
272-
t.get<0>() = t0;
272+
t.template get<0>() = t0;
273273
return t;
274274
}
275275

tutorial06_keyboard_and_mouse/tutorial06.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main( void )
3131
glfwWindowHint(GLFW_SAMPLES, 4);
3232
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
3333
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
34-
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // To make MacOS happy; should not be needed
34+
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // To make MacOS happy; should not be needed
3535
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
3636

3737
// Open a window and create its OpenGL context
@@ -42,7 +42,11 @@ int main( void )
4242
glfwTerminate();
4343
return -1;
4444
}
45-
glfwMakeContextCurrent(window);
45+
glfwMakeContextCurrent(window);
46+
//glfwSetCursorPos(window, 1024/2, 768/2);
47+
//glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
48+
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
49+
//glfwSetCursorPos(window, 1024/2, 768/2);
4650

4751
// Initialize GLEW
4852
glewExperimental = true; // Needed for core profile

0 commit comments

Comments
 (0)