FreeCAD WebAssembly development snapshot
Some checks failed
FreeCAD master CI / Prepare (push) Has been cancelled
FreeCAD master CI / Pixi (push) Has been cancelled
FreeCAD master CI / Ubuntu (push) Has been cancelled
FreeCAD master CI / Windows (push) Has been cancelled
FreeCAD master CI / Lint (push) Has been cancelled
FreeCAD master CI / WrapUp (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Stale Issues / stale (push) Has been cancelled
Some checks failed
FreeCAD master CI / Prepare (push) Has been cancelled
FreeCAD master CI / Pixi (push) Has been cancelled
FreeCAD master CI / Ubuntu (push) Has been cancelled
FreeCAD master CI / Windows (push) Has been cancelled
FreeCAD master CI / Lint (push) Has been cancelled
FreeCAD master CI / WrapUp (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Stale Issues / stale (push) Has been cancelled
This commit is contained in:
71
src/Gui/Multisample.h
Normal file
71
src/Gui/Multisample.h
Normal file
@@ -0,0 +1,71 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2024 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
* This file is part of FreeCAD. *
|
||||
* *
|
||||
* FreeCAD 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. *
|
||||
* *
|
||||
* FreeCAD 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 FreeCAD. If not, see *
|
||||
* <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <FCGlobal.h>
|
||||
#include <QOffscreenSurface>
|
||||
#include <QOpenGLContext>
|
||||
#include <QSurfaceFormat>
|
||||
|
||||
namespace Gui
|
||||
{
|
||||
|
||||
/** @name Anti-Aliasing modes of the rendered 3D scene
|
||||
* Specifies Anti-Aliasing (AA) method
|
||||
* - Smoothing enables OpenGL line and vertex smoothing (basically deprecated)
|
||||
* - MSAA is hardware multi sampling (with 2, 4, 6 or 8 passes), a quite common and efficient AA
|
||||
* technique
|
||||
*/
|
||||
//@{
|
||||
enum class AntiAliasing
|
||||
{
|
||||
None = 0,
|
||||
MSAA1x = 1,
|
||||
MSAA2x = 2,
|
||||
MSAA4x = 3,
|
||||
MSAA6x = 5,
|
||||
MSAA8x = 4
|
||||
};
|
||||
//@}
|
||||
|
||||
class GuiExport Multisample
|
||||
{
|
||||
public:
|
||||
Multisample();
|
||||
bool testSamples(int num) const;
|
||||
std::vector<std::pair<QString, AntiAliasing>> supported() const;
|
||||
static int toSamples(AntiAliasing msaa);
|
||||
static AntiAliasing toAntiAliasing(int samples);
|
||||
static AntiAliasing readMSAAFromSettings();
|
||||
static void writeMSAAToSettings(AntiAliasing msaa);
|
||||
|
||||
private:
|
||||
QSurfaceFormat format;
|
||||
QOpenGLContext context;
|
||||
QOffscreenSurface offscreen;
|
||||
};
|
||||
|
||||
} // namespace Gui
|
||||
Reference in New Issue
Block a user