mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 11:34:57 +01:00
Merge branch 'master' into feat/renderers-cleanup
This commit is contained in:
@@ -92,6 +92,11 @@ struct texture_source : public ITexture {
|
||||
// the object of the renderer goes, with the bank of the textures
|
||||
virtual void
|
||||
destroy() = 0;
|
||||
// the object of the renderer let go of with no copy of its data kept, the texture read from its file again when it's used
|
||||
// (texture_bank::unload())
|
||||
virtual void
|
||||
unload_object() {
|
||||
release(); }
|
||||
// another thread of the renderer works on the texture (makes its object from the data, which it reads too): what it holds isn't for
|
||||
// the other threads to read until it's done
|
||||
virtual bool
|
||||
@@ -188,6 +193,8 @@ struct opengl_texture : public texture_source {
|
||||
return id != invalid_id; }
|
||||
void
|
||||
destroy() override;
|
||||
void
|
||||
unload_object() override;
|
||||
|
||||
// members
|
||||
static constexpr GLuint invalid_id { std::numeric_limits<GLuint>::max() }; // id value of texture without GL resource
|
||||
@@ -245,6 +252,10 @@ public:
|
||||
// releases gl textures of vehicles not needed nor drawn for a while
|
||||
void
|
||||
release_unneeded();
|
||||
// takes a texture the scene has never drawn out of both the gfx card and the memory, e.g. the image of a picker scrolled
|
||||
// past, or one read and not made yet; it's read again when it's used. textures the scene draws are left to the resource sweep
|
||||
void
|
||||
unload( texture_handle const Texture );
|
||||
// debug performance string
|
||||
std::string
|
||||
info() const;
|
||||
|
||||
Reference in New Issue
Block a user