Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
render_utils.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <d2d1.h>
4 #include <Windows.h>
5 #include <wincodec.h>
6 
7 #ifndef BLAM
8 #define BLAM
9 #endif
10 
14 struct Pixel
15 {
16  BYTE* r;
17  BYTE* g;
18  BYTE* b;
19  BYTE* a;
20 };
21 
26 {
44  BLAM HRESULT IntegerBitmapScale(IWICBitmap* source, int scale_factor, ID2D1Bitmap** destination, ID2D1RenderTarget* target);
45 
57  BLAM Pixel GetPixelData(BYTE* origin, int x, int y, int width, int height);
58 
71  BLAM HRESULT GetWICBitmapPixelData(IWICBitmap** bitmap, UINT* width, UINT* height, IWICBitmapLock** bitmap_lock, UINT* buffer_size, BYTE** start_address);
72 }
BlamRendering::RenderStack::StackObjectBase::draw_mode
StackItemDrawMode draw_mode
The drawing mode of the object.
Definition: render_stack.h:373
BlamRendering::DirectX::WIC::ConvertWICBitmapToD2D
BLAM HRESULT ConvertWICBitmapToD2D(IWICBitmap *wic_bitmap, ID2D1Bitmap **d2d_bitmap)
Converts a WIC bitmap to a D2D bitmap.
Definition: wic.cpp:91
BlamRendering::RenderStack::StackObjectBase::visible
bool visible
Whether or not the object is visible.
Definition: render_stack.h:375
BlamRendering::RenderStack::ImGUIObject::ShowImPropertyEditor
void ShowImPropertyEditor()
Shows a set of ImGUI properties associated with the object.
Definition: ImGUIObject.cpp:11
Pixel::r
BYTE * r
The Red value of the pixel.
Definition: render_utils.h:16
BlamRendering::RenderStack::RoundedRectangle::ShowImPropertyEditor
void ShowImPropertyEditor()
Shows a set of ImGUI properties associated with the object.
Definition: RoundedRectangle.cpp:33
BlamRendering::RenderStack::RoundedRectangle::thickness
float thickness
The current border thickness.
Definition: render_stack.h:511
BlamRendering::DirectX::Utils::GetPixelData
BLAM Pixel GetPixelData(BYTE *origin, int x, int y, int width, int height)
Retrieves a pixel from the specified memory address.
Definition: bitmap_utils.cpp:152
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:142
width
int width
Definition: bgfx.cpp:19
BlamRendering::RenderStack::StackObjectBase::GetDrawModeLabel
std::string GetDrawModeLabel()
Retrieves the current drawing mode of the object.
Definition: StackObjectBase.cpp:130
render_stack.h
BlamRendering::RenderStack::StackObjectBase::SetArea
void SetArea(float new_area[4])
Sets the area of the object.
Definition: StackObjectBase.cpp:6
color
BlamColor color
Typedef for a color field, used in tag definitions.
Definition: tags.h:359
logger.h
BlamRendering::RenderStack::StackObjectBase::SetZOrder
void SetZOrder(int z)
Sets the Z-Order of the object.
Definition: StackObjectBase.cpp:50
BlamRendering::RenderStack::RoundedRectangle::rounded_rect
D2D1_ROUNDED_RECT rounded_rect
The data for the rounded rectangle.
Definition: render_stack.h:513
imgui.h
Blam::UI::ImGUI::RenderFrame
BLAM void RenderFrame()
Renders ImGUI to the application window.
Definition: imgui.cpp:237
BlamRendering::RenderStack::StackObjectBase::GetType
std::string GetType()
Retrieves the type of item that this stack object is.
Definition: StackObjectBase.cpp:125
BlamRendering::RenderStack::ImGUIObject::Draw
void Draw()
Draws ImGUI to the screen.
Definition: ImGUIObject.cpp:6
Blam::Config::GetConfig
BLAM ConfigFile * GetConfig()
Retrieves the engine configuration file.
Definition: compat.cpp:5
BlamRendering::RenderStack::GetDrawModesList
BLAM std::vector< StackItemDrawMode > GetDrawModesList()
Retrieves a list of all available drawing modes.
Definition: render_stack.cpp:216
y
font DisplayOffset y
Definition: README.txt:68
rendering.h
screenshot
void screenshot()
Definition: screenshot.cpp:19
BlamRendering::DirectX::GetLastFrameHResult
BLAM HRESULT GetLastFrameHResult()
Unused.
Definition: render_manage.cpp:642
BlamRendering::DirectX::UpdateResolution
BLAM HRESULT UpdateResolution(int x, int y)
Changes the DirectX render target resolution.
Definition: resolution.cpp:9
drawing.h
NULL
Add a fourth parameter to bake specific font ranges NULL
Definition: README.txt:57
Pixel::b
BYTE * b
The Blue value of the pixel.
Definition: render_utils.h:18
BlamRendering::DirectX::GetLastFrameTexture
BLAM ID3D11Texture2D ** GetLastFrameTexture()
Retrieves the last frame that was rendered.
Definition: render_manage.cpp:626
ImGui::DragFloat
IMGUI_API bool DragFloat(const char *label, float *v, float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2164
errors.h
BlamRendering::DirectX::HandleWindowResize
BLAM HRESULT HandleWindowResize(LPARAM lParam)
Handles a window resize event.
Definition: render_manage.cpp:306
Blam::TakeScreenshot
BLAM void TakeScreenshot()
Captures the current frame and saves it to a file.
Definition: screenshot.cpp:101
format
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 format
Definition: ARPHICPL.TXT:16
Blam::EngineDefs::GetVersion
const BLAM char * GetVersion()
Retrieves the version of the engine in the following format:
Definition: engine_definitions.cpp:150
a
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1249
ImGui::BeginCombo
IMGUI_API bool BeginCombo(const char *label, const char *preview_value, ImGuiComboFlags flags=0)
Definition: imgui_widgets.cpp:1416
ImGui::Selectable
IMGUI_API bool Selectable(const char *label, bool selected=false, ImGuiSelectableFlags flags=0, const ImVec2 &size=ImVec2(0, 0))
Definition: imgui_widgets.cpp:5469
BlamRendering::RenderStack::StackObjectBase::PokeSize
void PokeSize()
Updates the area of the object to account for any width/height changes.
Definition: StackObjectBase.cpp:119
BLAM
#define BLAM
Definition: render_utils.h:8
BlamRendering::DirectX::ScreenshotDone
BLAM void ScreenshotDone()
Informs DirectX that the screenshot has finished being captured.
Definition: render_manage.cpp:664
render_utils.h
BlamRendering::RenderStack::StackObjectBase::ValidateSizeAndTranslation
void ValidateSizeAndTranslation()
Validates X/Y coordinates and Width/Height sizes after the area has been modified.
Definition: StackObjectBase.cpp:135
engine_definitions.h
BlamRendering::RenderStack::StackObjectBase::PokeTranslation
void PokeTranslation()
Updates the area of the object to account for any x/y coordinate changes.
Definition: StackObjectBase.cpp:97
BlamRendering::RenderStack::StackObjectBase::SetTranslation
void SetTranslation(float new_x, float new_y)
Sets the translation of the object.
Definition: StackObjectBase.cpp:55
ImGui::EndCombo
IMGUI_API void EndCombo()
Definition: imgui_widgets.cpp:1522
BlamRendering::RenderStack::StackObjectBase::area
D2D1_RECT_F area
The area of the object.
Definition: render_stack.h:369
height
int height
Definition: bgfx.cpp:20
BlamRendering::RenderStack::RoundedRectangle::Draw
void Draw()
Draws the stack object.
Definition: RoundedRectangle.cpp:10
ImGui::ColorEdit4
IMGUI_API bool ColorEdit4(const char *label, float col[4], ImGuiColorEditFlags flags=0)
Definition: imgui_widgets.cpp:4154
x
config GlyphExtraSpacing x
Definition: README.txt:30
BlamRendering::DirectX::Utils::GetWICBitmapPixelData
BLAM HRESULT GetWICBitmapPixelData(IWICBitmap **bitmap, UINT *width, UINT *height, IWICBitmapLock **bitmap_lock, UINT *buffer_size, BYTE **start_address)
Retrieves the pixel data from a WIC bitmap.
Definition: bitmap_utils.cpp:182
BlamRendering::RenderStack::GetDrawModeLabel
BLAM std::string GetDrawModeLabel(StackItemDrawMode type)
Retrieves a string representation of the specified drawing mode.
Definition: render_stack.cpp:176
BlamRendering::DirectX::GetD3DContext
BLAM ID3D11DeviceContext * GetD3DContext()
Retrieves the current Direct3D context.
Definition: render_manage.cpp:583
BlamRendering::DirectX::WIC::GetWICFactory
BLAM IWICImagingFactory * GetWICFactory()
Retrieves the WIC Imaging Factory.
Definition: wic.cpp:53
BlamRendering::RenderStack::RoundedRectangle::fill_color
D2D1_COLOR_F fill_color
The current fill color.
Definition: render_stack.h:512
Pixel::a
BYTE * a
The Alpha value of the pixel.
Definition: render_utils.h:19
imgui.h
core.h
BlamRendering::DirectX::Utils::IntegerBitmapScale
BLAM HRESULT IntegerBitmapScale(IWICBitmap *source, int scale_factor, ID2D1Bitmap **destination, ID2D1RenderTarget *target)
Scales a bitmap using integer scaling.
Definition: bitmap_utils.cpp:10
bitmap
Definition: bitmap.h:33
BlamRendering::RenderStack::GetStackTypeLabel
BLAM std::string GetStackTypeLabel(StackType type)
Retrieves a string representation of the specified stack type.
Definition: render_stack.cpp:133
Pixel::g
BYTE * g
The Green value of the pixel.
Definition: render_utils.h:17
Blam::Config::ConfigFile::GetString
std::string GetString(std::string option)
Retrieves a string option from a configuration file.
Definition: compat.cpp:58
config.h
Blam::Error::GetStringFromHResult
BLAM std::string GetStringFromHResult(HRESULT hr)
Converts a result handle to a string.
Definition: errors.cpp:120
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
BlamRendering::RenderStack::RoundedRectangle::PokeRoundedRectArea
void PokeRoundedRectArea()
Updates the area of the rounded rectangle after area modification.
Definition: RoundedRectangle.cpp:23
StackItemDrawMode
StackItemDrawMode
Enumerator to specify the stack item draw mode.
Definition: render_stack.h:85
BlamRendering::RenderStack::StackObjectBase::SetSize
void SetSize(float new_width, float new_height)
Sets the size of the object.
Definition: StackObjectBase.cpp:110
BlamRendering::DirectX::Utils
Namespace containing various utilities related to rendering.
Definition: render_utils.h:25
BlamRendering::RenderStack::RoundedRectangle::SetThickness
void SetThickness(float new_thickness)
Sets the thickness of the rectangle's border.
Definition: RoundedRectangle.cpp:28
Pixel
Structure representing a single pixel.
Definition: render_utils.h:14
source
const CharType(& source)[N]
Definition: pointer.h:1272
BlamRendering::RenderStack::StackObjectBase::SetColor
void SetColor(float new_color[3])
Sets the color of the object.
Definition: StackObjectBase.cpp:25