JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Video Class Reference

Ogg Theory video file. More...

#include <jngl/Video.hpp>

Public Member Functions

 Video (const std::string &filename)
 Opens OGG Theora video specified by filename.
 
 Video (const Video &)=delete
 
Videooperator= (const Video &)=delete
 
 Video (Video &&)=delete
 
Videooperator= (Video &&)=delete
 
void draw () const
 Starts playback if needed and draws the current video frame centered at {0, 0}.
 
int getWidth () const
 Returns the actual pixel width of the video.
 
int getHeight () const
 Returns the actual pixel height of the video.
 
bool finished () const
 Returns true when the video has reached the end.
 

Detailed Description

Ogg Theory video file.

Example:

#include <jngl.hpp>
JNGL_MAIN_BEGIN {
const auto filename = jngl::getArgs().at(0);
jngl::Video video(filename);
jngl::showWindow(filename, video.getWidth(), video.getHeight());
while (jngl::running()) {
video.draw();
}
} JNGL_MAIN_END
Ogg Theory video file.
Definition: Video.hpp:28
Includes all JNGL headers except for init.hpp.
void showWindow(const std::string &title, int width, int height, bool fullscreen=false, std::pair< int, int > minAspectRatio={ 4, 3 }, std::pair< int, int > maxAspectRatio={ 16, 9 })
Creates the main window.
void swapBuffers()
Swaps back and front buffer.
bool running()
Returns true until the main window is closed or quit() has been called.
std::vector< std::string > getArgs()
Returns the command line arguments passed to the executable.
void updateInput()
Updates the input state.

Definition at line 28 of file Video.hpp.


The documentation for this class was generated from the following file: