Work on basic logging framework.

This commit is contained in:
David Williams
2009-04-06 21:16:40 +00:00
parent 1b76395856
commit 97b162ee20
6 changed files with 70 additions and 13 deletions

View File

@ -63,3 +63,11 @@ INSTALL(TARGETS OpenGLExample
ARCHIVE DESTINATION Examples/OpenGL/lib
COMPONENT example
)
IF(WIN32)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../library/PolyVoxCore/release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../library/PolyVoxUtil/release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../library/PolyVoxCore/debug/PolyVoxCore_d.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../library/PolyVoxUtil/debug/PolyVoxUtil_d.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
ENDIF(WIN32)

View File

@ -21,14 +21,32 @@ using namespace std;
using namespace PolyVox;
using namespace std;
void exampleLog(string message)
void exampleLog(string message, int severity)
{
//Identify how severe the mesage is
switch(severity)
{
case LS_DEBUG:
cout << "DEBUG: ";
break;
case LS_INFO:
cout << "INFO: ";
break;
case LS_WARN:
cout << "WARN: ";
break;
case LS_ERROR:
cout << "ERROR: ";
break;
}
//Print the message
cout << message << endl;
}
int main(int argc, char *argv[])
{
logImpl = &exampleLog;
{
logHandler = &exampleLog;
Volume<PolyVox::uint8_t> volData(g_uVolumeSideLength);
//Make our volume contain a sphere in the center.
@ -48,17 +66,17 @@ int main(int argc, char *argv[])
createCubeInVolume(volData, Vector3DUint16(midPos+1, minPos, midPos+1), Vector3DUint16(maxPos, midPos-1, maxPos), 0);
createCubeInVolume(volData, Vector3DUint16(minPos, midPos+1, midPos+1), Vector3DUint16(midPos-1, maxPos, maxPos), 0);
QApplication app(argc, argv);
QApplication app(argc, argv);
OpenGLWidget openGLWidget(0);
OpenGLWidget openGLWidget(0);
openGLWidget.show();
openGLWidget.setVolume(&volData);
openGLWidget.show();
return app.exec();
}
openGLWidget.setVolume(&volData);
return app.exec();
}
#ifdef USING_GLUT