标签:sdl opengl direct3d gdi 源代码
本文简单总结一下SDL显示视频的源代码。SDL_Window:代表了窗口上述几个结构体之间的关系如下图所示。
SDL_Renderer:代表了渲染器
SDL_Texture:代表了纹理
SDL_Rect:一个矩形框,用于确定纹理显示的位置。
PS:该图源自于文章《最简单的基于FFMPEG+SDL的视频播放器 ver2 (采用SDL2.0)》
SDL显示视频的流程如下图所示。
PS:白色背景函数为SDL的API;蓝色背景的函数为Win32的API;紫色背景的函数Direct3D的API。
更清晰的图片链接(右键保存):http://my.csdn.net/leixiaohua1020/album/detail/1795753
CreateWindow()
SetWindowText()
ShowWindow()
SetWindowPos()
Direct3DCreate9()
IDirect3D9_GetDeviceCaps()
IDirect3D9_CreateDevice()
IDirect3DDevice9_SetFVF()
IDirect3DDevice9_SetRenderState()
IDirect3DDevice9_SetTextureStageState()
IDirect3DDevice9_SetTransform()
IDirect3DDevice9_CreatePixelShader()
IDirect3DDevice9_CreateTexture()
IDirect3DTexture9_LockRect()
memcpy():这个不算D3D的,用于拷贝像素数据。
IDirect3DTexture9_UnlockRect()
IDirect3DDevice9_BeginScene()
IDirect3DDevice9_SetRenderState()
IDirect3DDevice9_SetSamplerState()
IDirect3DDevice9_SetTexture()
IDirect3DDevice9_SetPixelShader()
IDirect3DDevice9_DrawPrimitiveUP()
IDirect3DDevice9_EndScene()
IDirect3DDevice9_Present()
更清晰的图片链接(右键保存):http://my.csdn.net/leixiaohua1020/album/detail/1795755
CreateWindow()
SetWindowText()
ShowWindow()
SetWindowPos()
glCreateProgramObject()
glCreateShaderObject()
glShaderSource()
glCompileShader()
GetObjectParameteriv()
AttachObject()
LinkProgram()
UseProgramObject()
glGenTextures()
glBindTexture()
glTexParameteri()
glTexImage2D()
glBindTexture()
glTexSubImage2D()
glActiveTexture()
glBindTexture()
SwapBuffers()
CreateWindow()
SetWindowText()
ShowWindow()
SetWindowPos()
CreateCompatibleBitmap()
GetDIBits()
CreateCompatibleDC()
CreateDIBSection()
SelectObject()
BitBlt()
标签:sdl opengl direct3d gdi 源代码
原文地址:http://blog.csdn.net/leixiaohua1020/article/details/41207787