From aef82d5c9ebbc35a08c5397e8a7d0b83199914d0 Mon Sep 17 00:00:00 2001 From: Michael Nilsson Date: Tue, 8 Mar 2016 15:11:59 -0500 Subject: [PATCH] create screenspacerenderable --- include/openspace/rendering/renderengine.h | 2 + .../rendering/screenspacerenderable.h | 44 +++++++++++++++++++ modules/base/rendering/screenspaceimage.cpp | 24 ++++++++++ modules/base/rendering/screenspaceimage.h | 30 +++++++++++++ src/rendering/screenspacerenderable.cpp | 26 +++++++++++ 5 files changed, 126 insertions(+) create mode 100644 include/openspace/rendering/screenspacerenderable.h create mode 100644 modules/base/rendering/screenspaceimage.cpp create mode 100644 modules/base/rendering/screenspaceimage.h create mode 100644 src/rendering/screenspacerenderable.cpp diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index 91aee642a1..bd95a89831 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -29,6 +29,7 @@ #include #include +#include namespace ghoul { namespace fontrendering { @@ -166,6 +167,7 @@ private: int _fadeDirection; std::vector _programs; + std::vector> _screenSpaceRenderables; std::shared_ptr _fontInfo = nullptr; std::shared_ptr _fontDate = nullptr; diff --git a/include/openspace/rendering/screenspacerenderable.h b/include/openspace/rendering/screenspacerenderable.h new file mode 100644 index 0000000000..5201f07a6f --- /dev/null +++ b/include/openspace/rendering/screenspacerenderable.h @@ -0,0 +1,44 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * 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. * + ****************************************************************************************/ + +#ifndef __SCREENSPACERENDERABLE_H__ +#define __SCREENSPACERENDERABLE_H__ + +#include +#include +#include + +namespace openspace { + +class ScreenSpaceRenderable : public properties::PropertyOwner { +public: + virtual void render() = 0; + +protected: + properties::BoolProperty _enabled; + properties::Vec3Property _position; + properties::Vec2Property _size; +}; +} // namespace openspace +#endif // __SCREENSPACERENDERABLE_H__ \ No newline at end of file diff --git a/modules/base/rendering/screenspaceimage.cpp b/modules/base/rendering/screenspaceimage.cpp new file mode 100644 index 0000000000..56192889cd --- /dev/null +++ b/modules/base/rendering/screenspaceimage.cpp @@ -0,0 +1,24 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * 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. * + ****************************************************************************************/ + \ No newline at end of file diff --git a/modules/base/rendering/screenspaceimage.h b/modules/base/rendering/screenspaceimage.h new file mode 100644 index 0000000000..384d9bc38c --- /dev/null +++ b/modules/base/rendering/screenspaceimage.h @@ -0,0 +1,30 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * 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 + #include + +class ScreenSpaceImage : public ScreenSpaceRenderable { +private: + std::unique_ptr _imageHandle; // The image to render +}; \ No newline at end of file diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp new file mode 100644 index 0000000000..f2dfe7f7f6 --- /dev/null +++ b/src/rendering/screenspacerenderable.cpp @@ -0,0 +1,26 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * 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. * + ****************************************************************************************/ + +namespace openspace { +} \ No newline at end of file