neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_native_surface.hpp
Go to the documentation of this file.
1// i_native_surface.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
23#include <neogfx/hid/mouse.hpp>
24#include <neogfx/core/event.hpp>
28
29namespace neogfx
30{
31 class i_rendering_engine;
32 class i_rendering_context;
33 class i_widget;
34
36 {
37 public:
38 struct context_mismatch : std::logic_error { context_mismatch() : std::logic_error("neogfx::i_native_surface::context_mismatch") {} };
39 struct no_invalidated_area : std::logic_error { no_invalidated_area() : std::logic_error("neogfx::i_native_surface::no_invalidated_area") {} };
40 public:
42 public:
43 virtual ~i_native_surface() = default;
44 public:
45 virtual uint64_t frame_counter() const = 0;
46 virtual double fps() const = 0;
47 virtual double potential_fps() const = 0;
48 public:
49 virtual void invalidate(const rect& aInvalidatedRect) = 0;
50 virtual bool has_invalidated_area() const = 0;
51 virtual const rect& invalidated_area() const = 0;
52 virtual rect validate() = 0;
53 virtual bool can_render() const = 0;
54 virtual void render(bool aOOBRequest = false) = 0;
55 virtual void pause() = 0;
56 virtual void resume() = 0;
57 virtual bool is_rendering() const = 0;
59 virtual std::unique_ptr<i_rendering_context> create_graphics_context(const i_widget& aWidget, blending_mode aBlendingMode = blending_mode::Default) const = 0; // todo: use ref_ptr
60 public:
61 virtual void debug(bool aEnableDebug) = 0;
62 };
63}
virtual void debug(bool aEnableDebug)=0
virtual bool can_render() const =0
virtual ~i_native_surface()=default
virtual void pause()=0
virtual double potential_fps() const =0
virtual rect validate()=0
virtual void resume()=0
virtual void invalidate(const rect &aInvalidatedRect)=0
virtual bool is_rendering() const =0
virtual uint64_t frame_counter() const =0
virtual bool has_invalidated_area() const =0
virtual void render(bool aOOBRequest=false)=0
virtual double fps() const =0
virtual std::unique_ptr< i_rendering_context > create_graphics_context(const i_widget &aWidget, blending_mode aBlendingMode=blending_mode::Default) const =0
virtual const rect & invalidated_area() const =0
virtual std::unique_ptr< i_rendering_context > create_graphics_context(blending_mode aBlendingMode=blending_mode::Default) const =0