Strange behaviour. I was developing android native app with c++, and got bug. Some function was not called for some reason. after some revert and compare..
This made program trouble..
const std::string STR_PATH_ASSET("assets/");
const std::string STR_PATH_SD("/sdcard/unlock_data/assets/");
const std::string STR_SUFFIX_PNG(".png");
const std::string STR_SUFFIX_KTX(".ktx");
This makes program work..
std::string const STR_PATH_ASSET("assets/");
std::string const STR_PATH_SD("/sdcard/unlock_data/assets/");
std::string const STR_SUFFIX_PNG(".png");
std::string const STR_SUFFIX_KTX(".ktx");
It anyway works but I have no idea why this diffrerence results such strange behaviour. Any guess??
Added full source.
it was not only "std::string const" versus "const std::string" problem, but that declaration itself. sorry.
here is my source code. when i uncomment those std::string thing it does not work correctly. im drawing something onto my android but initial position of some mesh(vertices) differs when use that std::string thing. logically it must not affect wether this constants exists or not. im using ndk compiler version 4.6, ndk ver 14 on windows cygwin. will this const std::string declaration affect to another stack's memory? ie. transh value or something?
typedef enum _ImageCompressType{
//REF http://stackoverflow.com/questions/9148795/android-opengl-texture-compression
COMPRESS_UNAVAILABLE = -1,
COMPRESS_ETC1 = 1,
COMPRESS_PVRTC,
COMPRESS_ATITC,
COMPRESS_S3TC
}ImageCompressType;
typedef enum _FileDataFrom{
FROM_ASSET, FROM_SD
}FileDataFrom;
//std::string const STR_PATH_ASSET("assets/");
//std::string const STR_PATH_SD("/sdcard/unlock_data/assets/");
//std::string const STR_SUFFIX_PNG(".png");
//std::string const STR_SUFFIX_KTX(".ktx");
class ImagesLoader {
public:
ImagesLoader* mgr;
static ImagesLoader* getInstance();
static void destroyInstance();
ImageCompressType TypeImgComrpess;
// GLuint* loadTextures(FileDataFrom from, std::vector<std::string> filename);
private:
ImagesLoader() {}
~ImagesLoader() {}
static ImagesLoader* self;
};