Skip to content

Commit

Permalink
Disable HW stereo for IrrLicht 1.9 (not supported anymore)
Browse files Browse the repository at this point in the history
  • Loading branch information
numberZero authored and sfan5 committed Nov 11, 2018
1 parent d90e3ea commit 4f9c33d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/client/render/factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ RenderingCore *createRenderingCore(const std::string &stereo_mode, IrrlichtDevic
return new RenderingCoreAnaglyph(device, client, hud);
if (stereo_mode == "interlaced")
return new RenderingCoreInterlaced(device, client, hud);
#ifdef STEREO_PAGEFLIP_SUPPORTED
if (stereo_mode == "pageflip")
return new RenderingCorePageflip(device, client, hud);
#endif
if (stereo_mode == "sidebyside")
return new RenderingCoreSideBySide(device, client, hud);
if (stereo_mode == "topbottom")
Expand Down
4 changes: 4 additions & 0 deletions src/client/render/pageflip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,

#include "pageflip.h"

#ifdef STEREO_PAGEFLIP_SUPPORTED

void RenderingCorePageflip::initTextures()
{
hud = driver->addRenderTargetTexture(
Expand Down Expand Up @@ -53,3 +55,5 @@ void RenderingCorePageflip::resetEye()
driver->setRenderTarget(video::ERT_FRAME_BUFFER, false, false, skycolor);
RenderingCoreStereo::resetEye();
}

#endif // STEREO_PAGEFLIP_SUPPORTED
6 changes: 6 additions & 0 deletions src/client/render/pageflip.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
#include "stereo.h"

// The support is absent in 1.9.0 (dropped in r5068)
#if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR <= 8)
#define STEREO_PAGEFLIP_SUPPORTED

class RenderingCorePageflip : public RenderingCoreStereo
{
protected:
Expand All @@ -35,3 +39,5 @@ class RenderingCorePageflip : public RenderingCoreStereo
using RenderingCoreStereo::RenderingCoreStereo;
void drawAll() override;
};

#endif

0 comments on commit 4f9c33d

Please sign in to comment.