MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
include
mgl
render
mgl_renderer_2d_delegate.h
[詳解]
1
// SPDX-License-Identifier: Zlib
2
/* ------------------------------------------------------------------------- */
9
/* ------------------------------------------------------------------------- */
10
11
#ifndef INCGUARD_MGL_RENDERER_2D_DELEGATE_H_1606565371
12
#define INCGUARD_MGL_RENDERER_2D_DELEGATE_H_1606565371
13
14
#include <
mgl/common/mgl_color.h
>
15
#include <
mgl/math/mgl_rectangle.h
>
16
#include <
mgl/math/mgl_vector2.h
>
17
#include <
mgl/mgl_environment.h
>
18
#include <
mgl/render/mgl_draw_option_2d.h
>
19
#include <
mgl/render/mgl_texture_loader.h
>
20
21
namespace
MGL::Render
22
{
24
class
Renderer2DDelegate
25
{
26
public
:
27
/* ------------------------------------------------------------------------- */
31
/* ------------------------------------------------------------------------- */
32
virtual
~Renderer2DDelegate
() noexcept = default;
33
34
/* ------------------------------------------------------------------------- */
39
/* ------------------------------------------------------------------------- */
40
[[nodiscard]] virtual
RendererType
GetRendererType
() const noexcept = 0;
41
42
/* ------------------------------------------------------------------------- */
48
/* ------------------------------------------------------------------------- */
49
[[nodiscard]] virtual
bool
CanInitialize
() const noexcept = 0;
50
51
/* ------------------------------------------------------------------------- */
57
/* ------------------------------------------------------------------------- */
58
virtual
bool
Initialize
() noexcept = 0;
59
60
/* ------------------------------------------------------------------------- */
64
/* ------------------------------------------------------------------------- */
65
virtual
void
Flush
() noexcept = 0;
66
67
/* ------------------------------------------------------------------------- */
72
/* ------------------------------------------------------------------------- */
73
virtual
void
Clear
(const
Color
&color) noexcept = 0;
74
75
/* ------------------------------------------------------------------------- */
82
/* ------------------------------------------------------------------------- */
83
virtual
void
DrawLine
(const
Vector2
&start, const
Vector2
&end, const
Color
&color) noexcept = 0;
84
85
/* ------------------------------------------------------------------------- */
92
/* ------------------------------------------------------------------------- */
93
virtual
void
DrawRectangle
(const
Rectangle
&rectangle, const
Color
&color, const
DrawOption2D
&option) noexcept = 0;
94
95
/* ------------------------------------------------------------------------- */
103
/* ------------------------------------------------------------------------- */
104
virtual
void
DrawSprite
(
105
const
Vector2
&position,
106
SharedTextureResource
textureResource,
107
const
Rectangle
&sourceRectangle,
108
const
DrawOption2D
&option) noexcept = 0;
109
110
/* ------------------------------------------------------------------------- */
117
/* ------------------------------------------------------------------------- */
118
virtual
bool
SetRenderTarget
(
SharedTextureResource
renderTarget) noexcept = 0;
119
120
/* ------------------------------------------------------------------------- */
125
/* ------------------------------------------------------------------------- */
126
[[nodiscard]] virtual
SharedTextureResource
GetRenderTarget
() const noexcept = 0;
127
128
/* ------------------------------------------------------------------------- */
133
/* ------------------------------------------------------------------------- */
134
[[nodiscard]] virtual
SharedTextureResource
GetMainRenderTarget
() const noexcept = 0;
135
136
/* ------------------------------------------------------------------------- */
142
/* ------------------------------------------------------------------------- */
143
virtual
void
SetScissor
(
bool
isEnabled, const
Rectangle
&rectangle) noexcept = 0;
144
145
/* ------------------------------------------------------------------------- */
151
/* ------------------------------------------------------------------------- */
152
[[nodiscard]] virtual
bool
IsEnabledScissor
() const noexcept = 0;
153
154
/* ------------------------------------------------------------------------- */
159
/* ------------------------------------------------------------------------- */
160
[[nodiscard]] virtual
Rectangle
GetScissorRectangle
() const noexcept = 0;
161
};
162
}
// namespace MGL::Render
163
#endif
// INCGUARD_MGL_RENDERER_2D_DELEGATE_H_1606565371
164
165
// vim: et ts=4 sw=4 sts=4
MGL::Render::DrawOption2D
2D描画オプション
Definition
mgl_draw_option_2d.h:23
MGL::Render::Renderer2DDelegate
MGL 2Dレンダラデリゲート
Definition
mgl_renderer_2d_delegate.h:25
MGL::Render::Renderer2DDelegate::DrawRectangle
virtual void DrawRectangle(const Rectangle &rectangle, const Color &color, const DrawOption2D &option) noexcept=0
矩形の描画
MGL::Render::Renderer2DDelegate::GetScissorRectangle
virtual Rectangle GetScissorRectangle() const noexcept=0
シザー矩形を取得
MGL::Render::Renderer2DDelegate::IsEnabledScissor
virtual bool IsEnabledScissor() const noexcept=0
シザーが有効かどうかを取得
MGL::Render::Renderer2DDelegate::Flush
virtual void Flush() noexcept=0
描画の実行
MGL::Render::Renderer2DDelegate::GetRenderTarget
virtual SharedTextureResource GetRenderTarget() const noexcept=0
現在のレンダーターゲットを取得
MGL::Render::Renderer2DDelegate::SetScissor
virtual void SetScissor(bool isEnabled, const Rectangle &rectangle) noexcept=0
シザーを設定
MGL::Render::Renderer2DDelegate::~Renderer2DDelegate
virtual ~Renderer2DDelegate() noexcept=default
デストラクタ
MGL::Render::Renderer2DDelegate::DrawSprite
virtual void DrawSprite(const Vector2 &position, SharedTextureResource textureResource, const Rectangle &sourceRectangle, const DrawOption2D &option) noexcept=0
スプライトの描画
MGL::Render::Renderer2DDelegate::GetRendererType
virtual RendererType GetRendererType() const noexcept=0
レンダラの種類を取得
MGL::Render::Renderer2DDelegate::DrawLine
virtual void DrawLine(const Vector2 &start, const Vector2 &end, const Color &color) noexcept=0
ラインの描画
MGL::Render::Renderer2DDelegate::GetMainRenderTarget
virtual SharedTextureResource GetMainRenderTarget() const noexcept=0
メインレンダーターゲットを取得
MGL::Render::Renderer2DDelegate::SetRenderTarget
virtual bool SetRenderTarget(SharedTextureResource renderTarget) noexcept=0
レンダーターゲットの設定
MGL::Render::Renderer2DDelegate::CanInitialize
virtual bool CanInitialize() const noexcept=0
レンダラが初期化可能な状態かを取得
MGL::Render::Renderer2DDelegate::Clear
virtual void Clear(const Color &color) noexcept=0
描画領域のクリア
MGL::Render::Renderer2DDelegate::Initialize
virtual bool Initialize() noexcept=0
初期化処理
mgl_color.h
MGL 色情報
mgl_draw_option_2d.h
MGL 2D描画オプション
mgl_environment.h
MGL 環境定義
mgl_rectangle.h
MGL 矩形
MGL::Render::RendererType
RendererType
レンダラタイプの型
Definition
mgl_render_types.h:21
mgl_texture_loader.h
MGL テクスチャローダー
MGL::Render::SharedTextureResource
std::shared_ptr< MGL::Render::TextureResource > SharedTextureResource
共有するテクスチャリソースの型
Definition
mgl_texture_resource.h:145
mgl_vector2.h
MGL 2Dベクトル
MGL::Color
色情報
Definition
mgl_color.h:22
MGL::Rectangle
矩形
Definition
mgl_rectangle.h:20
MGL::Vector2
2Dベクトル
Definition
mgl_vector2.h:23
構築:
1.12.0