Commit d78eeb58 authored by Robert Menzel's avatar Robert Menzel

Merge branch 'master' of...

Merge branch 'master' of ssh://beatrix.informatik.rwth-aachen.de/data/git-repository/acgl/libraries/acgl
parents c91856ec 8a2e4314
...@@ -14,10 +14,11 @@ ...@@ -14,10 +14,11 @@
#include <ACGL/ACGL.hh> #include <ACGL/ACGL.hh>
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <OVR_CAPI.h>
#if ACGL_RIFT_SDK_VERSION >= 32 #if ACGL_RIFT_SDK_VERSION >= 32
#include <OVR_CAPI.h>
namespace ACGL{ namespace ACGL{
namespace HardwareSupport{ namespace HardwareSupport{
......
...@@ -50,6 +50,9 @@ public: ...@@ -50,6 +50,9 @@ public:
//! links to an external LocationMappings object //! links to an external LocationMappings object
inline VertexArrayObjectCreator& externAttributeLocations(const SharedLocationMappings& _attributeLocations) { mAttributeLocations = _attributeLocations; return *this; } inline VertexArrayObjectCreator& externAttributeLocations(const SharedLocationMappings& _attributeLocations) { mAttributeLocations = _attributeLocations; return *this; }
//! sets the caching mode for this creator
inline VertexArrayObjectCreator& cached(bool _cacheMode) { mCaching = _cacheMode; return *this; }
private: private:
bool load(SharedVertexArrayObject& vao); bool load(SharedVertexArrayObject& vao);
...@@ -65,6 +68,7 @@ public: ...@@ -65,6 +68,7 @@ public:
// =================================================================================================== \/ // =================================================================================================== \/
protected: protected:
SharedLocationMappings mAttributeLocations; SharedLocationMappings mAttributeLocations;
bool mCaching;
}; };
} // OpenGL } // OpenGL
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* users body to the requested eye. * users body to the requested eye.
* *
*/ */
#ifdef ACGL_USE_OCULUS_RIFT #if ACGL_RIFT_SDK_VERSION >= 32
#include <ACGL/ACGL.hh> #include <ACGL/ACGL.hh>
#include <ACGL/Scene/GenericCamera.hh> #include <ACGL/Scene/GenericCamera.hh>
...@@ -66,4 +66,4 @@ ACGL_SMARTPOINTER_TYPEDEFS(OculusRiftCamera) ...@@ -66,4 +66,4 @@ ACGL_SMARTPOINTER_TYPEDEFS(OculusRiftCamera)
} }
} }
#endif // ACGL_USE_OCULUS_RIFT #endif // ACGL_RIFT_SDK_VERSION
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
**********************************************************************/ **********************************************************************/
#include <ACGL/OpenGL/Creator/VertexArrayObjectCreator.hh> #include <ACGL/OpenGL/Creator/VertexArrayObjectCreator.hh>
#include <ACGL/OpenGL/Data/GeometryDataLoadStore.hh> #include <ACGL/OpenGL/Data/VertexArrayObjectLoadStore.hh>
#ifdef ACGL_SUPPORT_VAO #ifdef ACGL_SUPPORT_VAO
...@@ -13,41 +13,21 @@ using namespace ACGL; ...@@ -13,41 +13,21 @@ using namespace ACGL;
using namespace ACGL::OpenGL; using namespace ACGL::OpenGL;
VertexArrayObjectCreator::VertexArrayObjectCreator(const std::string &_filename) VertexArrayObjectCreator::VertexArrayObjectCreator(const std::string &_filename)
: Resource::SingleFileBasedCreator<VertexArrayObject>(_filename, Base::Settings::the()->getFullGeometryPath()) : Resource::SingleFileBasedCreator<VertexArrayObject>(_filename, Base::Settings::the()->getFullGeometryPath()),
mCaching(false)
{ {
} }
VertexArrayObjectCreator::VertexArrayObjectCreator(const char *_filename) VertexArrayObjectCreator::VertexArrayObjectCreator(const char *_filename)
: Resource::SingleFileBasedCreator<VertexArrayObject>(std::string(_filename), Base::Settings::the()->getFullGeometryPath()) : Resource::SingleFileBasedCreator<VertexArrayObject>(std::string(_filename), Base::Settings::the()->getFullGeometryPath()),
mCaching(false)
{ {
} }
bool VertexArrayObjectCreator::load(SharedVertexArrayObject &_vao) bool VertexArrayObjectCreator::load(SharedVertexArrayObject &_vao)
{ {
SharedGeometryData tempData = loadGeometryData( getFullFilePath() ); _vao = loadVertexArrayObject(getFullFilePath(), mCaching);
return _vao != nullptr;
if(!tempData)
return false;
SharedArrayBuffer sab = SharedArrayBuffer( new ArrayBuffer() );
for ( uint_t i = 0; i < tempData->mAttributes.size(); ++i ) {
sab->defineAttribute( tempData->mAttributes[i] );
}
sab->setDataElements( tempData->getSize()/tempData->getStrideSize(), tempData->getData() );
_vao->detachAllAttributes();
_vao->attachAllAttributes(sab);
// merge the mappings of the new VAO into the linked LocationMappings object, if present
if(mAttributeLocations)
{
_vao->setAttributeLocations(mAttributeLocations);
SharedLocationMappings vaoAttributeLocations = _vao->getAttributeLocations();
mAttributeLocations->addLocations(vaoAttributeLocations);
_vao->setAttributeLocations(mAttributeLocations);
}
return true;
} }
SharedVertexArrayObject VertexArrayObjectCreator::create() SharedVertexArrayObject VertexArrayObjectCreator::create()
......
...@@ -385,7 +385,7 @@ enum loadTextureDataFromPNM_InputDataFormat ...@@ -385,7 +385,7 @@ enum loadTextureDataFromPNM_InputDataFormat
BINARY_WORDS // used by P5 and P6 BINARY_WORDS // used by P5 and P6
}; };
void loadTextureDataFromPNM_skipWhitespace(std::istream& _in, uint_t _max = std::numeric_limits<std::streamsize>::max()) void loadTextureDataFromPNM_skipWhitespace(std::istream& _in, uint_t _max = std::numeric_limits<uint_t>::max())
{ {
uint_t skipped = 0; uint_t skipped = 0;
while(isspace(_in.peek()) && skipped < _max) while(isspace(_in.peek()) && skipped < _max)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Distributed under the terms of the MIT License (see LICENSE.TXT). * * Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/ **********************************************************************/
#ifdef ACGL_USE_OCULUS_RIFT #if ACGL_RIFT_SDK_VERSION >= 32
#include <ACGL/Scene/OculusRiftCamera.hh> #include <ACGL/Scene/OculusRiftCamera.hh>
...@@ -141,4 +141,4 @@ glm::uvec2 OculusRiftCamera::getViewportSize() const ...@@ -141,4 +141,4 @@ glm::uvec2 OculusRiftCamera::getViewportSize() const
} }
} }
#endif // ACGL_USE_OCULUS_RIFT #endif // ACGL_RIFT_SDK_VERSION >= 32
...@@ -63,7 +63,7 @@ MemoryMappedFileWinImpl::MemoryMappedFileWinImpl( ...@@ -63,7 +63,7 @@ MemoryMappedFileWinImpl::MemoryMappedFileWinImpl(
// open the file // open the file
// //
////////////////////// //////////////////////
mFileHandle = CreateFile(_fileName, fileAccess, fileShare, mFileHandle = CreateFileA(_fileName, fileAccess, fileShare,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (mFileHandle == INVALID_HANDLE_VALUE) if (mFileHandle == INVALID_HANDLE_VALUE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment