29 #define SET_BIT(var, pos) ((var) |= (1<<(pos)))
30 #define CLEAR_BIT(var, pos) ((var) &= ~(1<<(pos)))
31 #define SET_LSB(var) ((var) |= 1)
32 #define CLEAR_LSB(var) ((var) &= ~1)
33 #define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
35 void save(Ogre::uchar* data, Ogre::uchar* databuf,
int mWidth,
int mHeight, Ogre::PixelFormat pf, Ogre::String filename)
38 img.loadDynamicImage(data, mWidth, mHeight, 1, pf,
false, 1, 0);
41 OGRE_FREE(data, Ogre::MEMCATEGORY_RENDERSYS);
42 OGRE_FREE(databuf, Ogre::MEMCATEGORY_RENDERSYS);
61 void addData(Ogre::String name, Ogre::String value)
72 int mWidth =
win->getWidth();
73 int mHeight =
win->getHeight();
76 Ogre::PixelFormat pf = Ogre::PF_B8G8R8;
77 long isize = mWidth * mHeight * (long)Ogre::PixelUtil::getNumElemBytes(pf);
78 Ogre::uchar* data = OGRE_ALLOC_T(Ogre::uchar, isize, Ogre::MEMCATEGORY_RENDERSYS);
79 Ogre::PixelBox pb(mWidth, mHeight, 1, pf, data);
80 win->copyContentsToMemory(pb);
85 Ogre::uchar* databuf = OGRE_ALLOC_T(Ogre::uchar, 32768, Ogre::MEMCATEGORY_RENDERSYS);
86 char* ptr = (
char *)databuf;
89 int w = sprintf(ptr,
"RORED\n");
94 for (std::map<Ogre::String, Ogre::String>::iterator it =
map.begin(); it !=
map.end(); it++)
96 int w2 = sprintf(ptr,
"%s:%s\n", it->first.c_str(), it->second.c_str());
102 Ogre::uchar* ptri = data;
104 ptr = (
char *)databuf;
106 for (
long b = 0; b < isize && b < dsize * 8 + 40; b++ , ptri++)
120 std::thread(
save, data, databuf, mWidth, mHeight, pf,
filename).detach();
127 std::map<Ogre::String, Ogre::String>
map;