| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #include "interlaced.h" | ||
| #include "client.h" | ||
| #include "shader.h" | ||
| #include "client/tile.h" | ||
|
|
||
| RenderingCoreInterlaced::RenderingCoreInterlaced( | ||
| IrrlichtDevice *_device, Client *_client, Hud *_hud) | ||
| : RenderingCoreStereo(_device, _client, _hud) | ||
| { | ||
| initMaterial(); | ||
| } | ||
|
|
||
| void RenderingCoreInterlaced::initMaterial() | ||
| { | ||
| IShaderSource *s = client->getShaderSource(); | ||
| mat.UseMipMaps = false; | ||
| mat.ZBuffer = false; | ||
| mat.ZWriteEnable = false; | ||
| u32 shader = s->getShader("3d_interlaced_merge", TILE_MATERIAL_BASIC, 0); | ||
| mat.MaterialType = s->getShaderInfo(shader).material; | ||
| for (int k = 0; k < 3; ++k) { | ||
| mat.TextureLayer[k].AnisotropicFilter = false; | ||
| mat.TextureLayer[k].BilinearFilter = false; | ||
| mat.TextureLayer[k].TrilinearFilter = false; | ||
| mat.TextureLayer[k].TextureWrapU = video::ETC_CLAMP_TO_EDGE; | ||
| mat.TextureLayer[k].TextureWrapV = video::ETC_CLAMP_TO_EDGE; | ||
| } | ||
| } | ||
|
|
||
| void RenderingCoreInterlaced::initTextures() | ||
| { | ||
| v2u32 image_size{screensize.X, screensize.Y / 2}; | ||
| left = driver->addRenderTargetTexture( | ||
| image_size, "3d_render_left", video::ECF_A8R8G8B8); | ||
| right = driver->addRenderTargetTexture( | ||
| image_size, "3d_render_right", video::ECF_A8R8G8B8); | ||
| mask = driver->addTexture(screensize, "3d_render_mask", video::ECF_A8R8G8B8); | ||
| initMask(); | ||
| mat.TextureLayer[0].Texture = left; | ||
| mat.TextureLayer[1].Texture = right; | ||
| mat.TextureLayer[2].Texture = mask; | ||
| } | ||
|
|
||
| void RenderingCoreInterlaced::clearTextures() | ||
| { | ||
| driver->removeTexture(left); | ||
| driver->removeTexture(right); | ||
| driver->removeTexture(mask); | ||
| } | ||
|
|
||
| void RenderingCoreInterlaced::initMask() | ||
| { | ||
| u8 *data = reinterpret_cast<u8 *>(mask->lock()); | ||
| for (u32 j = 0; j < screensize.Y; j++) { | ||
| u8 val = j % 2 ? 0xff : 0x00; | ||
| memset(data, val, 4 * screensize.X); | ||
| data += 4 * screensize.X; | ||
| } | ||
| mask->unlock(); | ||
| } | ||
|
|
||
| void RenderingCoreInterlaced::drawAll() | ||
| { | ||
| renderBothImages(); | ||
| merge(); | ||
| drawHUD(); | ||
| } | ||
|
|
||
| void RenderingCoreInterlaced::merge() | ||
| { | ||
| static const video::S3DVertex vertices[4] = { | ||
| video::S3DVertex(1.0, -1.0, 0.0, 0.0, 0.0, -1.0, | ||
| video::SColor(255, 0, 255, 255), 1.0, 0.0), | ||
| video::S3DVertex(-1.0, -1.0, 0.0, 0.0, 0.0, -1.0, | ||
| video::SColor(255, 255, 0, 255), 0.0, 0.0), | ||
| video::S3DVertex(-1.0, 1.0, 0.0, 0.0, 0.0, -1.0, | ||
| video::SColor(255, 255, 255, 0), 0.0, 1.0), | ||
| video::S3DVertex(1.0, 1.0, 0.0, 0.0, 0.0, -1.0, | ||
| video::SColor(255, 255, 255, 255), 1.0, 1.0), | ||
| }; | ||
| static const u16 indices[6] = {0, 1, 2, 2, 3, 0}; | ||
| driver->setMaterial(mat); | ||
| driver->drawVertexPrimitiveList(&vertices, 4, &indices, 2); | ||
| } | ||
|
|
||
| void RenderingCoreInterlaced::useEye(bool _right) | ||
| { | ||
| driver->setRenderTarget(_right ? right : left, true, true, skycolor); | ||
| RenderingCoreStereo::useEye(_right); | ||
| } | ||
|
|
||
| void RenderingCoreInterlaced::resetEye() | ||
| { | ||
| driver->setRenderTarget(nullptr, false, false, skycolor); | ||
| RenderingCoreStereo::resetEye(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include "stereo.h" | ||
|
|
||
| class RenderingCoreInterlaced : public RenderingCoreStereo | ||
| { | ||
| protected: | ||
| video::ITexture *left = nullptr; | ||
| video::ITexture *right = nullptr; | ||
| video::ITexture *mask = nullptr; | ||
| video::SMaterial mat; | ||
|
|
||
| void initMaterial(); | ||
| void initTextures() override; | ||
| void clearTextures() override; | ||
| void initMask(); | ||
| void useEye(bool right) override; | ||
| void resetEye() override; | ||
| void merge(); | ||
|
|
||
| public: | ||
| RenderingCoreInterlaced(IrrlichtDevice *_device, Client *_client, Hud *_hud); | ||
| void drawAll() override; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #include "pageflip.h" | ||
|
|
||
| void RenderingCorePageflip::initTextures() | ||
| { | ||
| hud = driver->addRenderTargetTexture( | ||
| screensize, "3d_render_hud", video::ECF_A8R8G8B8); | ||
| } | ||
|
|
||
| void RenderingCorePageflip::clearTextures() | ||
| { | ||
| driver->removeTexture(hud); | ||
| } | ||
|
|
||
| void RenderingCorePageflip::drawAll() | ||
| { | ||
| driver->setRenderTarget(hud, true, true, video::SColor(0, 0, 0, 0)); | ||
| drawHUD(); | ||
| driver->setRenderTarget(nullptr, false, false, skycolor); | ||
| renderBothImages(); | ||
| } | ||
|
|
||
| void RenderingCorePageflip::useEye(bool _right) | ||
| { | ||
| driver->setRenderTarget(_right ? video::ERT_STEREO_RIGHT_BUFFER | ||
| : video::ERT_STEREO_LEFT_BUFFER, | ||
| true, true, skycolor); | ||
| RenderingCoreStereo::useEye(_right); | ||
| } | ||
|
|
||
| void RenderingCorePageflip::resetEye() | ||
| { | ||
| driver->draw2DImage(hud, v2s32(0, 0)); | ||
| driver->setRenderTarget(video::ERT_FRAME_BUFFER, false, false, skycolor); | ||
| RenderingCoreStereo::resetEye(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include "stereo.h" | ||
|
|
||
| class RenderingCorePageflip : public RenderingCoreStereo | ||
| { | ||
| protected: | ||
| video::ITexture *hud = nullptr; | ||
|
|
||
| void initTextures() override; | ||
| void clearTextures() override; | ||
| void useEye(bool right) override; | ||
| void resetEye() override; | ||
|
|
||
| public: | ||
| using RenderingCoreStereo::RenderingCoreStereo; | ||
| void drawAll() override; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #include "plain.h" | ||
| #include "settings.h" | ||
|
|
||
| inline u32 scaledown(u32 coef, u32 size) | ||
| { | ||
| return (size + coef - 1) / coef; | ||
| } | ||
|
|
||
| RenderingCorePlain::RenderingCorePlain( | ||
| IrrlichtDevice *_device, Client *_client, Hud *_hud) | ||
| : RenderingCore(_device, _client, _hud) | ||
| { | ||
| scale = g_settings->getU16("undersampling"); | ||
| } | ||
|
|
||
| void RenderingCorePlain::initTextures() | ||
| { | ||
| if (!scale) | ||
| return; | ||
| v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)}; | ||
| lowres = driver->addRenderTargetTexture( | ||
| size, "render_lowres", video::ECF_A8R8G8B8); | ||
| } | ||
|
|
||
| void RenderingCorePlain::clearTextures() | ||
| { | ||
| if (!scale) | ||
| return; | ||
| driver->removeTexture(lowres); | ||
| } | ||
|
|
||
| void RenderingCorePlain::beforeDraw() | ||
| { | ||
| if (!scale) | ||
| return; | ||
| driver->setRenderTarget(lowres, true, true, skycolor); | ||
| } | ||
|
|
||
| void RenderingCorePlain::upscale() | ||
| { | ||
| if (!scale) | ||
| return; | ||
| driver->setRenderTarget(0, true, true); | ||
| v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)}; | ||
| v2u32 dest_size{scale * size.X, scale * size.Y}; | ||
| driver->draw2DImage(lowres, core::rect<s32>(0, 0, dest_size.X, dest_size.Y), | ||
| core::rect<s32>(0, 0, size.X, size.Y)); | ||
| } | ||
|
|
||
| void RenderingCorePlain::drawAll() | ||
| { | ||
| draw3D(); | ||
| drawPostFx(); | ||
| upscale(); | ||
| drawHUD(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include "core.h" | ||
|
|
||
| class RenderingCorePlain : public RenderingCore | ||
| { | ||
| protected: | ||
| int scale = 0; | ||
| video::ITexture *lowres = nullptr; | ||
|
|
||
| void initTextures() override; | ||
| void clearTextures() override; | ||
| void beforeDraw() override; | ||
| void upscale(); | ||
|
|
||
| public: | ||
| RenderingCorePlain(IrrlichtDevice *_device, Client *_client, Hud *_hud); | ||
| void drawAll() override; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #include "sidebyside.h" | ||
| #include <ICameraSceneNode.h> | ||
| #include "hud.h" | ||
|
|
||
| RenderingCoreSideBySide::RenderingCoreSideBySide( | ||
| IrrlichtDevice *_device, Client *_client, Hud *_hud, bool _horizontal) | ||
| : RenderingCoreStereo(_device, _client, _hud), horizontal(_horizontal) | ||
| { | ||
| } | ||
|
|
||
| void RenderingCoreSideBySide::initTextures() | ||
| { | ||
| if (horizontal) { | ||
| image_size = {screensize.X, screensize.Y / 2}; | ||
| rpos = v2s32(0, screensize.Y / 2); | ||
| } else { | ||
| image_size = {screensize.X / 2, screensize.Y}; | ||
| rpos = v2s32(screensize.X / 2, 0); | ||
| } | ||
| virtual_size = image_size; | ||
| left = driver->addRenderTargetTexture( | ||
| image_size, "3d_render_left", video::ECF_A8R8G8B8); | ||
| right = driver->addRenderTargetTexture( | ||
| image_size, "3d_render_right", video::ECF_A8R8G8B8); | ||
| } | ||
|
|
||
| void RenderingCoreSideBySide::clearTextures() | ||
| { | ||
| driver->removeTexture(left); | ||
| driver->removeTexture(right); | ||
| } | ||
|
|
||
| void RenderingCoreSideBySide::drawAll() | ||
| { | ||
| driver->OnResize(image_size); // HACK to make GUI smaller | ||
| renderBothImages(); | ||
| driver->OnResize(screensize); | ||
| driver->draw2DImage(left, {}); | ||
| driver->draw2DImage(right, rpos); | ||
| } | ||
|
|
||
| void RenderingCoreSideBySide::useEye(bool _right) | ||
| { | ||
| driver->setRenderTarget(_right ? right : left, true, true, skycolor); | ||
| RenderingCoreStereo::useEye(_right); | ||
| } | ||
|
|
||
| void RenderingCoreSideBySide::resetEye() | ||
| { | ||
| hud->resizeHotbar(); | ||
| drawHUD(); | ||
| driver->setRenderTarget(nullptr, false, false, skycolor); | ||
| RenderingCoreStereo::resetEye(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include "stereo.h" | ||
|
|
||
| class RenderingCoreSideBySide : public RenderingCoreStereo | ||
| { | ||
| protected: | ||
| video::ITexture *left = nullptr; | ||
| video::ITexture *right = nullptr; | ||
| bool horizontal = false; | ||
| core::dimension2du image_size; | ||
| v2s32 rpos; | ||
|
|
||
| void initTextures() override; | ||
| void clearTextures() override; | ||
| void useEye(bool right) override; | ||
| void resetEye() override; | ||
|
|
||
| public: | ||
| RenderingCoreSideBySide(IrrlichtDevice *_device, Client *_client, Hud *_hud, | ||
| bool _horizontal = false); | ||
| void drawAll() override; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #include "stereo.h" | ||
| #include "camera.h" | ||
| #include "constants.h" | ||
| #include "settings.h" | ||
|
|
||
| RenderingCoreStereo::RenderingCoreStereo( | ||
| IrrlichtDevice *_device, Client *_client, Hud *_hud) | ||
| : RenderingCore(_device, _client, _hud) | ||
| { | ||
| eye_offset = BS * g_settings->getFloat("3d_paralax_strength"); | ||
| } | ||
|
|
||
| void RenderingCoreStereo::beforeDraw() | ||
| { | ||
| cam = camera->getCameraNode(); | ||
| base_transform = cam->getRelativeTransformation(); | ||
| } | ||
|
|
||
| void RenderingCoreStereo::useEye(bool right) | ||
| { | ||
| core::matrix4 move; | ||
| move.setTranslation( | ||
| core::vector3df(right ? eye_offset : -eye_offset, 0.0f, 0.0f)); | ||
| cam->setPosition((base_transform * move).getTranslation()); | ||
| } | ||
|
|
||
| void RenderingCoreStereo::resetEye() | ||
| { | ||
| cam->setPosition(base_transform.getTranslation()); | ||
| } | ||
|
|
||
| void RenderingCoreStereo::renderBothImages() | ||
| { | ||
| useEye(false); | ||
| draw3D(); | ||
| resetEye(); | ||
| useEye(true); | ||
| draw3D(); | ||
| resetEye(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| Minetest | ||
| Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
| Copyright (C) 2017 numzero, Lobachesky Vitaly <numzer0@yandex.ru> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU Lesser General Public License as published by | ||
| the Free Software Foundation; either version 2.1 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include "core.h" | ||
|
|
||
| class RenderingCoreStereo : public RenderingCore | ||
| { | ||
| protected: | ||
| scene::ICameraSceneNode *cam; | ||
| core::matrix4 base_transform; | ||
| float eye_offset; | ||
|
|
||
| void beforeDraw() override; | ||
| virtual void useEye(bool right); | ||
| virtual void resetEye(); | ||
| void renderBothImages(); | ||
|
|
||
| public: | ||
| RenderingCoreStereo(IrrlichtDevice *_device, Client *_client, Hud *_hud); | ||
| }; |