Update Ghoul

Change TriangleSoup and StatsCollector to use new Boolean class
This commit is contained in:
Alexander Bock
2016-09-08 15:32:27 +02:00
parent 965f3eded0
commit 0376300732
6 changed files with 31 additions and 45 deletions
@@ -36,9 +36,9 @@ TriangleSoup::TriangleSoup(std::vector<unsigned int> elements,
: _vaoID(0)
,_vertexBufferID(0)
,_elementBufferID(0)
,_useVertexPositions(usePositions == Positions::Yes)
,_useTextureCoordinates(useTextures == TextureCoordinates::Yes)
,_useVertexNormals(useNormals == Normals::Yes)
,_useVertexPositions(usePositions)
,_useTextureCoordinates(useTextures)
,_useVertexNormals(useNormals)
{
setElements(elements);
}
+5 -5
View File
@@ -25,6 +25,7 @@
#ifndef __TRIANGLESOUP_H__
#define __TRIANGLESOUP_H__
#include <ghoul/misc/boolean.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/logging/logmanager.h>
@@ -44,12 +45,11 @@ namespace openspace {
// TODO : Possibly render triangle strips in this class instead of triangles since
// that is faster
class TriangleSoup
{
class TriangleSoup {
public:
enum class Positions { Yes, No };
enum class TextureCoordinates { Yes, No };
enum class Normals { Yes, No };
using Positions = ghoul::Boolean;
using TextureCoordinates = ghoul::Boolean;
using Normals = ghoul::Boolean;
TriangleSoup(
std::vector<unsigned int> elements, // At least elements are required
+3 -2
View File
@@ -24,6 +24,7 @@
#ifndef __STATS_TRACKER_H__
#define __STATS_TRACKER_H__
#include <ghoul/misc/boolean.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/filesystem/filesystem>
@@ -143,13 +144,13 @@ namespace openspace {
StatsCollector() = delete;
enum class Enabled { Yes, No };
using Enabled = ghoul::Boolean;
StatsCollector(const std::string& filename, int dumpEveryXRecord, Enabled enabled = Enabled::Yes, const std::string& delimiter = ",")
: _filename(filename)
, _dumpEveryXRecord(dumpEveryXRecord)
, _recordsSinceLastDump(0)
, _enabled(enabled == Enabled::Yes)
, _enabled(enabled)
, _delimiter(delimiter)
, _hasWrittenHeader(false)
, i(TemplatedStatsCollector<long long>(_enabled, delimiter))