mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 11:29:55 -05:00
Apply changes to texture reading
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include <openspace/rendering/model/modelgeometry.h>
|
||||
|
||||
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
|
||||
@@ -173,7 +173,7 @@ void RenderableModel::loadTexture()
|
||||
delete _texture;
|
||||
_texture = nullptr;
|
||||
if (_colorTexturePath.value() != "") {
|
||||
_texture = ghoul::opengl::loadTexture(absPath(_colorTexturePath));
|
||||
_texture = ghoul::io::TextureReader::loadTexture(absPath(_colorTexturePath));
|
||||
if (_texture) {
|
||||
LDEBUG("Loaded texture from '" << absPath(_colorTexturePath) << "'");
|
||||
_texture->uploadTexture();
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <openspace/util/constants.h>
|
||||
#include <openspace/rendering/planets/planetgeometry.h>
|
||||
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
|
||||
@@ -163,7 +163,7 @@ void RenderablePlanet::loadTexture()
|
||||
delete _texture;
|
||||
_texture = nullptr;
|
||||
if (_colorTexturePath.value() != "") {
|
||||
_texture = ghoul::opengl::loadTexture(absPath(_colorTexturePath));
|
||||
_texture = ghoul::io::TextureReader::loadTexture(absPath(_colorTexturePath));
|
||||
if (_texture) {
|
||||
LDEBUG("Loaded texture from '" << absPath(_colorTexturePath) << "'");
|
||||
_texture->uploadTexture();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/util/constants.h>
|
||||
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
|
||||
@@ -308,7 +308,7 @@ void RenderableEphemeris::loadTexture()
|
||||
delete _texture;
|
||||
_texture = nullptr;
|
||||
if (_colorTexturePath.value() != "") {
|
||||
_texture = ghoul::opengl::loadTexture(absPath(_colorTexturePath));
|
||||
_texture = ghoul::io::TextureReader::loadTexture(absPath(_colorTexturePath));
|
||||
if (_texture) {
|
||||
LDEBUG("Loaded texture from '" << absPath(_colorTexturePath) << "'");
|
||||
_texture->uploadTexture();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/util/constants.h>
|
||||
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
|
||||
@@ -238,7 +238,7 @@ void RenderableFov::loadTexture()
|
||||
delete _texture;
|
||||
_texture = nullptr;
|
||||
if (_colorTexturePath.value() != "") {
|
||||
_texture = ghoul::opengl::loadTexture(absPath(_colorTexturePath));
|
||||
_texture = ghoul::io::TextureReader::loadTexture(absPath(_colorTexturePath));
|
||||
if (_texture) {
|
||||
LDEBUG("Loaded texture from '" << absPath(_colorTexturePath) << "'");
|
||||
_texture->uploadTexture();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/util/constants.h>
|
||||
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
|
||||
@@ -233,7 +233,7 @@ void RenderablePath::loadTexture()
|
||||
delete _texture;
|
||||
_texture = nullptr;
|
||||
if (_colorTexturePath.value() != "") {
|
||||
_texture = ghoul::opengl::loadTexture(absPath(_colorTexturePath));
|
||||
_texture = ghoul::io::TextureReader::loadTexture(absPath(_colorTexturePath));
|
||||
if (_texture) {
|
||||
LDEBUG("Loaded texture from '" << absPath(_colorTexturePath) << "'");
|
||||
_texture->uploadTexture();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <openspace/util/constants.h>
|
||||
|
||||
#include <ghoul/filesystem/filesystem>
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
|
||||
namespace {
|
||||
@@ -183,7 +183,7 @@ void RenderablePlane::loadTexture()
|
||||
LDEBUG("loadTexture");
|
||||
if (_texturePath.value() != "") {
|
||||
LDEBUG("loadTexture2");
|
||||
ghoul::opengl::Texture* texture = ghoul::opengl::loadTexture(absPath(_texturePath));
|
||||
ghoul::opengl::Texture* texture = ghoul::io::TextureReader::loadTexture(absPath(_texturePath));
|
||||
if (texture) {
|
||||
LDEBUG("Loaded texture from '" << absPath(_texturePath) << "'");
|
||||
texture->uploadTexture();
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/util/constants.h>
|
||||
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
|
||||
@@ -310,7 +310,7 @@ void RenderableTrail::loadTexture()
|
||||
delete _texture;
|
||||
_texture = nullptr;
|
||||
if (_colorTexturePath.value() != "") {
|
||||
_texture = ghoul::opengl::loadTexture(absPath(_colorTexturePath));
|
||||
_texture = ghoul::io::TextureReader::loadTexture(absPath(_colorTexturePath));
|
||||
if (_texture) {
|
||||
LDEBUG("Loaded texture from '" << absPath(_colorTexturePath) << "'");
|
||||
_texture->uploadTexture();
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <openspace/util/progressbar.h>
|
||||
|
||||
// ghoul includes
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/filesystem/cachemanager.h>
|
||||
|
||||
@@ -294,7 +294,7 @@ ghoul::opengl::Texture* RenderableVolume::loadTransferFunction(const std::string
|
||||
|
||||
// check if not a txt based texture
|
||||
if ( ! hasExtension(filepath, "txt")) {
|
||||
ghoul::opengl::Texture* t = ghoul::opengl::loadTexture(f);
|
||||
ghoul::opengl::Texture* t = ghoul::io::TextureReader::loadTexture(f);
|
||||
t->setWrapping(wrappingmode);
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <ghoul/filesystem/file.h>
|
||||
#include <ghoul/opengl/framebufferobject.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
|
||||
// std
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
|
||||
// Open Space
|
||||
#include <openspace/abuffer/abuffervisualizer.h>
|
||||
#include <openspace/abuffer/abuffer.h>
|
||||
#include <openspace/abuffer/abufferframebuffer.h>
|
||||
@@ -40,16 +39,16 @@
|
||||
#include <openspace/util/spicemanager.h>
|
||||
#include <openspace/util/syncbuffer.h>
|
||||
|
||||
// sgct
|
||||
#include <sgct.h>
|
||||
|
||||
// ghoul
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/lua/lua_helper.h>
|
||||
|
||||
// std
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereaderdevil.h>
|
||||
#include <ghoul/io/texture/texturereaderfreeimage.h>
|
||||
|
||||
#include <array>
|
||||
#include <fstream>
|
||||
#include <sgct.h>
|
||||
|
||||
// ABuffer defines
|
||||
#define ABUFFER_FRAMEBUFFER 0
|
||||
@@ -132,6 +131,12 @@ bool RenderEngine::initialize()
|
||||
_mainCamera->setScaling(glm::vec2(1.0, -8.0));
|
||||
_mainCamera->setPosition(psc(0.f, 0.f, 1.499823f, 11.f));
|
||||
OsEng.interactionHandler().setCamera(_mainCamera);
|
||||
|
||||
#ifdef GHOUL_USE_DEVIL
|
||||
ghoul::io::TextureReader::addReader(new ghoul::io::impl::TextureReaderDevIL);
|
||||
#else
|
||||
ghoul::io::TextureReader::addReader(new ghoul::io::impl::TextureReaderFreeImage);
|
||||
#endif
|
||||
|
||||
#if ABUFFER_IMPLEMENTATION == ABUFFER_FRAMEBUFFER
|
||||
_abuffer = new ABufferFramebuffer();
|
||||
|
||||
@@ -144,7 +144,7 @@ bool RenderableConstellationBounds::isReady() const {
|
||||
void RenderableConstellationBounds::render(const RenderData& data) {
|
||||
_program->activate();
|
||||
|
||||
glm::mat4 modelMatrix = data.camera.modelMatrix();
|
||||
//glm::mat4 modelMatrix = data.camera.modelMatrix();
|
||||
glm::mat4 viewMatrix = data.camera.viewMatrix();
|
||||
glm::mat4 projectionMatrix = data.camera.projectionMatrix();
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
*****************************************************************************************/
|
||||
|
||||
#include <openspace/rendering/stars/renderablestars.h>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <ghoul/filesystem/filesystem>
|
||||
#include <ghoul/misc/templatefactory.h>
|
||||
#include <ghoul/opengl/texturereader.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
|
||||
#include <array>
|
||||
@@ -273,7 +273,7 @@ void RenderableStars::update(const UpdateData& data) {
|
||||
delete _texture;
|
||||
_texture = nullptr;
|
||||
if (_colorTexturePath.value() != "") {
|
||||
_texture = ghoul::opengl::loadTexture(absPath(_colorTexturePath));
|
||||
_texture = ghoul::io::TextureReader::loadTexture(absPath(_colorTexturePath));
|
||||
if (_texture) {
|
||||
LDEBUG("Loaded texture from '" << absPath(_colorTexturePath) << "'");
|
||||
_texture->uploadTexture();
|
||||
|
||||
Reference in New Issue
Block a user