Removed some agame things; Added VSYNC

This commit is contained in:
2026-03-18 08:44:30 +01:00
parent def737316c
commit e4004bbfe8
16 changed files with 354 additions and 77 deletions

View File

@@ -17,6 +17,11 @@ namespace Game::AGame {
LOG("W: " << w << " H: " << h);
mTransform.x = w / 2.f - (w / 3.f);
mTransform.y = 0.f;
mTransform.scaleX = 1.f;
mTransform.scaleY = 1.f;
mSound.~Sound();
}
@@ -38,4 +43,10 @@ namespace Game::AGame {
//Object::Camera::getInstance().move(1.f, 0.f);
}
void Background::onWindowResized(int newWidth, int newHeight) {
// Re-center the background on window resize
mTransform.x = newWidth / 2.f - (newWidth / 3.f);
mTransform.y = 0.f;
}
}

View File

@@ -1,20 +0,0 @@
#include <game/agame/camcontroller.hpp>
#include <window/window.hpp>
#include <cmath>
#include <object/camera.hpp>
#include <state/gamestate.hpp>
#include <game/input.hpp>
namespace Game::AGame {
void CamController::start() {
mTex = nullptr; // No texture
SDL_GetWindowSizeInPixels(Window::Window::getSDLWindowBackend(), &mScreenW, &mScreenH);
mTransform.x = 0.f;
mTransform.y = 0.f;
}
void CamController::update(float deltaTime) {
if (!mIsActive) return;
}
}

View File

@@ -2,14 +2,16 @@
#include <window/window.hpp>
#include <cmath>
#include <game/input.hpp>
#include <game/gamemanager.hpp>
namespace Game::AGame {
void Player::start() {
//mSound = Object::Sound("../resources/example.wav", Object::Format::WAV);
//mSound.play();
mZIndex = 100;
Game::GameManager::setSharedData("gameStage", 1);
Game::GameManager::setSharedData("gameScore", 0);
int w, h;
SDL_GetWindowSizeInPixels(Window::Window::getSDLWindowBackend(), &w, &h);
@@ -17,7 +19,6 @@ namespace Game::AGame {
mTransform.y -= mTex->getHeight() * mTransform.adjustedScaleY() / 2.f;
LOG("W: " << w << " H: " << h);
//mSound.~Sound();
}