JNGL
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

Definition at line 30 of file Video.hpp.


The documentation for this class was generated from the following file:
jngl::Video
Ogg Theory video file.
Definition: Video.hpp:30
jngl::getArgs
std::vector< std::string > getArgs()
Returns the command line arguments passed to the executable.
jngl.hpp
Includes jngl/all.hpp.
jngl::running
bool running()
Returns true until the main window is closed or quit() has been called.
jngl::showWindow
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.
jngl::updateInput
void updateInput()
Updates the input state. App::mainLoop() calls this before Work::step()
jngl::swapBuffers
void swapBuffers()
Swaps back and front buffer. App::mainLoop() calls this after Work::draw()