neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_rendering_context.hpp
Go to the documentation of this file.
1// i_rendering_context.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>
28
29namespace neogfx
30{
31 class i_rendering_engine;
32 class i_gradient_shader;
33
35 {
36 public:
37 struct texture_not_resident : std::runtime_error { texture_not_resident() : std::runtime_error("neogfx::i_rendering_context::texture_not_resident") {} };
38 public:
39 virtual ~i_rendering_context() = default;
40 virtual std::unique_ptr<i_rendering_context> clone() const = 0;
41 public:
43 virtual const i_render_target& render_target() const = 0;
44 virtual rect rendering_area(bool aConsiderScissor = true) const = 0;
45 virtual const graphics_operation::queue& queue() const = 0;
47 virtual void enqueue(const graphics_operation::operation& aOperation) = 0;
48 virtual void flush() = 0;
49 public:
52 virtual vec2 offset() const = 0;
53 virtual void set_offset(const optional_vec2& aOffset) = 0;
54 virtual bool gradient_set() const = 0;
55 virtual void apply_gradient(i_gradient_shader& aShader) = 0;
56 public:
58 };
59}
virtual i_rendering_engine & rendering_engine() const =0
virtual const i_render_target & render_target() const =0
virtual vec2 offset() const =0
virtual void enqueue(const graphics_operation::operation &aOperation)=0
virtual neogfx::logical_coordinate_system logical_coordinate_system() const =0
virtual ~i_rendering_context()=default
virtual void apply_gradient(i_gradient_shader &aShader)=0
virtual void set_offset(const optional_vec2 &aOffset)=0
virtual neogfx::subpixel_format subpixel_format() const =0
virtual bool gradient_set() const =0
virtual graphics_operation::queue & queue()=0
virtual rect rendering_area(bool aConsiderScissor=true) const =0
virtual neogfx::logical_coordinates logical_coordinates() const =0
virtual std::unique_ptr< i_rendering_context > clone() const =0
virtual const graphics_operation::queue & queue() const =0
std::variant< std::monostate, set_logical_coordinate_system, set_logical_coordinates, set_origin, set_viewport, scissor_on, scissor_off, snap_to_pixel_on, snap_to_pixel_off, set_opacity, set_blending_mode, set_smoothing_mode, push_logical_operation, pop_logical_operation, line_stipple_on, line_stipple_off, subpixel_rendering_on, subpixel_rendering_off, clear, clear_depth_buffer, clear_stencil_buffer, clear_gradient, set_gradient, set_pixel, draw_pixel, draw_line, draw_triangle, draw_rect, draw_rounded_rect, draw_checker_rect, draw_circle, draw_ellipse, draw_pie, draw_arc, draw_cubic_bezier, draw_path, draw_shape, draw_entities, draw_glyphs, draw_mesh > operation
std::vector< operation > queue
logical_coordinate_system
subpixel_format
Definition i_display.hpp:33