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:
parent
9c93c5fc36
commit
838407ba4f
@ -25,11 +25,13 @@ PROJECT(BasicExample)
|
|||||||
SET(SRC_FILES
|
SET(SRC_FILES
|
||||||
main.cpp
|
main.cpp
|
||||||
../common/OpenGLWidget.cpp
|
../common/OpenGLWidget.cpp
|
||||||
|
../common/PolyVoxExample.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
#Projects headers files
|
#Projects headers files
|
||||||
SET(INC_FILES
|
SET(INC_FILES
|
||||||
../common/OpenGLWidget.h
|
../common/OpenGLWidget.h
|
||||||
|
../common/PolyVoxExample.h
|
||||||
)
|
)
|
||||||
|
|
||||||
#"Sources" and "Headers" are the group names in Visual Studio.
|
#"Sources" and "Headers" are the group names in Visual Studio.
|
||||||
|
@ -21,7 +21,7 @@ freely, subject to the following restrictions:
|
|||||||
distribution.
|
distribution.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include "OpenGLWidget.h"
|
#include "PolyVoxExample.h"
|
||||||
|
|
||||||
#include "PolyVox/CubicSurfaceExtractor.h"
|
#include "PolyVox/CubicSurfaceExtractor.h"
|
||||||
#include "PolyVox/MarchingCubesSurfaceExtractor.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:
|
public:
|
||||||
BasicExample(QWidget *parent)
|
BasicExample(QWidget *parent)
|
||||||
:OpenGLWidget(parent)
|
:PolyVoxExample(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,11 +25,13 @@ PROJECT(DecodeOnGPUExample)
|
|||||||
SET(SRC_FILES
|
SET(SRC_FILES
|
||||||
main.cpp
|
main.cpp
|
||||||
../common/OpenGLWidget.cpp
|
../common/OpenGLWidget.cpp
|
||||||
|
../common/PolyVoxExample.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
#Projects headers files
|
#Projects headers files
|
||||||
SET(INC_FILES
|
SET(INC_FILES
|
||||||
../common/OpenGLWidget.h
|
../common/OpenGLWidget.h
|
||||||
|
../common/PolyVoxExample.h
|
||||||
)
|
)
|
||||||
|
|
||||||
#"Sources" and "Headers" are the group names in Visual Studio.
|
#"Sources" and "Headers" are the group names in Visual Studio.
|
||||||
|
@ -21,7 +21,7 @@ freely, subject to the following restrictions:
|
|||||||
distribution.
|
distribution.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include "OpenGLWidget.h"
|
#include "PolyVoxExample.h"
|
||||||
|
|
||||||
#include "PolyVox/CubicSurfaceExtractor.h"
|
#include "PolyVox/CubicSurfaceExtractor.h"
|
||||||
#include "PolyVox/MarchingCubesSurfaceExtractor.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:
|
public:
|
||||||
DecodeOnGPUExample(QWidget *parent)
|
DecodeOnGPUExample(QWidget *parent)
|
||||||
:OpenGLWidget(parent)
|
:PolyVoxExample(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ SET(SRC_FILES
|
|||||||
#OpenGLSupport.cpp
|
#OpenGLSupport.cpp
|
||||||
#OpenGLVertexBufferObjectSupport.cpp
|
#OpenGLVertexBufferObjectSupport.cpp
|
||||||
../common/OpenGLWidget.cpp
|
../common/OpenGLWidget.cpp
|
||||||
|
../common/PolyVoxExample.cpp
|
||||||
Shapes.cpp
|
Shapes.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -39,6 +40,7 @@ SET(INC_FILES
|
|||||||
#OpenGLSupport.h
|
#OpenGLSupport.h
|
||||||
#OpenGLVertexBufferObjectSupport.h
|
#OpenGLVertexBufferObjectSupport.h
|
||||||
../common/OpenGLWidget.h
|
../common/OpenGLWidget.h
|
||||||
|
../common/PolyVoxExample.h
|
||||||
Shapes.h
|
Shapes.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ freely, subject to the following restrictions:
|
|||||||
|
|
||||||
#include "Shapes.h"
|
#include "Shapes.h"
|
||||||
|
|
||||||
#include "OpenGLWidget.h"
|
#include "PolyVoxExample.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h> // Standard Header For Most Programs
|
#include <windows.h> // Standard Header For Most Programs
|
||||||
@ -47,11 +47,11 @@ using namespace std;
|
|||||||
|
|
||||||
const int32_t g_uVolumeSideLength = 128;
|
const int32_t g_uVolumeSideLength = 128;
|
||||||
|
|
||||||
class OpenGLExample : public OpenGLWidget
|
class OpenGLExample : public PolyVoxExample
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OpenGLExample(QWidget *parent)
|
OpenGLExample(QWidget *parent)
|
||||||
:OpenGLWidget(parent)
|
:PolyVoxExample(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,12 +26,14 @@ SET(SRC_FILES
|
|||||||
main.cpp
|
main.cpp
|
||||||
../common/OpenGLWidget.cpp
|
../common/OpenGLWidget.cpp
|
||||||
Perlin.cpp
|
Perlin.cpp
|
||||||
|
../common/PolyVoxExample.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
#Projects headers files
|
#Projects headers files
|
||||||
SET(INC_FILES
|
SET(INC_FILES
|
||||||
../common/OpenGLWidget.h
|
../common/OpenGLWidget.h
|
||||||
Perlin.h
|
Perlin.h
|
||||||
|
../common/PolyVoxExample.h
|
||||||
)
|
)
|
||||||
|
|
||||||
#"Sources" and "Headers" are the group names in Visual Studio.
|
#"Sources" and "Headers" are the group names in Visual Studio.
|
||||||
|
@ -21,7 +21,7 @@ freely, subject to the following restrictions:
|
|||||||
distribution.
|
distribution.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include "OpenGLWidget.h"
|
#include "PolyVoxExample.h"
|
||||||
#include "Perlin.h"
|
#include "Perlin.h"
|
||||||
|
|
||||||
#include "PolyVox/MaterialDensityPair.h"
|
#include "PolyVox/MaterialDensityPair.h"
|
||||||
@ -139,11 +139,11 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class PagingExample : public OpenGLWidget
|
class PagingExample : public PolyVoxExample
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PagingExample(QWidget *parent)
|
PagingExample(QWidget *parent)
|
||||||
:OpenGLWidget(parent)
|
:PolyVoxExample(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,11 +25,13 @@ PROJECT(SmoothLODExample)
|
|||||||
SET(SRC_FILES
|
SET(SRC_FILES
|
||||||
main.cpp
|
main.cpp
|
||||||
../common/OpenGLWidget.cpp
|
../common/OpenGLWidget.cpp
|
||||||
|
../common/PolyVoxExample.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
#Projects headers files
|
#Projects headers files
|
||||||
SET(INC_FILES
|
SET(INC_FILES
|
||||||
../common/OpenGLWidget.h
|
../common/OpenGLWidget.h
|
||||||
|
../common/PolyVoxExample.h
|
||||||
)
|
)
|
||||||
|
|
||||||
#"Sources" and "Headers" are the group names in Visual Studio.
|
#"Sources" and "Headers" are the group names in Visual Studio.
|
||||||
|
@ -21,7 +21,7 @@ freely, subject to the following restrictions:
|
|||||||
distribution.
|
distribution.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include "OpenGLWidget.h"
|
#include "PolyVoxExample.h"
|
||||||
|
|
||||||
#include "PolyVox/Density.h"
|
#include "PolyVox/Density.h"
|
||||||
#include "PolyVox/MarchingCubesSurfaceExtractor.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:
|
public:
|
||||||
SmoothLODExample(QWidget *parent)
|
SmoothLODExample(QWidget *parent)
|
||||||
:OpenGLWidget(parent)
|
:PolyVoxExample(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
examples/common/PolyVoxExample.cpp
Normal file
1
examples/common/PolyVoxExample.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "PolyVoxExample.h"
|
38
examples/common/PolyVoxExample.h
Normal file
38
examples/common/PolyVoxExample.h
Normal 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__
|
Loading…
x
Reference in New Issue
Block a user