finxing memory usages

This commit is contained in:
Kbz-8
2024-12-16 01:24:25 +01:00
parent 11ccc041d2
commit ab4d67d764
24 changed files with 315 additions and 79 deletions

View File

@@ -59,6 +59,8 @@ namespace mlx
flags |= SDL_WINDOW_SHOWN;
if(info->is_resizable)
flags |= SDL_WINDOW_RESIZABLE;
if(info->is_fullscreen)
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
infos->window = SDL_CreateWindow(info->title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, info->width, info->height, flags);
if(!infos->window)
@@ -148,6 +150,31 @@ namespace mlx
SDL_SetWindowFullscreen(static_cast<Internal::WindowInfos*>(window)->window, (enable ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0));
}
void SDLManager::SetWindowMaxSize(Handle window, int x, int y) const noexcept
{
SDL_SetWindowMaximumSize(static_cast<Internal::WindowInfos*>(window)->window, x, y);
}
void SDLManager::SetWindowMinSize(Handle window, int x, int y) const noexcept
{
SDL_SetWindowMinimumSize(static_cast<Internal::WindowInfos*>(window)->window, x, y);
}
void SDLManager::MaximizeWindow(Handle window) const noexcept
{
SDL_MaximizeWindow(static_cast<Internal::WindowInfos*>(window)->window);
}
void SDLManager::MinimizeWindow(Handle window) const noexcept
{
SDL_MinimizeWindow(static_cast<Internal::WindowInfos*>(window)->window);
}
void SDLManager::RestoreWindow(Handle window) const noexcept
{
SDL_RestoreWindow(static_cast<Internal::WindowInfos*>(window)->window);
}
void SDLManager::GetWindowPosition(Handle window, int* x, int* y) const noexcept
{
SDL_GetWindowPosition(static_cast<Internal::WindowInfos*>(window)->window, x, y);