示例#1
0
	void dump(const VertexDecl& _decl)
	{
		if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
		{
			dbgPrintf("vertexdecl %08x (%08x), stride %d\n"
				, _decl.m_hash
				, bx::hashMurmur2A(_decl.m_attributes)
				, _decl.m_stride
				);

			for (uint32_t attr = 0; attr < Attrib::Count; ++attr)
			{
				if (UINT16_MAX != _decl.m_attributes[attr])
				{
					uint8_t num;
					AttribType::Enum type;
					bool normalized;
					bool asInt;
					_decl.decode(Attrib::Enum(attr), num, type, normalized, asInt);

					dbgPrintf("\tattr %d - %s, num %d, type %d, norm %d, asint %d, offset %d\n"
						, attr
						, getAttribName(Attrib::Enum(attr) )
						, num
						, type
						, normalized
						, asInt
						, _decl.m_offset[attr]
					);
				}
			}
		}
	}
示例#2
0
void testApp::load() {
	FileStorage fs;
	if (NUM_CAMERAS==2)
		fs = FileStorage(ofToDataPath("transforms.xml"), FileStorage::READ);
	
	FOREACH_CAMERA {
		if (NUM_CAMERAS==2)
			for (int i=0; i<4; ++i)
				for (int j=0; j<4; ++j)
					fs[getAttribName(iCam,i,j)] >> matPosRotFromXtoOther[i](i, j);
		camera[iCam].load(iCam);
	}
}
示例#3
0
void testApp::save() {
	FileStorage fs;
	if (NUM_CAMERAS==2)
		fs = FileStorage(ofToDataPath("transforms.xml"), FileStorage::WRITE);
	
	FOREACH_CAMERA {
		if (NUM_CAMERAS==2)
			for (int i=0; i<4; ++i)
				for (int j=0; j<4; ++j)
					fs << getAttribName(iCam,i,j) << matPosRotFromXtoOther[iCam](i, j);
		camera[iCam].save(iCam);
	}
}