diff --git a/reactos/drivers/video/displays/framebuf/dd.c b/reactos/drivers/video/displays/framebuf/dd.c new file mode 100644 index 00000000000..4cc7bb88ba2 --- /dev/null +++ b/reactos/drivers/video/displays/framebuf/dd.c @@ -0,0 +1,24 @@ +/* + * ReactOS Generic Framebuffer display driver directdraw interface + * + * Copyright (C) 2006 Magnus Olsen + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* Here we put in all 2d api for directdraw and redirect some of them to GDI api */ + +#include "framebuf.h" + diff --git a/reactos/drivers/video/displays/framebuf/ddenable.c b/reactos/drivers/video/displays/framebuf/ddenable.c new file mode 100644 index 00000000000..fbc739ca9bb --- /dev/null +++ b/reactos/drivers/video/displays/framebuf/ddenable.c @@ -0,0 +1,82 @@ +/* + * ReactOS Generic Framebuffer display driver directdraw interface + * + * Copyright (C) 2006 Magnus Olsen + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "framebuf.h" + +VOID DDKAPI +DrvDisableDirectDraw( IN DHPDEV dhpdev) +{ + PPDEV ppdev = (PPDEV)dhpdev; + ppdev->bDDInitialized = FALSE; + /* Add Clean up code here if we need it + when we shout down directx interface */ +} + +BOOL DDKAPI +DrvEnableDirectDraw( + IN DHPDEV dhpdev, + OUT DD_CALLBACKS *pCallBacks, + OUT DD_SURFACECALLBACKS *pSurfaceCallBacks, + OUT DD_PALETTECALLBACKS *pPaletteCallBacks) +{ + PPDEV ppdev = (PPDEV)dhpdev; + + if (ppdev->bDDInitialized == TRUE) + { + return TRUE; + } + + if (pCallBacks !=NULL) + { + memset(pCallBacks,0,sizeof(DD_CALLBACKS)); + + /* FILL pCallBacks with hal stuff */ + } + + if (pSurfaceCallBacks !=NULL) + { + memset(pSurfaceCallBacks,0,sizeof(DD_SURFACECALLBACKS)); + + /* FILL pSurfaceCallBacks with hal stuff */ + } + + if (pPaletteCallBacks !=NULL) + { + memset(pPaletteCallBacks,0,sizeof(DD_PALETTECALLBACKS)); + + /* FILL pPaletteCallBacks with hal stuff */ + } + + ppdev->bDDInitialized = TRUE; + return ppdev->bDDInitialized; +} + +BOOL DDKAPI +DrvGetDirectDrawInfo( + IN DHPDEV dhpdev, + OUT DD_HALINFO *pHalInfo, + OUT DWORD *pdwNumHeaps, + OUT VIDEOMEMORY *pvmList, + OUT DWORD *pdwNumFourCCCodes, + OUT DWORD *pdwFourCC) +{ + return FALSE; +} + diff --git a/reactos/drivers/video/displays/framebuf/enable.c b/reactos/drivers/video/displays/framebuf/enable.c index 05d1b1bda5b..68a9daa383f 100644 --- a/reactos/drivers/video/displays/framebuf/enable.c +++ b/reactos/drivers/video/displays/framebuf/enable.c @@ -31,7 +31,12 @@ static DRVFN DrvFunctionTable[] = {INDEX_DrvGetModes, (PFN)DrvGetModes}, {INDEX_DrvSetPalette, (PFN)DrvSetPalette}, {INDEX_DrvSetPointerShape, (PFN)DrvSetPointerShape}, - {INDEX_DrvMovePointer, (PFN)DrvMovePointer} + {INDEX_DrvMovePointer, (PFN)DrvMovePointer}, + {INDEX_DrvGetDirectDrawInfo, (PFN) DrvGetDirectDrawInfo }, + {INDEX_DrvEnableDirectDraw, (PFN) DrvEnableDirectDraw }, + {INDEX_DrvDisableDirectDraw, (PFN) DrvDisableDirectDraw } + + }; /* diff --git a/reactos/drivers/video/displays/framebuf/framebuf.h b/reactos/drivers/video/displays/framebuf/framebuf.h index b6a028aa679..cf9ebfe9c57 100644 --- a/reactos/drivers/video/displays/framebuf/framebuf.h +++ b/reactos/drivers/video/displays/framebuf/framebuf.h @@ -52,7 +52,7 @@ typedef struct _PDEV PVOID ScreenPtr; HPALETTE DefaultPalette; PALETTEENTRY *PaletteEntries; - + #ifdef EXPERIMENTAL_MOUSE_CURSOR_SUPPORT VIDEO_POINTER_ATTRIBUTES PointerAttributes; XLATEOBJ *PointerXlateObject; @@ -61,6 +61,9 @@ typedef struct _PDEV HSURF PointerSaveSurface; POINTL PointerHotSpot; #endif + + /* DirectX Support */ + BOOL bDDInitialized; } PDEV, *PPDEV; #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) @@ -68,6 +71,29 @@ typedef struct _PDEV #define DEVICE_NAME L"framebuf" #define ALLOC_TAG TAG('F','B','U','F') +VOID STDCALL +DrvDisableDirectDraw( + IN DHPDEV dhpdev); + + +BOOL STDCALL +DrvEnableDirectDraw( + IN DHPDEV dhpdev, + OUT DD_CALLBACKS *pCallBacks, + OUT DD_SURFACECALLBACKS *pSurfaceCallBacks, + OUT DD_PALETTECALLBACKS *pPaletteCallBacks); + + +BOOL STDCALL +DrvGetDirectDrawInfo( + IN DHPDEV dhpdev, + OUT DD_HALINFO *pHalInfo, + OUT DWORD *pdwNumHeaps, + OUT VIDEOMEMORY *pvmList, + OUT DWORD *pdwNumFourCCCodes, + OUT DWORD *pdwFourCC); + + DHPDEV STDCALL DrvEnablePDEV( IN DEVMODEW *pdm, @@ -157,4 +183,7 @@ IntSetPalette( IN ULONG iStart, IN ULONG cColors); + + #endif /* FRAMEBUF_H */ + diff --git a/reactos/drivers/video/displays/framebuf/framebuf.rbuild b/reactos/drivers/video/displays/framebuf/framebuf.rbuild index f808f09c9ca..9db0ec772ac 100644 --- a/reactos/drivers/video/displays/framebuf/framebuf.rbuild +++ b/reactos/drivers/video/displays/framebuf/framebuf.rbuild @@ -9,5 +9,7 @@ pointer.c screen.c surface.c + ddenable.c + dd.c framebuf.rc