PGR Copakond OpenGL Engine - Bowling
Loading...
Searching...
No Matches
imageSequenceLabel.h
Go to the documentation of this file.
1#ifndef PGR_SEM_COPAKOND_IMAGESEQUENCELABEL_H
2#define PGR_SEM_COPAKOND_IMAGESEQUENCELABEL_H
3
4#include "../mesh.h"
5
6namespace copakond {
8 class ImageSequenceLabel : public Mesh {
9 protected:
10 int _frame = 0;
11 float _frameTime = 0.0f;
12 bool _paused = false;
13
14 int _fps;
18
19 std::vector<float> _uvs;
20 std::vector<float> _normals;
21 GLuint _vboUvs = 0;
22
24 void _generateGeometry();
25
26 public:
27 ImageSequenceLabel(const std::string& imageSequencePath, int fps, int totalFrames, int imagesPerWidth, int imagesPerHeight);
28 ImageSequenceLabel(const std::string& imageSequencePath, int fps, int totalFrames, int imagesPerWidth, int imagesPerHeight, std::shared_ptr<Material> material);
29 ~ImageSequenceLabel() override;
30
31 void init(GLuint shader) override;
32
34 void draw(float deltaTime) override;
35
36 void pause() { _paused = true; }
37 void unpause() { _paused = false; }
38 void setFrame(int frame) { _frame = frame; }
39 };
40}
41
42#endif //PGR_SEM_COPAKOND_IMAGESEQUENCELABEL_H
float _frameTime
Definition imageSequenceLabel.h:11
bool _paused
Definition imageSequenceLabel.h:12
int _totalFrames
Definition imageSequenceLabel.h:15
int _fps
Definition imageSequenceLabel.h:14
void unpause()
Definition imageSequenceLabel.h:37
void setFrame(int frame)
Definition imageSequenceLabel.h:38
ImageSequenceLabel(const std::string &imageSequencePath, int fps, int totalFrames, int imagesPerWidth, int imagesPerHeight)
Definition imageSequenceLabel.cpp:4
std::vector< float > _normals
Definition imageSequenceLabel.h:20
void _generateGeometry()
Recalculates UV mapping to display the current frame from the sprite sheet.
Definition imageSequenceLabel.cpp:35
int _imagesPerHeight
Definition imageSequenceLabel.h:17
~ImageSequenceLabel() override
Definition imageSequenceLabel.cpp:31
GLuint _vboUvs
Definition imageSequenceLabel.h:21
int _frame
Definition imageSequenceLabel.h:10
int _imagesPerWidth
Definition imageSequenceLabel.h:16
std::vector< float > _uvs
Definition imageSequenceLabel.h:19
void pause()
Definition imageSequenceLabel.h:36
Mesh()
Definition mesh.cpp:12
PGR Semestral work with sample scenes and bowling. doxygen was generated with a help of LLM.
Definition bezier.cpp:3
Shader * shader
Definition main.cpp:37
void init()
Initializes OpenGL context, scene data, and sets up GLUT callbacks.
Definition main.cpp:42
void draw()
Main render loop. Handles updates, physics, and rendering of all scene elements.
Definition main.cpp:97