ReactOS 0.4.16-dev-297-gc569aee
dd.c File Reference
#include "framebuf.h"
Include dependency graph for dd.c:

Go to the source code of this file.

Functions

DWORD CALLBACK DdCanCreateSurface (LPDDHAL_CANCREATESURFACEDATA pccsd)
 
DWORD CALLBACK DdCreateSurface (PDD_CREATESURFACEDATA pcsd)
 

Function Documentation

◆ DdCanCreateSurface()

DWORD CALLBACK DdCanCreateSurface ( LPDDHAL_CANCREATESURFACEDATA  pccsd)

Definition at line 26 of file dd.c.

27{
28
29 /* We do not support 3d buffer so we fail here */
30 if ((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) &&
31 (pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
32 {
35 }
36
37
38 /* Check if another pixel format or not, we fail for now */
39 if (pccsd->bIsDifferentPixelFormat)
40 {
41 /* check the fourcc diffent FOURCC, but we only support BMP for now */
42 //if(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & DDPF_FOURCC)
43 //{
44 // /* We do not support other pixel format */
45 // switch (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC)
46 // {
47 // default:
48 // pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT;
49 // return DDHAL_DRIVER_HANDLED;
50 // }
51 //}
52 // /* check the texture support, we do not support testure for now */
53 //else if((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_TEXTURE))
54 //{
55 // /* We do not support texture surface */
56 // pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT;
57 // return DDHAL_DRIVER_HANDLED;
58 //}
59
60 /* Fail */
63 }
64
65 pccsd->ddRVal = DD_OK;
67}
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
#define DDSCAPS_ZBUFFER
Definition: ddraw.h:267
#define DDERR_INVALIDPIXELFORMAT
Definition: ddraw.h:80
#define DD_OK
Definition: ddraw.h:186
#define DDSCAPS_VIDEOMEMORY
Definition: ddraw.h:264
LPDDSURFACEDESC lpDDSurfaceDesc
Definition: ddrawi.h:785

Referenced by DrvEnableDirectDraw().

◆ DdCreateSurface()

DWORD CALLBACK DdCreateSurface ( PDD_CREATESURFACEDATA  pcsd)

Definition at line 70 of file dd.c.

71{
72 int i;
73
74 if (pcsd->dwSCnt < 1)
75 {
76 pcsd->ddRVal = DDERR_GENERIC;
78 }
79
80
81 for (i=0; i<(int)pcsd->dwSCnt; i++)
82 {
83 pcsd->lplpSList[i]->lpGbl->lPitch = (DWORD)(pcsd->lplpSList[i]->lpGbl->wWidth *
85
86 pcsd->lplpSList[i]->lpGbl->dwBlockSizeX = pcsd->lplpSList[i]->lpGbl->lPitch *
87 (DWORD)(pcsd->lplpSList[i]->lpGbl->wHeight);
88
89 pcsd->lplpSList[i]->lpGbl->dwBlockSizeY = 1;
90
92 {
93 /* We maybe should alloc it with EngAlloc
94 for now we trusting ddraw alloc it */
95 pcsd->lplpSList[i]->lpGbl->fpVidMem = 0;
96 }
97 else
98 {
99
100 /* We maybe should alloc it with EngAlloc
101 for now we trusting ddraw alloc it */
103 }
104
105 pcsd->lpDDSurfaceDesc->lPitch = pcsd->lplpSList[i]->lpGbl->lPitch;
106 pcsd->lpDDSurfaceDesc->dwFlags |= DDSD_PITCH;
107
108 } // for i
109
110
111
112 pcsd->ddRVal = DD_OK;
114}
#define DDHAL_PLEASEALLOC_BLOCKSIZE
Definition: ddrawi.h:650
#define DDHAL_DRIVER_NOTHANDLED
Definition: ddrawi.h:320
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DWORD
Definition: nt_native.h:44
#define DDSD_PITCH
Definition: ddraw.h:211
#define DDSCAPS_PRIMARYSURFACE
Definition: ddraw.h:258
#define DDERR_GENERIC
Definition: ddraw.h:72
DWORD dwRGBBitCount
Definition: ddraw.h:1075
DWORD dwCaps
Definition: ddraw.h:727
DDSURFACEDESC * lpDDSurfaceDesc
Definition: ddrawint.h:426
PDD_SURFACE_LOCAL * lplpSList
Definition: ddrawint.h:427
DDPIXELFORMAT ddpfSurface
Definition: ddrawint.h:156
FLATPTR fpVidMem
Definition: ddrawint.h:146
PDD_SURFACE_GLOBAL lpGbl
Definition: ddrawint.h:172
DDSCAPS ddsCaps
Definition: ddrawint.h:174

Referenced by DrvEnableDirectDraw().