Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
drawing.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Windows.h>
4 #include <dwrite.h>
5 
7 
8 namespace Blam::Content::Fonts
9 {
10  struct Font;
11  struct FontGlyph;
12 }
13 
15 {
16  class BitmapText;
17 }
18 
20 
21 #ifndef BLAM
22 #define BLAM
23 #endif
24 
29 {
31  // Rectangle Drawing //
33 
45  BLAM HRESULT DrawRect(D2D1_COLOR_F outline_color, D2D1_COLOR_F fill_color, D2D1_RECT_F rect, float thickness, StackItemDrawMode mode);
46 
56  BLAM HRESULT DrawRect(D2D1_COLOR_F color, D2D1_RECT_F rect, float thickness);
57 
69  BLAM HRESULT DrawRect(float r, float g, float b, D2D1_RECT_F rect, float thickness);
70 
72  // DirectWrite Text Drawing //
74 
86  BLAM HRESULT DWDrawText(std::wstring text, std::wstring font, float size, D2D1_RECT_F area, D2D1_COLOR_F color);
87 
104  BLAM HRESULT DWDrawText(std::wstring text, std::wstring font, float size, float left, float bottom, float right, float top, float r, float g, float b);
105 
121  BLAM HRESULT DWDrawText(std::wstring text, std::wstring font_name, float size, int x, int y, D2D1_COLOR_F color, IDWriteFontCollection* font_collection, bool auto_calculate_area, D2D1_RECT_F area);
122 
124  // Bitmap Drawing //
126 
140  BLAM HRESULT DrawBitmapFromResource(int res_id, const char* res_type, D2D1_RECT_F area, int width, int height);
141 
143  // Ellipse Drawing //
145 
157  BLAM HRESULT DrawEllipse(D2D1_COLOR_F outline_color, D2D1_COLOR_F fill_color, D2D1_ELLIPSE ellipse, float thickness, StackItemDrawMode mode);
158 
160  // Rounded Rectangle Drawing //
162 
174  BLAM HRESULT DrawRoundedRect(D2D1_COLOR_F outline_color, D2D1_COLOR_F fill_color, D2D1_ROUNDED_RECT rounded_rect, float thickness, StackItemDrawMode mode);
175 
177  // Line Drawing //
179 
190  BLAM HRESULT DrawLine(D2D1_COLOR_F color, D2D1_POINT_2F start_point, D2D1_POINT_2F end_point, float thickness);
191 
193  // Bitmap Text Drawing //
195 
209  BLAM HRESULT DrawBitmapText(BlamRendering::RenderStack::BitmapText* text_object, Blam::Content::Fonts::Font* font, bool replace_color_codes);
210 
214  namespace Widgets
215  {
226  BLAM void DrawInvalidBitmapArea(D2D1_RECT_F area);
227  }
228 }
BlamRendering::DirectX::Drawing::DrawEllipse
BLAM HRESULT DrawEllipse(D2D1_COLOR_F outline_color, D2D1_COLOR_F fill_color, D2D1_ELLIPSE ellipse, float thickness, StackItemDrawMode mode)
Draws an ellipse.
Definition: ellipse.cpp:10
width
int width
Definition: bgfx.cpp:18
BlamRendering::DirectX::Drawing::DrawBitmapFromResource
BLAM HRESULT DrawBitmapFromResource(int res_id, const char *res_type, D2D1_RECT_F area, int width, int height)
Draws a bitmap pulled from an application resource.
Definition: bitmap.cpp:6
BlamRendering::RenderStack
Namespace containing things relating to the Render Stack.
Definition: drawing.h:14
color
@ color
Definition: render_model.h:12
BlamRendering::DirectX::Drawing
Namespace containing functions to handle the drawing of Direct2D primitives.
Definition: drawing.h:28
BlamRendering::DirectX::Drawing::DrawRect
BLAM HRESULT DrawRect(D2D1_COLOR_F outline_color, D2D1_COLOR_F fill_color, D2D1_RECT_F rect, float thickness, StackItemDrawMode mode)
Draws a rectangle.
Definition: rect.cpp:9
BLAM
#define BLAM
Definition: drawing.h:22
Blam::Content::Fonts::Font
Structure to contain data for a Font.
Definition: fonts.h:68
BlamRendering::DirectX::Drawing::DrawBitmapText
BLAM HRESULT DrawBitmapText(BlamRendering::RenderStack::BitmapText *text_object, Blam::Content::Fonts::Font *font, bool replace_color_codes)
Draws the specified text using a Bitmap-based Blamite Font.
Definition: text.cpp:550
height
int height
Definition: bgfx.cpp:19
BlamRendering::RenderStack::BitmapText
Class representing text drawn using a Bitmap-based engine font.
Definition: render_stack.h:794
BlamRendering::DirectX::Drawing::DrawRoundedRect
BLAM HRESULT DrawRoundedRect(D2D1_COLOR_F outline_color, D2D1_COLOR_F fill_color, D2D1_ROUNDED_RECT rounded_rect, float thickness, StackItemDrawMode mode)
Draws a rounded rectangle.
Definition: rounded_rect.cpp:10
fonts.h
BlamRendering::DirectX::Drawing::Widgets::DrawInvalidBitmapArea
BLAM void DrawInvalidBitmapArea(D2D1_RECT_F area)
A widget used to represent an invalid bitmap.
Definition: invalid_bitmap.cpp:7
Blam::Content::Fonts
Definition: fonts.h:33
StackItemDrawMode
StackItemDrawMode
Enumerator to specify the stack item draw mode.
Definition: render_stack.h:85
BlamRendering::DirectX::Drawing::DWDrawText
BLAM HRESULT DWDrawText(std::wstring text, std::wstring font, float size, D2D1_RECT_F area, D2D1_COLOR_F color)
Draws a string using DirectWrite.
Definition: dwtext.cpp:16
BlamRendering::DirectX::Drawing::DrawLine
BLAM HRESULT DrawLine(D2D1_COLOR_F color, D2D1_POINT_2F start_point, D2D1_POINT_2F end_point, float thickness)
Draws a line.
Definition: line.cpp:10