Start adding basic directdraw hal 2d interface, so we have a directdraw hal interface...
authorMagnus Olsen <magnus@greatlord.com>
Sun, 16 Jul 2006 11:46:30 +0000 (11:46 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 16 Jul 2006 11:46:30 +0000 (11:46 +0000)
svn path=/trunk/; revision=23072

reactos/drivers/video/displays/framebuf/dd.c [new file with mode: 0644]
reactos/drivers/video/displays/framebuf/ddenable.c [new file with mode: 0644]
reactos/drivers/video/displays/framebuf/enable.c
reactos/drivers/video/displays/framebuf/framebuf.h
reactos/drivers/video/displays/framebuf/framebuf.rbuild

diff --git a/reactos/drivers/video/displays/framebuf/dd.c b/reactos/drivers/video/displays/framebuf/dd.c
new file mode 100644 (file)
index 0000000..4cc7bb8
--- /dev/null
@@ -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 (file)
index 0000000..fbc739c
--- /dev/null
@@ -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;
+}
+
index 05d1b1b..68a9daa 100644 (file)
@@ -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 }  
+   
+  
 };
 
 /*
index b6a028a..cf9ebfe 100644 (file)
@@ -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 */
+
index f808f09..9db0ec7 100644 (file)
@@ -9,5 +9,7 @@
        <file>pointer.c</file>
        <file>screen.c</file>
        <file>surface.c</file>
+      <file>ddenable.c</file>
+      <file>dd.c</file>
        <file>framebuf.rc</file>
 </module>