mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Add initial video playback support for Ogg Theora videos (resolves issue #66.)
The basic APIs are:
video = love.graphics.newVideo("myvideo.ogv")
love.graphics.draw(video, ...) -- Video objects are Drawables.
video:play(), video:pause()
video:getDuration(), video:tell(), video:rewind(), video:seek(seconds)
video:getSource()
video:getWidth(), video:getHeight(), video:setFilter(min, mag)
More advanced APIs include video:setSource(source), video:getStream(), and videostream:setSync.
To use a custom pixel shader when drawing a Video, call the new TexelVideo(texcoords) function instead of Texel(texture, texcoords) in order to get the pixel colors of a video frame.
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
|
||||
#include "window/Window.h"
|
||||
|
||||
#include "video/VideoStream.h"
|
||||
|
||||
#include "Font.h"
|
||||
#include "Image.h"
|
||||
#include "graphics/Quad.h"
|
||||
@@ -47,6 +49,7 @@
|
||||
#include "Shader.h"
|
||||
#include "Mesh.h"
|
||||
#include "Text.h"
|
||||
#include "Video.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -185,6 +188,8 @@ public:
|
||||
|
||||
Text *newText(Font *font, const std::vector<Font::ColoredString> &text = {});
|
||||
|
||||
Video *newVideo(love::video::VideoStream *stream);
|
||||
|
||||
bool isGammaCorrect() const;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user