// =====================================================================================================================
//  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/renderers/interface/gfxcontext.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_RENDERERS_INTERFACE_GFXSURFACE_H
#define FENNEC_RENDERERS_INTERFACE_GFXSURFACE_H

#include <fennec/platform/interface/window.h>

namespace fennec
{

///
/// \brief Interface representing a renderable surface for a graphics API.
class gfxsurface {

// Constructors & Destructor ===========================================================================================
public:

	/// \name Constructors & Destructor
	/// @{

	///
	/// \brief Graphics Surface Constructor.
	/// \param win The window the surface belongs to.
	/// \param ctx The graphics context the surface belongs to.
	gfxsurface(window* win, gfxcontext* ctx)
		: window(win), context(ctx) {
	}

	///
	/// \brief Virtual Destructor
	virtual ~gfxsurface() = default;

	/// @}


// Properties ==========================================================================================================
public:


// Operations ==========================================================================================================
public:

	/// \name Operations
	/// @{

	///
	/// \brief Make this surface, and the context that it belongs to, the current rendering target for the graphics API.
	virtual void make_current() = 0;

	///
	/// \brief Swap the surface's front & back buffers.
	virtual void swap() = 0;

	///
	/// \brief Resize the backing buffers of the surface.
	/// \param size The new size.
	virtual void resize(const ivec2& size) = 0;

	/// @}


// Protected Member Variables ==========================================================================================
protected:
	window* const     window;  //!< The window the surface belongs to.
	gfxcontext* const context; //!< The graphics context the surface belongs to.
};

}

#endif // FENNEC_RENDERERS_INTERFACE_GFXSURFACE_H