I want to make the display support SDL so we can play a lot of games and make app based on SDL2.
PS: I love DOS games 🙂
SDL2 supports directFB which is not maintained anymore.
So I am consider to write a video driver for my display.
In SDL source code, SDL_DirectFB_video.c, we can get every interface:
/* Set the function pointers */ device->VideoInit = DirectFB_VideoInit; device->VideoQuit = DirectFB_VideoQuit; device->GetDisplayModes = DirectFB_GetDisplayModes; device->SetDisplayMode = DirectFB_SetDisplayMode; device->PumpEvents = DirectFB_PumpEventsWindow; device->CreateSDLWindow = DirectFB_CreateWindow; device->CreateSDLWindowFrom = DirectFB_CreateWindowFrom; device->SetWindowTitle = DirectFB_SetWindowTitle; device->SetWindowIcon = DirectFB_SetWindowIcon; device->SetWindowPosition = DirectFB_SetWindowPosition; device->SetWindowSize = DirectFB_SetWindowSize; device->SetWindowOpacity = DirectFB_SetWindowOpacity; device->ShowWindow = DirectFB_ShowWindow; device->HideWindow = DirectFB_HideWindow; device->RaiseWindow = DirectFB_RaiseWindow; device->MaximizeWindow = DirectFB_MaximizeWindow; device->MinimizeWindow = DirectFB_MinimizeWindow; device->RestoreWindow = DirectFB_RestoreWindow; device->SetWindowGrab = DirectFB_SetWindowGrab; device->DestroyWindow = DirectFB_DestroyWindow; device->GetWindowWMInfo = DirectFB_GetWindowWMInfo; /* !!! FIXME: implement SetWindowBordered */ #if SDL_DIRECTFB_OPENGL device->GL_LoadLibrary = DirectFB_GL_LoadLibrary; device->GL_GetProcAddress = DirectFB_GL_GetProcAddress; device->GL_MakeCurrent = DirectFB_GL_MakeCurrent; device->GL_CreateContext = DirectFB_GL_CreateContext; device->GL_SetSwapInterval = DirectFB_GL_SetSwapInterval; device->GL_GetSwapInterval = DirectFB_GL_GetSwapInterval; device->GL_SwapWindow = DirectFB_GL_SwapWindow; device->GL_DeleteContext = DirectFB_GL_DeleteContext; #endif /* Shaped window support */ device->shape_driver.CreateShaper = DirectFB_CreateShaper; device->shape_driver.SetWindowShape = DirectFB_SetWindowShape; device->shape_driver.ResizeWindowShape = DirectFB_ResizeWindowShape; device->free = DirectFB_DeleteDevice;
Of course, I do not think VoCore2 can run OpenGL, because it do not have any video hardware, ignore that.
PS: mesa3d has a software mode but it must be very slow. 🙂
To be simple, we do not need shaped window support either…
OK, rest interfaces for windows look like necessary, every video driver has them.
So they are VideoInit/Quit, Get/SetDisplayModes, CreateSDLWindow/From, SetWindowTitle/Icon/Position/Size, Show/Hide/Raise/Maximize/Minimize/Restore/DestroyWindow.
But it still need to code a lot…
I find most of the interfaces are empty in its psp video driver, maybe there is a way to make everything simple.
Any good idea?
TO BE CONTINUE…