adding more App windowing methods

This commit is contained in:
Noel Berry 2021-05-09 19:46:08 -07:00
parent 76525f91c5
commit 991cfcad82
2 changed files with 55 additions and 6 deletions

View File

@ -1,5 +1,6 @@
#pragma once
#include <blah/common.h>
#include <blah/numerics/point.h>
namespace Blah
{
@ -112,6 +113,24 @@ namespace Blah
// Gets the user path
const char* user_path();
// Gets the Window Title
const char* get_title();
// Sets the Window Title
void set_title(const char* title);
// Gets the Window Position
Point get_position();
// Sets the Window Position
void set_position(Point point);
// Gets the Window Size
Point get_size();
// Sets the Window Size
void set_size(Point point);
// Gets the width of the window
int width();

View File

@ -204,18 +204,48 @@ const char* App::user_path()
return PlatformBackend::user_path();
}
const char* App::get_title()
{
return PlatformBackend::get_title();
}
void App::set_title(const char* title)
{
PlatformBackend::set_title(title);
}
Point App::get_position()
{
Point result;
PlatformBackend::get_position(&result.x, &result.y);
return result;
}
void App::set_position(Point point)
{
PlatformBackend::set_position(point.x, point.y);
}
Point App::get_size()
{
Point result;
PlatformBackend::get_size(&result.x, &result.y);
return result;
}
void App::set_size(Point point)
{
PlatformBackend::set_size(point.x, point.y);
}
int App::width()
{
int w, h;
PlatformBackend::get_size(&w, &h);
return w;
return get_size().x;
}
int App::height()
{
int w, h;
PlatformBackend::get_size(&w, &h);
return h;
return get_size().y;
}
int App::draw_width()