Commit 8de5f833 authored by Robert Menzel's avatar Robert Menzel

compatibility with VStudio 2012

parent 5e5b9bf5
...@@ -65,7 +65,7 @@ private: ...@@ -65,7 +65,7 @@ private:
ACGL_SMARTPOINTER_TYPEDEFS(OculusRiftCamera) ACGL_SMARTPOINTER_TYPEDEFS(OculusRiftCamera)
} }
} }
#else #elif ACGL_RIFT_SDK_VERSION >= 40
// SDK 0.4 or later: // SDK 0.4 or later:
#include <ACGL/ACGL.hh> #include <ACGL/ACGL.hh>
......
...@@ -40,9 +40,9 @@ namespace ACGL{ ...@@ -40,9 +40,9 @@ namespace ACGL{
private: private:
#ifdef _WIN32 #ifdef _WIN32
MemoryMappedFileWinImpl* mpMMFileImpl = nullptr; MemoryMappedFileWinImpl* mpMMFileImpl;
#else #else
MemoryMappedFilePosixImpl* mpMMFileImpl = nullptr; MemoryMappedFilePosixImpl* mpMMFileImpl;
#endif #endif
public: public:
......
...@@ -316,30 +316,30 @@ glm::vec4 convertTexelNumChannels(glm::vec4 _texel, GLsizei _from, GLsizei _to) ...@@ -316,30 +316,30 @@ glm::vec4 convertTexelNumChannels(glm::vec4 _texel, GLsizei _from, GLsizei _to)
} }
else if (_from == 1) { else if (_from == 1) {
switch (_to) { switch (_to) {
case 2: return {_texel.r, 1.0, 0.0, 0.0}; case 2: return glm::vec4( _texel.r, 1.0, 0.0, 0.0 );
case 3: return {_texel.r, _texel.r, _texel.r, 0.0}; case 3: return glm::vec4( _texel.r, _texel.r, _texel.r, 0.0 );
case 4: return {_texel.r, _texel.r, _texel.r, 1.0}; case 4: return glm::vec4( _texel.r, _texel.r, _texel.r, 1.0 );
} }
} }
else if (_from == 2) { else if (_from == 2) {
switch (_to) { switch (_to) {
case 1: return {_texel.r, 0.0, 0.0, 0.0}; case 1: return glm::vec4( _texel.r, 0.0, 0.0, 0.0 );
case 3: return {_texel.r, _texel.r, _texel.r, _texel.g}; case 3: return glm::vec4( _texel.r, _texel.r, _texel.r, _texel.g );
case 4: return {_texel.r, _texel.r, _texel.r, _texel.g}; case 4: return glm::vec4( _texel.r, _texel.r, _texel.r, _texel.g );
} }
} }
else if (_from == 3) { else if (_from == 3) {
switch (_to) { switch (_to) {
case 1: return {grayscaleMixdown(_texel.r, _texel.g, _texel.b), 0.0, 0.0, 0.0}; case 1: return glm::vec4( grayscaleMixdown(_texel.r, _texel.g, _texel.b), 0.0, 0.0, 0.0 );
case 2: return {grayscaleMixdown(_texel.r, _texel.g, _texel.b), 1.0, 0.0, 0.0}; case 2: return glm::vec4( grayscaleMixdown(_texel.r, _texel.g, _texel.b), 1.0, 0.0, 0.0 );
case 4: return {_texel.r, _texel.r, _texel.r, 1.0}; case 4: return glm::vec4( _texel.r, _texel.r, _texel.r, 1.0 );
} }
} }
else if (_from == 4) { else if (_from == 4) {
switch (_to) { switch (_to) {
case 1: return {grayscaleMixdown(_texel.r, _texel.g, _texel.b), 0.0, 0.0, 0.0}; case 1: return glm::vec4( grayscaleMixdown(_texel.r, _texel.g, _texel.b), 0.0, 0.0, 0.0 );
case 2: return {grayscaleMixdown(_texel.r, _texel.g, _texel.b), 1.0, 0.0, 0.0}; case 2: return glm::vec4( grayscaleMixdown(_texel.r, _texel.g, _texel.b), 1.0, 0.0, 0.0 );
case 3: return {_texel.r, _texel.r, _texel.r, 0.0}; case 3: return glm::vec4( _texel.r, _texel.r, _texel.r, 0.0 );
} }
} }
return _texel; return _texel;
...@@ -367,8 +367,8 @@ void convertTextureData(const SharedTextureData& _from, const SharedTextureData& ...@@ -367,8 +367,8 @@ void convertTextureData(const SharedTextureData& _from, const SharedTextureData&
// Transfer pixels // Transfer pixels
for (GLsizei y = 0; y < _to->getHeight(); ++y) { for (GLsizei y = 0; y < _to->getHeight(); ++y) {
for (GLsizei x = 0; x < _to->getWidth(); ++x) { for (GLsizei x = 0; x < _to->getWidth(); ++x) {
auto texel = convertTexelNumChannels(_from->getTexel({x, y}), _from->getNumberOfChannels(), _to->getNumberOfChannels()); auto texel = convertTexelNumChannels(_from->getTexel(glm::uvec2(x, y)), _from->getNumberOfChannels(), _to->getNumberOfChannels());
_to->setTexel({x, y}, texel); _to->setTexel(glm::uvec2(x, y), texel);
} }
} }
} }
......
...@@ -142,7 +142,7 @@ glm::uvec2 OculusRiftCamera::getViewportSize() const ...@@ -142,7 +142,7 @@ glm::uvec2 OculusRiftCamera::getViewportSize() const
} }
} }
#else #elif ACGL_RIFT_SDK_VERSION >= 40
// 0.4 version: // 0.4 version:
namespace ACGL{ namespace ACGL{
......
...@@ -25,7 +25,7 @@ ACGL::Utils::MemoryMappedFile::MemoryMappedFile( ...@@ -25,7 +25,7 @@ ACGL::Utils::MemoryMappedFile::MemoryMappedFile(
accessMode _accessMode, accessMode _accessMode,
shareMode _shareMode, shareMode _shareMode,
size_t _length, size_t _length,
off_t _offset) off_t _offset) : mpMMFileImpl(NULL)
{ {
#ifdef _WIN32 #ifdef _WIN32
mpMMFileImpl = new MemoryMappedFileWinImpl(_fileName, _accessMode, _shareMode, _length, _offset); mpMMFileImpl = new MemoryMappedFileWinImpl(_fileName, _accessMode, _shareMode, _length, _offset);
......
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