mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 19:29:04 -05:00
Code cleanup branch (#618)
* Make height map fallback layer work again * Add documentation to joystick button bindings * Removed grouped property headers * Add new version number constant generated by CMake * Make Joystick deadzone work properly * Change the startup date on Earth to today * Fix key modifier handling * Add debugging indices for TreeNodeDebugging * Fix script schedule for OsirisRex * Do not open Mission schedule automatically * Upload default projection texture automatically * General code cleanup * Fix check_style_guide warnings * Remove .clang-format * MacOS compile fixes * Clang analyzer fixes
This commit is contained in:
+8
-9
@@ -23,13 +23,11 @@
|
||||
****************************************************************************************/
|
||||
|
||||
#include <modules/globebrowsing/cache/texturecontainer.h>
|
||||
#include <modules/globebrowsing/tile/tiletextureinitdata.h>
|
||||
|
||||
namespace openspace::globebrowsing::cache {
|
||||
|
||||
TextureContainer::TextureContainer(TileTextureInitData initData, size_t numTextures)
|
||||
: _initData(initData)
|
||||
, _freeTexture(0)
|
||||
: _initData(std::move(initData))
|
||||
, _numTextures(numTextures)
|
||||
{
|
||||
reset();
|
||||
@@ -39,19 +37,20 @@ void TextureContainer::reset() {
|
||||
_textures.clear();
|
||||
_freeTexture = 0;
|
||||
for (size_t i = 0; i < _numTextures; ++i) {
|
||||
auto tex = std::make_unique<ghoul::opengl::Texture>(
|
||||
using namespace ghoul::opengl;
|
||||
std::unique_ptr<Texture> tex = std::make_unique<Texture>(
|
||||
_initData.dimensions(),
|
||||
_initData.ghoulTextureFormat(),
|
||||
_initData.glTextureFormat(),
|
||||
_initData.glType(),
|
||||
ghoul::opengl::Texture::FilterMode::Linear,
|
||||
ghoul::opengl::Texture::WrappingMode::ClampToEdge,
|
||||
ghoul::opengl::Texture::AllocateData(_initData.shouldAllocateDataOnCPU())
|
||||
Texture::FilterMode::Linear,
|
||||
Texture::WrappingMode::ClampToEdge,
|
||||
Texture::AllocateData(_initData.shouldAllocateDataOnCPU())
|
||||
);
|
||||
|
||||
tex->setDataOwnership(ghoul::opengl::Texture::TakeOwnership::Yes);
|
||||
tex->setDataOwnership(Texture::TakeOwnership::Yes);
|
||||
tex->uploadTexture();
|
||||
tex->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap);
|
||||
tex->setFilter(Texture::FilterMode::AnisotropicMipMap);
|
||||
|
||||
_textures.push_back(std::move(tex));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user