[turbine] Make accessor functions take const ref to Context
Some checks are pending
Build / build (push) Waiting to run

This commit is contained in:
Gary Talent 2025-04-12 13:48:24 -05:00
parent f9512d72e8
commit c0e96216ae
3 changed files with 12 additions and 12 deletions

View File

@ -33,15 +33,15 @@ void setWindowTitle(Context &ctx, ox::StringViewCR title) noexcept;
void focusWindow(Context &ctx) noexcept; void focusWindow(Context &ctx) noexcept;
[[nodiscard]] [[nodiscard]]
int getScreenWidth(Context &ctx) noexcept; int getScreenWidth(Context const &ctx) noexcept;
[[nodiscard]] [[nodiscard]]
int getScreenHeight(Context &ctx) noexcept; int getScreenHeight(Context const &ctx) noexcept;
[[nodiscard]] [[nodiscard]]
ox::Size getScreenSize(Context &ctx) noexcept; ox::Size getScreenSize(Context const &ctx) noexcept;
ox::Bounds getWindowBounds(Context &ctx) noexcept; ox::Bounds getWindowBounds(Context const &ctx) noexcept;
ox::Error setWindowBounds(Context &ctx, ox::Bounds const&bnds) noexcept; ox::Error setWindowBounds(Context &ctx, ox::Bounds const&bnds) noexcept;

View File

@ -27,19 +27,19 @@ ox::Error initGfx(Context&) noexcept {
void setWindowTitle(Context&, ox::StringViewCR) noexcept { void setWindowTitle(Context&, ox::StringViewCR) noexcept {
} }
int getScreenWidth(Context&) noexcept { int getScreenWidth(Context const&) noexcept {
return 240; return 240;
} }
int getScreenHeight(Context&) noexcept { int getScreenHeight(Context const&) noexcept {
return 160; return 160;
} }
ox::Size getScreenSize(Context&) noexcept { ox::Size getScreenSize(Context const&) noexcept {
return {240, 160}; return {240, 160};
} }
ox::Bounds getWindowBounds(Context&) noexcept { ox::Bounds getWindowBounds(Context const&) noexcept {
return {0, 0, 240, 160}; return {0, 0, 240, 160};
} }

View File

@ -272,25 +272,25 @@ void focusWindow(Context &ctx) noexcept {
glfwFocusWindow(ctx.window); glfwFocusWindow(ctx.window);
} }
int getScreenWidth(Context &ctx) noexcept { int getScreenWidth(Context const &ctx) noexcept {
int w = 0, h = 0; int w = 0, h = 0;
glfwGetFramebufferSize(ctx.window, &w, &h); glfwGetFramebufferSize(ctx.window, &w, &h);
return w; return w;
} }
int getScreenHeight(Context &ctx) noexcept { int getScreenHeight(Context const &ctx) noexcept {
int w = 0, h = 0; int w = 0, h = 0;
glfwGetFramebufferSize(ctx.window, &w, &h); glfwGetFramebufferSize(ctx.window, &w, &h);
return h; return h;
} }
ox::Size getScreenSize(Context &ctx) noexcept { ox::Size getScreenSize(Context const &ctx) noexcept {
int w = 0, h = 0; int w = 0, h = 0;
glfwGetFramebufferSize(ctx.window, &w, &h); glfwGetFramebufferSize(ctx.window, &w, &h);
return {w, h}; return {w, h};
} }
ox::Bounds getWindowBounds(Context &ctx) noexcept { ox::Bounds getWindowBounds(Context const &ctx) noexcept {
ox::Bounds bnds; ox::Bounds bnds;
glfwGetWindowPos(ctx.window, &bnds.x, &bnds.y); glfwGetWindowPos(ctx.window, &bnds.x, &bnds.y);
glfwGetWindowSize(ctx.window, &bnds.width, &bnds.height); glfwGetWindowSize(ctx.window, &bnds.width, &bnds.height);