[gtkmm] example_glarea.cc: Fix Build on Visual Studio 2013
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] example_glarea.cc: Fix Build on Visual Studio 2013
- Date: Thu, 17 Sep 2015 08:00:37 +0000 (UTC)
commit 1ee68b62ce9df596cf3bf6f10dc469c1be489966
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Thu Sep 17 15:59:21 2015 +0800
example_glarea.cc: Fix Build on Visual Studio 2013
Apparently there is another quirk in Visual Studio 2013's C++
support, so one must use std::vector to declare the class member, and
then use a member initializer list to initialize it properly by the
constructor, if not doing it one-by-one in the constructor itself.
https://bugzilla.gnome.org/show_bug.cgi?id=754863
demos/gtk-demo/example_glarea.cc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/demos/gtk-demo/example_glarea.cc b/demos/gtk-demo/example_glarea.cc
index 59a7808..4baf3ff 100644
--- a/demos/gtk-demo/example_glarea.cc
+++ b/demos/gtk-demo/example_glarea.cc
@@ -6,6 +6,7 @@
#include <iostream>
#include <string>
+#include <vector>
#include <gtkmm.h>
#include <giomm/resource.h>
@@ -46,7 +47,7 @@ protected:
GLuint m_Program {0};
GLuint m_Mvp {0};
- float m_RotationAngles[N_AXIS] {0.0f, 0.0f, 0.0f};
+ std::vector<float> m_RotationAngles;
void on_axis_value_change(int axis, const Glib::RefPtr<Gtk::Adjustment>& adj);
@@ -65,7 +66,7 @@ Gtk::Window* do_glarea()
return new Example_GLArea();
}
-Example_GLArea::Example_GLArea()
+Example_GLArea::Example_GLArea() : m_RotationAngles(N_AXIS, 0.0f)
{
set_title("GL Area");
set_default_size(400, 600);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]