MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
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
17#include <mgl/mgl_environment.h>
20
21namespace MGL::Render
22{
25{
26public:
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
2D描画オプション
Definition mgl_draw_option_2d.h:23
MGL 2Dレンダラデリゲート
Definition mgl_renderer_2d_delegate.h:25
virtual void DrawRectangle(const Rectangle &rectangle, const Color &color, const DrawOption2D &option) noexcept=0
矩形の描画
virtual Rectangle GetScissorRectangle() const noexcept=0
シザー矩形を取得
virtual bool IsEnabledScissor() const noexcept=0
シザーが有効かどうかを取得
virtual void Flush() noexcept=0
描画の実行
virtual SharedTextureResource GetRenderTarget() const noexcept=0
現在のレンダーターゲットを取得
virtual void SetScissor(bool isEnabled, const Rectangle &rectangle) noexcept=0
シザーを設定
virtual ~Renderer2DDelegate() noexcept=default
デストラクタ
virtual void DrawSprite(const Vector2 &position, SharedTextureResource textureResource, const Rectangle &sourceRectangle, const DrawOption2D &option) noexcept=0
スプライトの描画
virtual RendererType GetRendererType() const noexcept=0
レンダラの種類を取得
virtual void DrawLine(const Vector2 &start, const Vector2 &end, const Color &color) noexcept=0
ラインの描画
virtual SharedTextureResource GetMainRenderTarget() const noexcept=0
メインレンダーターゲットを取得
virtual bool SetRenderTarget(SharedTextureResource renderTarget) noexcept=0
レンダーターゲットの設定
virtual bool CanInitialize() const noexcept=0
レンダラが初期化可能な状態かを取得
virtual void Clear(const Color &color) noexcept=0
描画領域のクリア
virtual bool Initialize() noexcept=0
初期化処理
MGL 色情報
MGL 2D描画オプション
MGL 環境定義
MGL 矩形
RendererType
レンダラタイプの型
Definition mgl_render_types.h:21
MGL テクスチャローダー
std::shared_ptr< MGL::Render::TextureResource > SharedTextureResource
共有するテクスチャリソースの型
Definition mgl_texture_resource.h:145
MGL 2Dベクトル
色情報
Definition mgl_color.h:22
矩形
Definition mgl_rectangle.h:20
2Dベクトル
Definition mgl_vector2.h:23