| 
 | 
 
重新修改了引擎的视频播放这块并把视频等几个模块做成了插件的形式具体代码和截图如下: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->//! 本代码测试引擎视频播放,插件系统,键盘测试和立方体绘制 
 
//! 本代码测试引擎视频播放,插件系统,键盘测试和立方体绘制 
#include <iostream> 
#include <GEngine/Header_Config.hpp> 
 
Matrix4f mat; 
float pos[] = {0,0,0}; 
float length[] = {1,1,1}; 
float offset = -500; 
using namespace core; 
void MouseCheck(); 
 
VideoPlayer* video_player_instance = NULL; 
 
int main(int argc,char *argv[]) 
{ 
    ScreenDesc desc; 
    desc.name_ = "VideoPlayerTest"; 
    RefPtr<Screen> screen = CreateScreen(desc); 
 
    GLOBAL_PLUGINMANAGER_PTR->SetPluginFolder("..\\plugin"); 
    GLOBAL_PLUGINMANAGER_PTR->InstallPlugin(); 
 
    VideoPlayerFactory factory; 
    GLOBAL_PLUGINMANAGER_PTR->RegisterPluginFactory(&factory); 
    factory.SetData(1,screen->GetHDC()); 
    factory.SetData(2,screen->GetHGLRC()); 
    video_player_instance = factory.Create(); 
 
    core::TextDesc* text = new core::TextDesc("..\\package\\accid.ttf",12,0,0,3,Color::Cyan); 
    text->SetText(L"maker:gaimosoft,ccsdu2004@yahoo.com.cn"); 
    video_player_instance-> lay("..\\package\\video.mp4"); 
 
    while(screen->IsOpen()) 
    { 
        GLOBAL_RENDERER_PTR->Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
        video_player_instance->Update(); 
        GLOBAL_RENDERER_PTR->AttachThreadRender(); 
        GLOBAL_RENDERER_PTR->Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
        uint id = video_player_instance->GetFrame(); 
        GLOBAL_TEXTUREMANAGER_PTR->BindTexture2(id); 
        GLOBAL_RENDERER_PTR->DrawCube(pos,mat.ptr(),length); 
        UI_Brush: reRender(); 
        text->Render(Rectf(offset,460,400,20)); 
        offset ++; 
        if(offset >= 600) 
           offset = -500; 
        UI_Brush::PostRender(); 
        GLOBAL_RENDERER_PTR->DetachThreadRender(); 
        MouseCheck(); 
    } 
 
    video_player_instance->Stop(); 
    delete text; 
    DestroyScreen(); 
    return EXIT_SUCCESS; 
} 
 
//! 处理鼠标响应 
void MouseCheck() 
{ 
    if(GLOBAL_INPUT_PTR->IsPressedKey(KEY_F1)) 
    { 
        mat*=mat.Rotate((rand()%200)/900.0f,1,0,0); 
    } 
    else if(GLOBAL_INPUT_PTR->IsPressedKey(KEY_F2)) 
    { 
        mat*=mat.Rotate((rand()%200)/900.0f,0,1,0); 
    } 
    else if(GLOBAL_INPUT_PTR->IsPressedKey(KEY_F3)) 
    { 
        mat*=mat.Rotate((rand()%200)/900.0f,0,0,1); 
    } 
} |   
 
 
 
 |