Playing around with shaders for effects on the scene.

This commit is contained in:
Zed A. Shaw 2025-01-27 11:36:00 -05:00
parent 3519c73079
commit 071808a0f8
8 changed files with 68 additions and 4 deletions

View file

@ -52,6 +52,7 @@ int main() {
Raycaster rayview(window, MAP, RAY_VIEW_WIDTH, RAY_VIEW_HEIGHT);
rayview.set_position(RAY_VIEW_X, RAY_VIEW_Y);
rayview.position_camera(player_x, player_y);
rayview.init_shaders();
double moveSpeed = 0.1;
double rotSpeed = 0.1;
@ -95,6 +96,14 @@ int main() {
stats.reset();
}
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Key::P)) {
if(rayview.$active_shader == nullptr) {
rayview.$active_shader = &rayview.$paused;
} else {
rayview.$active_shader = nullptr;
}
}
if(sf::Mouse::isButtonPressed(sf::Mouse::Button::Left)) {
rayview.$anim.play();
rotation = -30.0f;