LOVE video support

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
vt007
Prole
Posts: 14
Joined: Sun Oct 30, 2011 4:01 am

LOVE video support

Post by vt007 »

Is there any APIs, so LOVE could read videos. (of any format)

OR

if its a dead end question,
how can i merge LOVE with SDL? (i program in C under CODEBLOCKS too)
At least would be great to use the old buggy SDL_ffmpeg... ^^

Thx for helping out ^^
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: LOVE video support

Post by TechnoCat »

vt007 wrote:how can i merge LOVE with SDL? (i program in C under CODEBLOCKS too)
At least would be great to use the old buggy SDL_ffmpeg... ^^
https://bitbucket.org/rude/love/src/9bc ... .cpp#cl-39
vt007
Prole
Posts: 14
Joined: Sun Oct 30, 2011 4:01 am

Re: LOVE video support

Post by vt007 »

Code: Select all


// Modules
#include <audio/wrap_Audio.h>
#include <event/sdl/wrap_Event.h>
#include <filesystem/physfs/wrap_Filesystem.h>
#include <font/freetype/wrap_Font.h>
#include <graphics/opengl/wrap_Graphics.h>
#include <image/wrap_Image.h>
#include <joystick/sdl/wrap_Joystick.h>
#include <keyboard/wrap_Keyboard.h>
#include <mouse/wrap_Mouse.h>
#include <physics/box2d/wrap_Physics.h>
#include <sound/wrap_Sound.h>
#include <timer/wrap_Timer.h>
#include <thread/wrap_Thread.h>

// Libraries.
#include "libraries/luasocket/luasocket.h"

// Scripts
#include "scripts/boot.lua.h"

#endif // LOVE_BUILD_EXE

#ifdef LOVE_BUILD_STANDALONE

static const luaL_Reg modules[] = {
        { "love.audio", love::audio::luaopen_love_audio },
        { "love.event", love::event::sdl::luaopen_love_event },
        { "love.filesystem", love::filesystem::physfs::luaopen_love_filesystem },
        { "love.font", love::font::freetype::luaopen_love_font },
        { "love.graphics", love::graphics::opengl::luaopen_love_graphics },
        { "love.image", love::image::luaopen_love_image },
        { "love.joystick", love::joystick::sdl::luaopen_love_joystick },
        { "love.keyboard", love::keyboard::luaopen_love_keyboard },
        { "love.mouse", love::mouse::luaopen_love_mouse },
        { "love.physics", love::physics::box2d::luaopen_love_physics },
        { "love.sound", love::sound::luaopen_love_sound },
        { "love.timer", love::timer::luaopen_love_timer },
        { "love.thread", love::thread::luaopen_love_thread },
        { 0, 0 }
};

#endif // LOVE_BUILD_STANDALONE

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <string.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_framerate.h> //sdl GFX
#include <SDL/SDL_rotozoom.h> //sdl GFX
#include <SDL/SDL_mixer.h>
#include <SDL/SDL_ffmpeg.h>

// Headers
#include "define.h"

int main(int argc, char** argv)
{
    int [...]

    FPSmanager manager;
    SDL_initFramerate(&manager);
    SDL_setFramerate(&manager,60);

    SDL_Init(SDL_INIT_VIDEO);
    SDL_WM_SetCaption("demo", NULL);
    screen = SDL_SetVideoMode(800,600, 32, SDL_HWSURFACE |SDL_DOUBLEBUF /*|SDL_FULLSCREEN*/);

    while(continue1)
    {

        while(SDL_PollEvent(&event))
        {
            SDL_PollEvent(&event);
            switch(event.type)
            {
            case SDL_QUIT:
                continue1 = 0;
                break;
            case SDL_KEYDOWN:
                switch(event.key.keysym.sym)
                {
                case SDLK_ESCAPE:
                    continue1 = 0;
                    break;
            };//switch(event.type)
        }//pollevent's while

        SDL_PollEvent(&event);

[...] //MY STUFF 

        SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
        SDL_Flip(screen);
        SDL_framerateDelay(&manager);

    }//while(continue1)

    SDL_Quit();
    return 0;
}


So this should work?
And how does Compiler(codeblocks in my case :) will see the difference betwen two languages?
Do i have to use any specific syntaxes?...

thx again for helping me out ^^
Post Reply

Who is online

Users browsing this forum: No registered users and 77 guests