mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
finxing memory usages
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <Core/Memory.h>
|
||||
#include <Core/Fps.h>
|
||||
#include <Graphics/Font.h>
|
||||
#include <Graphics/Mesh.h>
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
@@ -47,6 +48,7 @@ namespace mlx
|
||||
Inputs m_in;
|
||||
FontRegistry m_font_registry;
|
||||
ImageRegistry m_image_registry;
|
||||
MeshRegistry m_mesh_registry;
|
||||
std::vector<std::unique_ptr<GraphicsSupport>> m_graphics;
|
||||
std::shared_ptr<Font> p_last_font_bound;
|
||||
std::function<int(Handle)> f_loop_hook;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace mlx
|
||||
|
||||
inline void PixelPut(int x, int y, int color) noexcept;
|
||||
inline void StringPut(int x, int y, int, std::string str);
|
||||
inline void TexturePut(NonOwningPtr<class Texture> texture, int x, int y, float scale, float angle);
|
||||
inline void TexturePut(NonOwningPtr<class Texture> texture, int x, int y, float scale_x, float scale_y, float angle);
|
||||
|
||||
inline void TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept;
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@ namespace mlx
|
||||
p_scene->BringToDrawLayer(text.Get(), m_draw_layer);
|
||||
}
|
||||
|
||||
void GraphicsSupport::TexturePut(NonOwningPtr<Texture> texture, int x, int y, float scale, float angle)
|
||||
void GraphicsSupport::TexturePut(NonOwningPtr<Texture> texture, int x, int y, float scale_x, float scale_y, float angle)
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
NonOwningPtr<Sprite> sprite = p_scene->GetSpriteFromTexturePositionScaleRotation(texture, Vec2f{ static_cast<float>(x), static_cast<float>(y) }, scale, angle);
|
||||
NonOwningPtr<Sprite> sprite = p_scene->GetSpriteFromTexturePositionScaleRotation(texture, Vec2f{ static_cast<float>(x), static_cast<float>(y) }, scale_x, scale_y, angle);
|
||||
if(!sprite)
|
||||
{
|
||||
if(m_pixelput_called)
|
||||
@@ -73,7 +73,7 @@ namespace mlx
|
||||
Sprite& new_sprite = p_scene->CreateSprite(texture);
|
||||
new_sprite.SetCenter(Vec2f{ texture->GetWidth() / 2.0f, texture->GetHeight() / 2.0f });
|
||||
new_sprite.SetPosition(Vec2f{ static_cast<float>(x), static_cast<float>(y) });
|
||||
new_sprite.SetScale(Vec2f{ scale, scale });
|
||||
new_sprite.SetScale(Vec2f{ scale_x, scale_y });
|
||||
new_sprite.SetRotation(angle);
|
||||
}
|
||||
else if(!p_scene->IsTextureAtGivenDrawLayer(texture, m_draw_layer))
|
||||
|
||||
@@ -25,6 +25,12 @@ namespace mlx
|
||||
void SetWindowSize(Handle window, int x, int y) const noexcept;
|
||||
void SetWindowTitle(Handle window, std::string_view title) const noexcept;
|
||||
void SetWindowFullscreen(Handle window, bool enable) const noexcept;
|
||||
void SetWindowMaxSize(Handle window, int x, int y) const noexcept;
|
||||
void SetWindowMinSize(Handle window, int x, int y) const noexcept;
|
||||
void MaximizeWindow(Handle window) const noexcept;
|
||||
void MinimizeWindow(Handle window) const noexcept;
|
||||
void RestoreWindow(Handle window) const noexcept;
|
||||
|
||||
void GetWindowPosition(Handle window, int* x, int* y) const noexcept;
|
||||
void GetWindowSize(Handle window, int* x, int* y) const noexcept;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user