Changeset 953 for trunk/vizservers/nanovis/PointSetRenderer.cpp
- Timestamp:
- Mar 12, 2008, 3:48:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/vizservers/nanovis/PointSetRenderer.cpp
r915 r953 1 1 2 #include "Nv.h" 2 3 #include <GL/gl.h> … … 17 18 _shader = new PointShader(); 18 19 R2string path = R2FilePath::getInstance()->getPath("particle2.bmp"); 19 if (path.getLength() == 0) 20 { 20 if (path.getLength() == 0) { 21 21 printf("ERROR : pointset file not found - %s\n", (const char*) path); 22 22 fflush(stdout); … … 28 28 29 29 unsigned char* bytes = (unsigned char*) image->getImageBuffer(); 30 if (bytes) 31 { 32 for (int y = 0; y < image->getHeight(); ++y) 33 for (int x = 0; x < image->getWidth(); ++x, bytes +=4) 34 { 30 if (bytes) { 31 for (unsigned int y = 0; y < image->getHeight(); ++y) { 32 for (unsigned int x = 0; x < image->getWidth(); ++x, bytes +=4) { 35 33 bytes[3] = (bytes[0] == 0)? 0 : 255; 36 } 34 } 35 } 37 36 } 38 37 39 if (image) 40 { 41 _pointTexture = new Texture2D(image->getWidth(), image->getHeight(), GL_UNSIGNED_BYTE, GL_LINEAR, 42 4, (float*) image->getImageBuffer()); 43 } 44 else 45 { 38 if (image) { 39 _pointTexture = new Texture2D(image->getWidth(), image->getHeight(), 40 GL_UNSIGNED_BYTE, GL_LINEAR, 41 4, (float*) image->getImageBuffer()); 42 } else { 46 43 printf("fail to load image [%s]\n", "particles2.bmp"); 47 44 } 48 45 49 46 delete loader; 50 51 47 _bucketSort = new PCA::BucketSort(1024); 52 48 }
Note: See TracChangeset
for help on using the changeset viewer.