Files
nova-engine/engine/include/nova/platform/window_driver.h
Jayden Grubb 6e1393ce64 Add basic surface handling to RenderDriver and WindowDriver
This will likely require significant rework but it will do for now. A
considerations worth thinking about:

- What happends when the WindowDriver destroys a window, what happens to
  the corresponding surface?
2025-04-10 17:53:48 +10:00

40 lines
1.1 KiB
C++

/**
* Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#pragma once
#include <nova/api.h>
#include <nova/types.h>
#include <string_view>
namespace Nova {
using WindowID = uptr;
using SurfaceID = uptr;
class RenderDriver;
class NOVA_API WindowDriver {
public:
static WindowDriver* create();
virtual ~WindowDriver() = default;
virtual void poll_events() = 0;
virtual void beep() = 0;
[[nodiscard]] virtual u32 get_window_count() const = 0;
[[nodiscard]] virtual WindowID create_window(std::string_view title, u32 width, u32 height) = 0;
virtual void destroy_window(WindowID window) = 0;
virtual void set_window_title(WindowID window, std::string_view title) = 0;
virtual void set_window_size(WindowID window, u32 width, u32 height) = 0;
virtual void set_window_position(WindowID window, i32 x, i32 y) = 0;
[[nodiscard]] virtual const char* get_surface_extension() const = 0;
[[nodiscard]] virtual SurfaceID create_surface(WindowID window, RenderDriver* render_driver) = 0;
};
} // namespace Nova