Started splitting example framework into to two classes. One will be general purpose (for use in Cubiquity, etc), and the other will have PolyVox specific stuff.

This commit is contained in:
David Williams 2015-02-20 16:20:09 +01:00
parent 9c93c5fc36
commit 838407ba4f
12 changed files with 64 additions and 15 deletions

View File

@ -25,11 +25,13 @@ PROJECT(BasicExample)
SET(SRC_FILES
main.cpp
../common/OpenGLWidget.cpp
../common/PolyVoxExample.cpp
)
#Projects headers files
SET(INC_FILES
../common/OpenGLWidget.h
../common/PolyVoxExample.h
)
#"Sources" and "Headers" are the group names in Visual Studio.

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "OpenGLWidget.h"
#include "PolyVoxExample.h"
#include "PolyVox/CubicSurfaceExtractor.h"
#include "PolyVox/MarchingCubesSurfaceExtractor.h"
@ -66,11 +66,11 @@ void createSphereInVolume(PagedVolume<uint8_t>& volData, float fRadius)
}
}
class BasicExample : public OpenGLWidget
class BasicExample : public PolyVoxExample
{
public:
BasicExample(QWidget *parent)
:OpenGLWidget(parent)
:PolyVoxExample(parent)
{
}

View File

@ -25,11 +25,13 @@ PROJECT(DecodeOnGPUExample)
SET(SRC_FILES
main.cpp
../common/OpenGLWidget.cpp
../common/PolyVoxExample.cpp
)
#Projects headers files
SET(INC_FILES
../common/OpenGLWidget.h
../common/PolyVoxExample.h
)
#"Sources" and "Headers" are the group names in Visual Studio.

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "OpenGLWidget.h"
#include "PolyVoxExample.h"
#include "PolyVox/CubicSurfaceExtractor.h"
#include "PolyVox/MarchingCubesSurfaceExtractor.h"
@ -66,11 +66,11 @@ void createSphereInVolume(PagedVolume<uint8_t>& volData, float fRadius)
}
}
class DecodeOnGPUExample : public OpenGLWidget
class DecodeOnGPUExample : public PolyVoxExample
{
public:
DecodeOnGPUExample(QWidget *parent)
:OpenGLWidget(parent)
:PolyVoxExample(parent)
{
}

View File

@ -30,6 +30,7 @@ SET(SRC_FILES
#OpenGLSupport.cpp
#OpenGLVertexBufferObjectSupport.cpp
../common/OpenGLWidget.cpp
../common/PolyVoxExample.cpp
Shapes.cpp
)
@ -39,6 +40,7 @@ SET(INC_FILES
#OpenGLSupport.h
#OpenGLVertexBufferObjectSupport.h
../common/OpenGLWidget.h
../common/PolyVoxExample.h
Shapes.h
)

View File

@ -31,7 +31,7 @@ freely, subject to the following restrictions:
#include "Shapes.h"
#include "OpenGLWidget.h"
#include "PolyVoxExample.h"
#ifdef WIN32
#include <windows.h> // Standard Header For Most Programs
@ -47,11 +47,11 @@ using namespace std;
const int32_t g_uVolumeSideLength = 128;
class OpenGLExample : public OpenGLWidget
class OpenGLExample : public PolyVoxExample
{
public:
OpenGLExample(QWidget *parent)
:OpenGLWidget(parent)
:PolyVoxExample(parent)
{
}

View File

@ -26,12 +26,14 @@ SET(SRC_FILES
main.cpp
../common/OpenGLWidget.cpp
Perlin.cpp
../common/PolyVoxExample.cpp
)
#Projects headers files
SET(INC_FILES
../common/OpenGLWidget.h
Perlin.h
../common/PolyVoxExample.h
)
#"Sources" and "Headers" are the group names in Visual Studio.

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "OpenGLWidget.h"
#include "PolyVoxExample.h"
#include "Perlin.h"
#include "PolyVox/MaterialDensityPair.h"
@ -139,11 +139,11 @@ public:
}
};
class PagingExample : public OpenGLWidget
class PagingExample : public PolyVoxExample
{
public:
PagingExample(QWidget *parent)
:OpenGLWidget(parent)
:PolyVoxExample(parent)
{
}

View File

@ -25,11 +25,13 @@ PROJECT(SmoothLODExample)
SET(SRC_FILES
main.cpp
../common/OpenGLWidget.cpp
../common/PolyVoxExample.cpp
)
#Projects headers files
SET(INC_FILES
../common/OpenGLWidget.h
../common/PolyVoxExample.h
)
#"Sources" and "Headers" are the group names in Visual Studio.

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "OpenGLWidget.h"
#include "PolyVoxExample.h"
#include "PolyVox/Density.h"
#include "PolyVox/MarchingCubesSurfaceExtractor.h"
@ -68,11 +68,11 @@ void createSphereInVolume(PagedVolume<uint8_t>& volData, float fRadius)
}
}
class SmoothLODExample : public OpenGLWidget
class SmoothLODExample : public PolyVoxExample
{
public:
SmoothLODExample(QWidget *parent)
:OpenGLWidget(parent)
:PolyVoxExample(parent)
{
}

View File

@ -0,0 +1 @@
#include "PolyVoxExample.h"

View File

@ -0,0 +1,38 @@
/*******************************************************************************
Copyright (c) 2005-2009 David Williams
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*******************************************************************************/
#ifndef __PolyVoxExample_H__
#define __PolyVoxExample_H__
#include "OpenGLWidget.h"
class PolyVoxExample : public OpenGLWidget
{
public:
PolyVoxExample(QWidget *parent)
:OpenGLWidget(parent)
{
}
};
#endif //__PolyVoxExample_H__