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

@ -44,7 +44,9 @@ struct Raycaster {
std::vector<int> spriteOrder;
std::vector<double> spriteDistance;
std::vector<double> ZBuffer; // width
Animator $anim{256, 256, 10, 0};
Animator $anim;
sf::Shader $paused;
sf::Shader* $active_shader = nullptr;
Raycaster(sf::RenderWindow& window, Matrix &map, int width, int height);
@ -63,6 +65,8 @@ struct Raycaster {
void position_camera(float player_x, float player_y);
void set_position(int x, int y);
void init_shaders();
inline size_t pixcoord(int x, int y) {
if(!(x >=0 && x < $width)) {
dbc::sentinel(fmt::format("pixcoord x={} but $width={}", x, $width));