CPVRChannel channel; channel.Open("texture.pvr", CPVRChannel::eModeRead); unsigned char* imageData = new unsigned char[channel.ReadInt()]; channel.Read(imageData, channel.ReadInt()); int width = channel.ReadInt(); int height = channel.ReadInt(); int format = channel.ReadInt();
CPVRChannel channel; channel.Open("mesh.pvr", CPVRChannel::eModeWrite); vectorIn this example, we create a CPVRChannel object and open a file called "mesh.pvr" in write-mode. We then retrieve the vertices and indices of a mesh and write them to the channel. We first write the number of vertices and indices, then write the actual vertex and index data to the channel. Package/Library: PVRToolsvertices = GetMeshVertices(); vector indices = GetMeshIndices(); channel.Write((int) vertices.size()); channel.Write(vertices.data(), vertices.size() * sizeof(Vertex)); channel.Write((int) indices.size()); channel.Write(indices.data(), indices.size() * sizeof(int));