JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Video.hpp
Go to the documentation of this file.
1// Copyright 2018-2023 Jan Niklas Hasse <jhasse@bixense.com>
2// For conditions of distribution and use, see copyright notice in LICENSE.txt
4#pragma once
5
6#include <memory>
7#include <string>
8
9namespace jngl {
10
28class Video {
29public:
31 explicit Video(const std::string& filename);
32 Video(const Video&) = delete;
33 Video& operator=(const Video&) = delete;
34 Video(Video&&) = delete;
35 Video& operator=(Video&&) = delete;
36 ~Video();
37
39 void draw() const;
40
42 [[nodiscard]] int getWidth() const;
43
45 [[nodiscard]] int getHeight() const;
46
48 [[nodiscard]] bool finished() const;
49
50private:
51 class Impl;
52
54};
55
56} // namespace jngl
Ogg Theory video file.
Definition Video.hpp:28
void draw() const
Starts playback if needed and draws the current video frame centered at {0, 0}.
int getHeight() const
Returns the actual pixel height of the video.
Video(const std::string &filename)
Opens OGG Theora video specified by filename.
int getWidth() const
Returns the actual pixel width of the video.
bool finished() const
Returns true when the video has reached the end.
JNGL's main namespace.