TexturePool is empty

In official documentation to load texture you need to have code like that:

#include "texturePool.h"

PT(Texture) tex;
tex = TexturePool::load_texture("myTexture.png");

NodePath smiley;
smiley = window->load_model(window->get_render(), "smiley.egg");
smiley.set_texture(tex, 1);

But the first problem that there was no texturePool.h, but after including pandaFramework.h I finally included TexturePool, but after trying to use TexturePool i’m getting this error:

Incomplete type 'TexturePool' named in nested name specifier

To load texture we need to use static method TexturePool::load_texture, but when I write TexturePool:: even IDE says that there are errors (Incomplete type 'TexturePool' named in nested name specifier)

Any thoughts?

1 Like

Basically I just imported texturePool.h even after IDE said that there is no Header like that, but that worked, but another problem, TexturePool has only MakeTextureFunc?

Oh. When using TexturePool it has only MakeTextureFunc, but when using it as value in tex (texture variable) it shows that all methods are available…

TexturePool is just one storage for all textures to prevent loading the same texture twice. If you don’t need it, you can only use the Texture class, load methods, or read methods.

1 Like