From 4bd1be3763eadd6fdbdd4c67d8cccfac5e462dbe Mon Sep 17 00:00:00 2001 From: Sigurd Pettersen Date: Fri, 12 Jan 2024 09:50:46 +0100 Subject: [PATCH] Added class for OpenGLInfo --- Fwk/VizFwk/LibRender/CMakeLists.txt | 2 + Fwk/VizFwk/LibRender/cvfOpenGLInfo.cpp | 101 +++++++++++++++++++++++++ Fwk/VizFwk/LibRender/cvfOpenGLInfo.h | 68 +++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 Fwk/VizFwk/LibRender/cvfOpenGLInfo.cpp create mode 100644 Fwk/VizFwk/LibRender/cvfOpenGLInfo.h diff --git a/Fwk/VizFwk/LibRender/CMakeLists.txt b/Fwk/VizFwk/LibRender/CMakeLists.txt index c0f342b58a..94759337b4 100644 --- a/Fwk/VizFwk/LibRender/CMakeLists.txt +++ b/Fwk/VizFwk/LibRender/CMakeLists.txt @@ -45,6 +45,7 @@ cvfOpenGL.h cvfOpenGLCapabilities.h cvfOpenGLContext.h cvfOpenGLContextGroup.h +cvfOpenGLInfo.h cvfOpenGLResourceManager.h cvfOpenGLTypes.h cvfOpenGLUtils.h @@ -123,6 +124,7 @@ cvfOglRc.cpp cvfOpenGLCapabilities.cpp cvfOpenGLContext.cpp cvfOpenGLContextGroup.cpp +cvfOpenGLInfo.cpp cvfOpenGLResourceManager.cpp cvfOpenGLUtils.cpp cvfOpenGL.cpp diff --git a/Fwk/VizFwk/LibRender/cvfOpenGLInfo.cpp b/Fwk/VizFwk/LibRender/cvfOpenGLInfo.cpp new file mode 100644 index 0000000000..6f7adfe41f --- /dev/null +++ b/Fwk/VizFwk/LibRender/cvfOpenGLInfo.cpp @@ -0,0 +1,101 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2018 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library 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 General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library 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 library 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 at <> +// for more details. +// +//################################################################################################## + + +#include "cvfBase.h" +#include "cvfOpenGLInfo.h" + +namespace cvf { + + +//================================================================================================== +/// +/// \class cvf::OpenGLInfo +/// \ingroup Render +/// +/// +/// +//================================================================================================== + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +OpenGLInfo::OpenGLInfo() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +OpenGLInfo::~OpenGLInfo() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +String OpenGLInfo::version() const +{ + return m_version; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +String OpenGLInfo::vendor() const +{ + return m_vendor; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +String OpenGLInfo::renderer() const +{ + return m_renderer; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void OpenGLInfo::setOpenGLStrings(String version, String vendor, String renderer) +{ + m_version = version; + m_vendor = vendor; + m_renderer = renderer; +} + +} // namespace cvf diff --git a/Fwk/VizFwk/LibRender/cvfOpenGLInfo.h b/Fwk/VizFwk/LibRender/cvfOpenGLInfo.h new file mode 100644 index 0000000000..8fb43dc46b --- /dev/null +++ b/Fwk/VizFwk/LibRender/cvfOpenGLInfo.h @@ -0,0 +1,68 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2018 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library 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 General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library 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 library 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 at <> +// for more details. +// +//################################################################################################## + + +#pragma once + +#include "cvfString.h" + +namespace cvf { + + +//================================================================================================== +// +// +// +//================================================================================================== +class OpenGLInfo +{ +public: + OpenGLInfo(); + ~OpenGLInfo(); + + String version() const; + String vendor() const; + String renderer() const; + + void setOpenGLStrings(String version, String vendor, String renderer); + +private: + String m_version; + String m_vendor; + String m_renderer; +}; + +}