Converting OpenGLExample to use common OpenGLWidget.
This commit is contained in:
@ -22,6 +22,7 @@ freely, subject to the following restrictions:
|
||||
*******************************************************************************/
|
||||
|
||||
#include "PolyVoxCore/FilePager.h"
|
||||
#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h"
|
||||
#include "PolyVoxCore/MaterialDensityPair.h"
|
||||
#include "PolyVoxCore/LargeVolume.h"
|
||||
#include "PolyVoxCore/LowPassFilter.h"
|
||||
@ -30,8 +31,6 @@ freely, subject to the following restrictions:
|
||||
#include "PolyVoxCore/Mesh.h"
|
||||
#include "PolyVoxCore/Impl/Utility.h"
|
||||
|
||||
#include "OpenGLImmediateModeSupport.h"
|
||||
#include "OpenGLVertexBufferObjectSupport.h"
|
||||
#include "Shapes.h"
|
||||
|
||||
#include "OpenGLWidget.h"
|
||||
@ -48,6 +47,8 @@ using namespace std;
|
||||
using namespace PolyVox;
|
||||
using namespace std;
|
||||
|
||||
const int32_t g_uVolumeSideLength = 128;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
RLEBlockCompressor<MaterialDensityPair44>* compressor = new RLEBlockCompressor<MaterialDensityPair44>();
|
||||
@ -98,9 +99,16 @@ int main(int argc, char *argv[])
|
||||
|
||||
QTime time;
|
||||
time.start();
|
||||
openGLWidget.setVolume(&volData);
|
||||
//openGLWidget.setVolume(&volData);
|
||||
cout << endl << "Time taken = " << time.elapsed() / 1000.0f << "s" << endl << endl;
|
||||
|
||||
auto mesh = extractMarchingCubesMesh(&volData, volData.getEnclosingRegion());
|
||||
|
||||
//Pass the surface to the OpenGL window
|
||||
openGLWidget.addMesh(mesh);
|
||||
//openGLWidget.addMesh(mesh2);
|
||||
openGLWidget.setViewableRegion(volData.getEnclosingRegion());
|
||||
|
||||
//return 0;
|
||||
|
||||
return app.exec();
|
||||
|
Reference in New Issue
Block a user