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
11
animator.hpp
11
animator.hpp
|
@ -1,14 +1,25 @@
|
|||
#pragma once
|
||||
#include <SFML/Graphics/Sprite.hpp>
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <string>
|
||||
|
||||
struct Animator {
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
int max_frames = 0;
|
||||
sf::SoundBuffer buffer;
|
||||
sf::Sound sound;
|
||||
size_t count = 0;
|
||||
int frame = 0;
|
||||
bool playing = false;
|
||||
|
||||
Animator(int w, int h, int max, std::string sound_file) :
|
||||
width(w), height(h), max_frames(max),
|
||||
buffer(sound_file),
|
||||
sound(buffer)
|
||||
{
|
||||
}
|
||||
|
||||
void step(sf::Sprite& sprite, int rect_x, int rect_y, int rect_w, int rect_h);
|
||||
|
||||
void play();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue