opengl - load .model file in C++ -
I am working on an OpenLL project in C ++. I need to write loader in input attributes from a .model file Is it possible that FSTRM can not handle any comments or advice? Thank you.
You are probably using incorrectly fstream
if you have it in text mode If you open, you'll get conversions that will mess up your loading process. You have to open the file as binary.
std :: ifstream file ("something.model", std :: ios :: binary);
You can then read in raw data:
// read in float float; File.read (& amp; F, Size (F));
However, you need to be aware that such as int
or char
are not required to correct the bit-width if you want to make sure, So you need a fixed-width integer.
#include & lt; Boost / cstdint.hpp & gt; // ... // a 32-bit int boost: uint32_t i; File.read (& amp; i, sizeof (i));
Comments
Post a Comment