示例#1
0
文件: AVI.cpp 项目: DCubix/1.4.0
bool CAvi::Load( LPCWSTR szFile )
{
	m_data = NULL;
	m_hDC = CreateCompatibleDC(0);
	if( !m_hDC )
	{ 
		MessageBox( NULL, _T("Couldn't find the device context to play the CAvi file."), _T("VandaEngine Error"), MB_OK | MB_ICONERROR );
		return 0;
	}
	m_hdd = DrawDibOpen();
	if( !m_hdd )
	{
		MessageBox( NULL, _T("Couldn't find HDD to initialize CAvi file."), _T("VandaEngine Error"), MB_OK | MB_ICONERROR );
		return 0;
	}
    if( !OpenAVI( szFile ) ) 
		return 0;

	glGenTextures( 1, &m_textureId );
	glBindTexture( GL_TEXTURE_2D, m_textureId ); 

	glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
	glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
	glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 1024, 512, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, m_data );
	m_loaded = true;
	return 1;
}
示例#2
0
/*
---------------------------------------------------------------------------------------
- load function
---------------------------------------------------------------------------------------
*/
void AviVideoRenderer::Load(const std::string & filename)
{
	CloseAVI();

	_AVR_hdd = DrawDibOpen();


	// Open The AVI File
	_video_opened = OpenAVI(filename.c_str());

	_lastFrame = -1;
	_firstTime = true;
}
示例#3
0
void AVIOBJ::load(HANDLE hFile)
{
    load_object_basics(this);
    load_property("avi-file",P_STRING,avifile);
    load_property("wnd-top",P_INT,&top);
    load_property("wnd-bottom",P_INT,&bottom);
    load_property("wnd-left",P_INT,&left);
    load_property("wnd-right",P_INT,&right);

    if (strcmp(avifile,"none"))
    {
        char szFileName[MAX_PATH] = "";
        strcpy(szFileName,avifile);
        if (!OpenAVI (szFileName))
        {
            strcpy(szFileName,"could not Open AVI-File: ");
            strcat(szFileName,avifile);
            report_error ( szFileName);
        }
    }
    MoveWindow(displayWnd,left,top,right-left,bottom-top,TRUE);
}