Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.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
font
io.Fonts->AddFontFromMemoryCompressedTTF(compressed_data, compressed_data_size, size_pixels,...) font
Definition: README.txt:86
width
int width
Definition: bgfx.cpp:19
color
BlamColor color
Typedef for a color field, used in tag definitions.
Definition: tags.h:359
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
y
font DisplayOffset y
Definition: README.txt:68
Font
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font or adding deleting some characters in from glyph table PL means Public License Copyright Holder means whoever is named in the copyright or copyrights for the Font You means the or person redistributing or modifying the Font Freely Available means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you not price If you you can charge for this service Copying &Distribution You may copy and distribute verbatim copies of this Font in any without provided that you retain this license including modifying reordering converting changing font or adding deleting some characters in from glyph and copy and distribute such modifications under the terms of Section provided that the following conditions are such as by offering access to copy the modifications from a designated or distributing the modifications on a medium customarily used for software interchange c If the modified fonts normally reads commands interactively when you must cause when started running for such interactive use in the most ordinary to print or display an announcement including an appropriate copyright notice and a notice that there is no and telling the user how to view a copy of this License These requirements apply to the modified work as a whole If identifiable sections of that work are not derived from the Font
Definition: ARPHICPL.TXT:38
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:134
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:20
x
config GlyphExtraSpacing x
Definition: README.txt:30
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:99
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