MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / MakeNullTexture

Function MakeNullTexture

src/Core/Graphics/Sprite.cpp:13–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12 static Graphics::Texture NullTexture;
13 void MakeNullTexture()
14 {
15 sf::Image nullImage;
16 nullImage.create(100, 100, sf::Color::Transparent);
17 for (unsigned int i = 0; i < nullImage.getSize().x; i++)
18 {
19 for (unsigned int j = 0; j < nullImage.getSize().y; j++)
20 {
21 if (i == 0 || j == 0 || i == nullImage.getSize().x - 1
22 || j == nullImage.getSize().y - 1 || i == j
23 || i == ((nullImage.getSize().x - 1) - j))
24 nullImage.setPixel(i, j, sf::Color::Red);
25 }
26 }
27 NullTexture.loadFromImage(nullImage);
28 }
29
30 sf::Vertex toSfVertex(const Transform::UnitVector& uv)
31 {

Callers 1

InitEngineFunction · 0.85

Calls 3

loadFromImageMethod · 0.80
createMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected