In Tier 1, I sincerely doubt that this is possible at all. The interpreter only recognizes the Tier 1 Basic commands.
But, since your code appears to be opening a new window, it might actually work in Tier 2.
First, dbWait is not an AppGameKit command. You would need to try agk::Sleep(length*39);
Next, you would need to create a Tier 2 project and include the code in the first snippet. You might get away with including it in the main file, at least for the initial test.
A simple program like:
#include "template.h"
#include <Windows.h> // must be before Vfw.h
#include <Vfw.h>
#pragma comment ( lib , "Vfw32.lib" )
HWND MCIWnd;UINT length = 0;
void PlayVideo ( HWND hwnd_ParentWindow, LPSTR lpstr, int OriginX, int OriginY, int Width, int Height, UINT* length )
{
MCIWnd = MCIWndCreate ( hwnd_ParentWindow, GetModuleHandle(NULL), WS_CHILD | WS_VISIBLE | MCIWNDF_NOTIFYMODE | MCIWNDF_NOPLAYBAR, NULL );
MCIWndOpen ( MCIWnd, lpstr, NULL ); // new device in window
SetWindowPos ( MCIWnd, HWND_TOPMOST, OriginX, OriginY, Width, Height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
MCIWndPlay ( MCIWnd ); // plays device
if ( length ) *length = MCIWndGetLength ( MCIWnd );
}
using namespace AGK;
app App;
// place for video name
char buf[1028];
void app::Begin(void)
{
// set up the buffer name
strcpy(buf,"some file name, should be in the media directory?");
}
void app::Loop(void)
{
// check for instruction to play video
if (agk::GetPointerPressed())
{
PlayVideo ( g_pGlob->hWnd, buf, 0, 0, 1024, 768, &length );
agk::Sleep( length*39*1000 );
DestroyWindow ( MCIWnd );
}
agk::Sync();
}
void app::End(void)
{
// nothing for the simple case
}
I don't know that this will work, I'm not sure where g_pGlob is coming from.
Cheers,
Ancient Lady
AGK Community Tester