Adding benchmark

This commit is contained in:
Dynamitos
2024-07-05 12:02:46 +02:00
parent 8418cdbd11
commit fd8dc5ed0f
47 changed files with 1071 additions and 1010 deletions
+28
View File
@@ -18,3 +18,31 @@ void PlayView::commitUpdate() { GameView::commitUpdate(); }
void PlayView::prepareRender() { GameView::prepareRender(); }
void PlayView::render() { GameView::render(); }
void PlayView::keyCallback(KeyCode code, InputAction action, KeyModifier modifier) {
GameView::keyCallback(code, action, modifier);
if (code == KeyCode::KEY_P && action == InputAction::RELEASE) {
getGlobals().usePositionOnly = !getGlobals().usePositionOnly;
std::cout << "Use Pos only " << getGlobals().usePositionOnly << std::endl;
}
if (code == KeyCode::KEY_O && action == InputAction::RELEASE) {
getGlobals().useDepthCulling = !getGlobals().useDepthCulling;
std::cout << "Use Depth Culling " << getGlobals().useDepthCulling << std::endl;
}
if (code == KeyCode::KEY_L && action == InputAction::RELEASE) {
getGlobals().useLightCulling = !getGlobals().useLightCulling;
std::cout << "Use Light Culling " << getGlobals().useLightCulling << std::endl;
}
if (code == KeyCode::KEY_G && action == InputAction::RELEASE) {
Component::Camera cam;
Component::Transform tra;
scene->view<Component::Camera, Component::Transform>([&cam, &tra](Component::Camera& c, Component::Transform& t) {
if (c.mainCamera) {
tra = t;
cam = c;
}
});
std::cout << cam.getCameraPosition() << std::endl;
std::cout << tra.getRotation() << std::endl;
}
}