Skip to content

Instantly share code, notes, and snippets.

@jamieshepherd
Created November 6, 2015 13:55
Show Gist options
  • Save jamieshepherd/7dfbbd47396f10262e19 to your computer and use it in GitHub Desktop.
Save jamieshepherd/7dfbbd47396f10262e19 to your computer and use it in GitHub Desktop.
// Index or face
else if (streamChar == 'f') {
UINT value = 0;
m_TriangleCount = 0;
if (!fileStream) {
MessageBox(NULL, L"BROKE1", L"Critical error", MB_ICONWARNING | MB_OK);
}
// As long as we're on the same line
while (streamChar != '\n') {
if (!fileStream) {
MessageBox(NULL, L"BROKE2", L"Critical error", MB_ICONWARNING | MB_OK);
}
//fileStream.get(streamChar);
// TAKE THE FIRST CHAR, THIS IS AN INDEX
fileStream >> std::skipws >> value;
fileStream.get(streamChar);
if (!fileStream) {
MessageBox(NULL, L"BROKE3", L"Critical error", MB_ICONWARNING | MB_OK);
}
while (streamChar != ' ') {
if (!fileStream) {
MessageBox(NULL, L"BROKE4", L"Critical error", MB_ICONWARNING | MB_OK);
}
fileStream.get(streamChar);
if (!fileStream) {
MessageBox(NULL, L"BROKE5", L"Critical error", MB_ICONWARNING | MB_OK);
}
if (streamChar == '\n') {
break;
}
}
m_Indices.push_back((UINT)value - 1);
}
m_TriangleCount++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment