MCPcopy Create free account
hub / github.com/Hopson97/MineCraft-One-Week-Challenge / loadFromFile

Method loadFromFile

Source/Texture/BasicTexture.cpp:25–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
24}
25void BasicTexture::loadFromFile(const std::string &file)
26{
27 sf::Image i;
28 if (!i.loadFromFile("Res/Textures/" + file + ".png")) {
29 throw std::runtime_error("Unable to load BasicTexture: " + file);
30 }
31
32 loadFromImage(i);
33}
34
35BasicTexture::~BasicTexture()
36{

Callers 4

TextureAtlasMethod · 0.80
loadFromFilesMethod · 0.80
FPSCounterMethod · 0.80
PlayerMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected