So what to do? I don't want to use third-party libraries. I have to make it static because I have to reach the texture like this: TextureManager::GetTexture(TEXTURENAMES_FONT);
And it only occurs when I'm in release mode. If it didn't occur on debug mode, doesn't it mean that it works well? I don't get it.
Edit:
When I try to use the texture somewhere else, it did show. :O It only shows as white square in this code:
#include "InteriorPlan.hpp"
#include "../../AssetManagers/TextureManager/TextureManager.hpp"
const int backPlan[MapPlan::LENGTH] = {
0, 0, 0, ...(I cropped out these data for simplicity) 0, 0, 0
};
const int midPlan[MapPlan::LENGTH] = {
0, 0, 0, ...(I cropped out these data for simplicity) 0, 0, 0
};
const int frontPlan[MapPlan::LENGTH] = {
0, 0, 0, ...(I cropped out these data for simplicity) 0, 0, 0
};
InteriorPlan::InteriorPlan() {
}
void InteriorPlan::Initialize() {
int i = 0;
for (i = 0; i < LENGTH; i++) {
backTiles[i].SetPosition(sf::Vector2<float>((Tile::GetWidth()*(i % LENGTH)), (Tile::GetHeight()*(i / LENGTH))));
backTiles[i].SetTexture(*TextureManager::GetTexture(TextureManager::TEXTURENAMES_TILES_INTERIOR));
backTiles[i].SetTextureStartPosition(sf::Vector2f(
Tile::GetWidth() * (backPlan[i] % TextureManager::GetTexture(TextureManager::TEXTURENAMES_TILES_INTERIOR)->getSize().x),
Tile::GetHeight() * ((backPlan[i] / TextureManager::GetTexture(TextureManager::TEXTURENAMES_TILES_INTERIOR)->getSize().y))));
}
for (i = 0; i < LENGTH; i++) {
midTiles[i].SetPosition(sf::Vector2<float>((Tile::GetWidth()*(i % LENGTH)), (Tile::GetHeight()*(i / LENGTH))));
midTiles[i].SetTexture(*TextureManager::GetTexture(TextureManager::TEXTURENAMES_TILES_INTERIOR));
midTiles[i].SetTextureStartPosition(sf::Vector2f(
Tile::GetWidth() * (midPlan[i] % TextureManager::GetTexture(TextureManager::TEXTURENAMES_TILES_INTERIOR)->getSize().x),
Tile::GetHeight() * ((midPlan[i] / TextureManager::GetTexture(TextureManager::TEXTURENAMES_TILES_INTERIOR)->getSize().y))));
}
for (i = 0; i < LENGTH; i++) {
frontTiles[i].SetPosition(sf::Vector2<float>((Tile::GetWidth()*(i % LENGTH)), (Tile::GetHeight()*(i / LENGTH))));
frontTiles[i].SetTexture(*TextureManager::GetTexture(TextureManager::TEXTURENAMES_TILES_INTERIOR));
frontTiles[i].SetTextureStartPosition(sf::Vector2f(
Tile::GetWidth() * (frontPlan[i] % TextureManager::GetTexture(TextureManager::TEXTURENAMES_TILES_INTERIOR)->getSize().x),
Tile::GetHeight() * ((frontPlan[i] / TextureManager::GetTexture(TextureManager::TEXTURENAMES_TILES_INTERIOR)->getSize().y))));
}
}
void InteriorPlan::Draw() {
MapPlan::Draw();
}