JNGL
Video.hpp
Go to the documentation of this file.
1 // Copyright 2018-2019 Jan Niklas Hasse <[email protected]>
2 // For conditions of distribution and use, see copyright notice in LICENSE.txt
4 #pragma once
5 
6 #include "sprite.hpp"
7 
8 #include <memory>
9 #include <string>
10 
11 namespace jngl {
12 
30 class Video {
31 public:
33  explicit Video(const std::string& filename);
34  Video(const Video&) = delete;
35  Video& operator=(const Video&) = delete;
36  Video(Video&&) = delete;
37  Video& operator=(Video&&) = delete;
38  ~Video();
39 
41  void draw() const;
42 
44  [[nodiscard]] int getWidth() const;
45 
47  [[nodiscard]] int getHeight() const;
48 
50  [[nodiscard]] bool finished() const;
51 
52 private:
53  class Impl;
54 
56 };
57 
58 } // namespace jngl
std::string
jngl::Video
Ogg Theory video file.
Definition: Video.hpp:30
jngl
JNGL's main namespace.
Definition: App.hpp:9
jngl::Video::finished
bool finished() const
Returns true when the video has reached the end.
jngl::Video::getHeight
int getHeight() const
Returns the actual pixel height of the video.
jngl::Video::draw
void draw() const
Starts playback if needed and draws the current video frame centered at {0, 0}.
memory
jngl::Video::Video
Video(const std::string &filename)
Opens OGG Theora video specified by filename.
std::unique_ptr< Impl >
sprite.hpp
Contains jngl::Sprite class and related functions.
jngl::Video::getWidth
int getWidth() const
Returns the actual pixel width of the video.
string