MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / Allocate

Method Allocate

src/Texture.cpp:21–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 m_cleanup();
20 }
21 bool Texture::Allocate(int w, int h, int d)
22 {
23 m_cleanup();
24
25 if (d <= 0 || w <= 0 || h <= 0)
26 return false;
27
28 Width = w;
29 Height = h;
30 Depth = d;
31 MipmapLevels = 1;
32
33 Data = (float**)malloc(sizeof(float*) * MipmapLevels);
34
35 // TODO: mipmaps
36 Data[0] = (float*)malloc(sizeof(float) * w * h * d * 4);
37
38 return true;
39 }
40 void Texture::Fill(glm::vec4 val)
41 {
42 // TODO: mipmaps

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected