Files
fennec/include/fennec/platform/opengl/egl/surface.h
2026-01-06 19:48:28 -05:00

63 lines
2.1 KiB
C++

// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 - 2026 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/>.
// =====================================================================================================================
///
/// \file fennec/platform/opengl/egl/surface.h
/// \brief
///
///
/// \details
/// \author Medusa Slockbower
///
/// \copyright Copyright © 2025 - 2026 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
///
///
#ifndef FENNEC_PLATFORM_OPENGL_EGL_SURFACE_H
#define FENNEC_PLATFORM_OPENGL_EGL_SURFACE_H
#include <fennec/platform/opengl/glad/egl.h>
#include <fennec/platform/opengl/egl/fwd.h>
#include <fennec/renderers/interface/gfxsurface.h>
namespace fennec
{
/// \brief base egl surface with platform-independent behaviour
class eglsurface : public gfxsurface {
public:
/// \brief constructor
/// \param win the associated window
/// \param ctx the associated context
/// \param eglwindow the create egl window
eglsurface(fennec::window* win, eglcontext* ctx, void* eglwindow);
~eglsurface();
void make_current() override; //!< makes this surface the current target of the context
void swap() override; //!< swaps the front and back buffers
protected:
void* _eglwindow; //!< the underlying handle to the window
EGLSurface _eglsurface; //!< the handle for the surface
};
} // fennec
#endif // FENNEC_PLATFORM_OPENGL_EGL_SURFACE_H