Changeset 2870 for trunk/packages/vizservers/nanovis/nanovis.cpp
- Timestamp:
- Mar 19, 2012, 9:04:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/nanovis.cpp
r2863 r2870 63 63 #include "HeightMap.h" 64 64 #include "NvCamera.h" 65 #include "NvEventLog.h" 66 #include "RenderContext.h" 67 #include "NvShader.h" 65 68 #include "NvColorTableRenderer.h" 66 #include "NvEventLog.h"67 69 #include "NvFlowVisRenderer.h" 68 70 #include "NvLIC.h" … … 74 76 #include "PointSet.h" 75 77 #endif 76 #include "RenderContext.h"77 78 #include "Switch.h" 78 79 #include "Trace.h" … … 84 85 85 86 #define SIZEOF_BMP_HEADER 54 86 87 extern void NvInitCG(); // in Shader.cpp88 87 89 88 /// Indicates "up" axis … … 192 191 193 192 PerfQuery *perf = NULL; //perfromance counter 194 195 CGprogram m_passthru_fprog;196 CGparameter m_passthru_scale_param, m_passthru_bias_param;197 193 198 194 // Variables for mouse events … … 360 356 removeAllData(); 361 357 358 NvShader::exitCg(); 359 362 360 #ifdef EVENTLOG 363 361 NvExitEventLog(); … … 373 371 closelog(); 374 372 exit(code); 375 }376 377 CGprogram378 LoadCgSourceProgram(CGcontext context, const char *fileName, CGprofile profile,379 const char *entryPoint)380 {381 const char *path = R2FilePath::getInstance()->getPath(fileName);382 if (path == NULL) {383 ERROR("can't find program \"%s\"\n", fileName);384 }385 TRACE("cg program compiling: %s\n", path);386 CGprogram program;387 program = cgCreateProgramFromFile(context, CG_SOURCE, path, profile,388 entryPoint, NULL);389 cgGLLoadProgram(program);390 CGerror LastError = cgGetError();391 if (LastError) {392 ERROR("Error message: %s\n", cgGetLastListing(context));393 }394 TRACE("successfully compiled program: %s\n", path);395 delete [] path;396 return program;397 373 } 398 374 … … 719 695 void CgErrorCallback(void) 720 696 { 721 CGerror lastError = cgGetError(); 722 723 if (lastError) { 724 TRACE("\n---------------------------------------------------\n"); 725 TRACE("%s\n\n", cgGetErrorString(lastError)); 726 TRACE("%s\n", cgGetLastListing(g_context)); 727 TRACE("-----------------------------------------------------\n"); 697 if (!NvShader::printErrorInfo()) { 728 698 TRACE("Cg error, exiting...\n"); 729 cgDestroyContext(g_context);730 699 DoExit(-1); 731 700 } … … 735 704 { 736 705 // print system information 737 system_info(); 706 TRACE("-----------------------------------------------------------\n"); 707 TRACE("OpenGL driver: %s %s\n", glGetString(GL_VENDOR), 708 glGetString(GL_VERSION)); 709 TRACE("Graphics hardware: %s\n", glGetString(GL_RENDERER)); 710 TRACE("-----------------------------------------------------------\n"); 738 711 739 712 if (path == NULL) { … … 758 731 ImageLoaderFactory::getInstance()->addLoaderImpl("bmp", new BMPImageLoaderImpl()); 759 732 760 Nv InitCG();733 NvShader::initCg(); 761 734 NvShader::setErrorCallback(CgErrorCallback); 762 735 … … 774 747 licRenderer = new NvLIC(NMESH, NPIX, NPIX, lic_axis, 775 748 Vector3(lic_slice_x, lic_slice_y, lic_slice_z), 776 g_context);749 NvShader::getCgContext()); 777 750 778 751 grid = new Grid(); … … 841 814 renderContext = new graphics::RenderContext(); 842 815 843 //create n2D plane renderer816 //create a 2D plane renderer 844 817 plane_renderer = new PlaneRenderer(win_width, win_height); 845 818 #if PROTOTYPE
Note: See TracChangeset
for help on using the changeset viewer.