Playing around with shaders for effects on the scene.
This commit is contained in:
parent
3519c73079
commit
071808a0f8
8 changed files with 68 additions and 4 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue