- Huge refactor on Wayland loading to support retrieval of Protocol headers - Setup EGL to create surfaces for Wayland windows
65 lines
2.0 KiB
C++
65 lines
2.0 KiB
C++
// =====================================================================================================================
|
|
// fennec, a free and open source game engine
|
|
// Copyright © 2025 Medusa Slockbower
|
|
//
|
|
// This program 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 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 General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
// =====================================================================================================================
|
|
|
|
#ifndef FENNEC_PLATFORM_INTERFACE_GFXCONTEXT_H
|
|
#define FENNEC_PLATFORM_INTERFACE_GFXCONTEXT_H
|
|
|
|
#include <fennec/langproc/strings/string.h>
|
|
#include <fennec/lang/typeuuid.h>
|
|
#include <fennec/platform/interface/fwd.h>
|
|
#include <fennec/platform/interface/window.h>
|
|
|
|
namespace fennec
|
|
{
|
|
|
|
class gfxcontext : public typed<gfxcontext> {
|
|
public:
|
|
const string name;
|
|
|
|
virtual bool connected() = 0;
|
|
virtual const cstring& get_name() = 0;
|
|
virtual int32_t get_version_major() = 0;
|
|
virtual int32_t get_version_minor() = 0;
|
|
virtual int32_t get_version() = 0;
|
|
|
|
virtual bool check_extension(const cstring& ext) = 0;
|
|
virtual void make_current(gfxsurface* surface) = 0;
|
|
|
|
virtual gfxsurface* create_surface(window* window) = 0;
|
|
|
|
virtual ~gfxcontext() = default;
|
|
|
|
display* get_display() {
|
|
return _display;
|
|
}
|
|
|
|
protected:
|
|
display* _display;
|
|
|
|
template<typename ContextT>
|
|
gfxcontext(display* display, const cstring& name, ContextT* type)
|
|
: typed(type)
|
|
, name(name)
|
|
, _display(display) {
|
|
}
|
|
};
|
|
|
|
}
|
|
|
|
#endif // FENNEC_PLATFORM_INTERFACE_GFXCONTEXT_H
|