| 1 | // Copyright (C) 2020 James Turner |
| 2 | |
| 3 | // This program is free software; you can redistribute it and/or |
| 4 | // modify it under the terms of the GNU General Public License as |
| 5 | // published by the Free Software Foundation; either version 2 of the |
| 6 | // License, or (at your option) any later version. |
| 7 | // |
| 8 | // This program is distributed in the hope that it will be useful, but |
| 9 | // WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | // General Public License for more details. |
| 12 | // |
| 13 | // You should have received a copy of the GNU General Public License |
| 14 | // along with this program; if not, write to the Free Software |
| 15 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 16 | |
| 17 | #pragma once |
| 18 | |
| 19 | #include <functional> |
| 20 | #include <string> |
| 21 | |
| 22 | #include <osgViewer/GraphicsWindow> |
| 23 | #include <osg/GraphicsContext> |
| 24 | |
| 25 | class QWindow; |
| 26 | class QOpenGLContext; |
| 27 | class QThread; |
| 28 | |
| 29 | namespace flightgear |
| 30 | { |
| 31 | |
| 32 | QOpenGLContext* qtContextFromOSG(osg::GraphicsContext* context); |
| 33 | QWindow* qtWindowFromOSG(osgViewer::GraphicsWindow* graphicsWindow); |
| 34 | |
| 35 | using GraphicsFunctor = std::function<void(osg::GraphicsContext* context)>; |
| 36 | |
| 37 | osg::ref_ptr<osg::GraphicsOperation> makeGraphicsOp(const std::string& name, GraphicsFunctor func); |
| 38 | |
| 39 | } |