Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
af462957
Commit
af462957
authored
May 06, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement IWineD3DSurface::GetDC and IWineD3DSurface::ReleaseDC.
parent
f09dfe93
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
201 additions
and
0 deletions
+201
-0
surface.c
dlls/wined3d/surface.c
+0
-0
utils.c
dlls/wined3d/utils.c
+181
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+20
-0
No files found.
dlls/wined3d/surface.c
View file @
af462957
This diff is collapsed.
Click to expand it.
dlls/wined3d/utils.c
View file @
af462957
...
...
@@ -2061,3 +2061,184 @@ WINED3DFORMAT pixelformat_for_depth(DWORD depth) {
default
:
return
WINED3DFMT_UNKNOWN
;
}
}
LONG
get_bitmask_red
(
WINED3DFORMAT
fmt
)
{
switch
(
fmt
)
{
case
WINED3DFMT_R8G8B8
:
case
WINED3DFMT_A8R8G8B8
:
case
WINED3DFMT_X8R8G8B8
:
return
0x00ff0000
;
case
WINED3DFMT_X1R5G5B5
:
case
WINED3DFMT_A1R5G5B5
:
return
0x7C00
;
case
WINED3DFMT_A4R4G4B4
:
case
WINED3DFMT_X4R4G4B4
:
return
0xF00
;
case
WINED3DFMT_R3G3B2
:
case
WINED3DFMT_A8R3G3B2
:
return
0xE0
;
case
WINED3DFMT_A2R10G10B10
:
return
0x3F0000
;
break
;
case
WINED3DFMT_A2B10G10R10
:
return
0x3FF
;
case
WINED3DFMT_A8B8G8R8
:
case
WINED3DFMT_X8B8G8R8
:
return
0xff
;
case
WINED3DFMT_R5G6B5
:
return
0xF800
;
case
WINED3DFMT_P8
:
/* No fixed mask for this format */
return
0
;
#if 0
case WINED3DFMT_A16B16G16R16:
return 0x00000000ffff;
break;
#endif
default
:
ERR
(
"Unknown bitmask for format %d
\n
"
,
fmt
);
return
0
;
}
}
LONG
get_bitmask_green
(
WINED3DFORMAT
fmt
)
{
switch
(
fmt
)
{
case
WINED3DFMT_R8G8B8
:
case
WINED3DFMT_A8R8G8B8
:
case
WINED3DFMT_X8R8G8B8
:
return
0x0000ff00
;
case
WINED3DFMT_X1R5G5B5
:
case
WINED3DFMT_A1R5G5B5
:
return
0x3E0
;
case
WINED3DFMT_A4R4G4B4
:
case
WINED3DFMT_X4R4G4B4
:
return
0xF0
;
case
WINED3DFMT_R3G3B2
:
case
WINED3DFMT_A8R3G3B2
:
return
0x1C
;
case
WINED3DFMT_A2B10G10R10
:
return
0xFFC00
;
case
WINED3DFMT_A8B8G8R8
:
case
WINED3DFMT_X8B8G8R8
:
return
0xFF00
;
break
;
case
WINED3DFMT_A2R10G10B10
:
return
0xFFC00
;
break
;
case
WINED3DFMT_R5G6B5
:
return
0x7E0
;
case
WINED3DFMT_P8
:
/* No fixed mask for this format */
return
0
;
#if 0
case WINED3DFMT_A16B16G16R16:
return 0x0000ffff0000;
break;
#endif
default
:
ERR
(
"Unknown bitmask for format %d
\n
"
,
fmt
);
return
0
;
}
}
LONG
get_bitmask_blue
(
WINED3DFORMAT
fmt
)
{
switch
(
fmt
)
{
case
WINED3DFMT_R8G8B8
:
case
WINED3DFMT_A8R8G8B8
:
case
WINED3DFMT_X8R8G8B8
:
return
0x000000ff
;
case
WINED3DFMT_X1R5G5B5
:
case
WINED3DFMT_A1R5G5B5
:
return
0x1f
;
case
WINED3DFMT_A4R4G4B4
:
case
WINED3DFMT_X4R4G4B4
:
return
0xF
;
case
WINED3DFMT_R3G3B2
:
case
WINED3DFMT_A8R3G3B2
:
return
0x3
;
case
WINED3DFMT_A2B10G10R10
:
return
0x3F0000
;
case
WINED3DFMT_A8B8G8R8
:
case
WINED3DFMT_X8B8G8R8
:
return
0xFF0000
;
case
WINED3DFMT_A2R10G10B10
:
return
0x3FF
;
case
WINED3DFMT_R5G6B5
:
return
0x1F
;
case
WINED3DFMT_P8
:
/* No fixed mask for this format */
return
0
;
#if 0
case WINED3DFMT_A16B16G16R16:
return 0xffff00000000;
break;
#endif
default
:
ERR
(
"Unknown bitmask for format %d
\n
"
,
fmt
);
return
0
;
}
}
LONG
get_bitmask_alpha
(
WINED3DFORMAT
fmt
)
{
switch
(
fmt
)
{
case
WINED3DFMT_A8R8G8B8
:
return
0xff000000
;
case
WINED3DFMT_A1R5G5B5
:
return
0x8000
;
case
WINED3DFMT_A4R4G4B4
:
return
0xF000
;
case
WINED3DFMT_A8R3G3B2
:
return
0xff00
;
case
WINED3DFMT_A2B10G10R10
:
return
0xb0000000
;
case
WINED3DFMT_A8B8G8R8
:
return
0xFF000000
;
case
WINED3DFMT_A2R10G10B10
:
return
0xb0000000
;
default
:
return
0
;
}
}
dlls/wined3d/wined3d_private.h
View file @
af462957
...
...
@@ -786,6 +786,16 @@ typedef struct _WINED3DSURFACET_DESC
}
WINED3DSURFACET_DESC
;
/*****************************************************************************
* Structure for DIB Surfaces (GetDC and GDI surfaces)
*/
typedef
struct
wineD3DSurface_DIB
{
HBITMAP
DIBsection
;
void
*
bitmap_data
;
HGDIOBJ
holdbitmap
;
BOOL
client_memory
;
}
wineD3DSurface_DIB
;
/*****************************************************************************
* IWineD3DSurface implementation structure
*/
struct
IWineD3DSurfaceImpl
...
...
@@ -819,6 +829,10 @@ struct IWineD3DSurfaceImpl
RECT
dirtyRect
;
glDescriptor
glDescription
;
/* For GetDC */
wineD3DSurface_DIB
dib
;
HDC
hDC
;
};
extern
const
IWineD3DSurfaceVtbl
IWineD3DSurface_Vtbl
;
...
...
@@ -837,6 +851,8 @@ extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl;
#define SFLAG_NONPOW2 0x0400
/* Surface sizes are not a power of 2 */
#define SFLAG_DYNLOCK 0x0800
/* Surface is often locked by the app */
#define SFLAG_DYNCHANGE 0x1800
/* Surface contents are changed very often, implies DYNLOCK */
#define SFLAG_DCINUSE 0x2000
/* Set between GetDC and ReleaseDC calls */
#define SFLAG_NEWDC 0x4000
/* To inform LockRect about a new dc */
/* In some conditions the surface memory must not be freed:
* SFLAG_OVERSIZE: Not all data can be kept in GL
...
...
@@ -1299,5 +1315,9 @@ DWORD IWineD3DPaletteImpl_Size(DWORD dwFlags);
/* DirectDraw utility functions */
extern
WINED3DFORMAT
pixelformat_for_depth
(
DWORD
depth
);
LONG
get_bitmask_red
(
WINED3DFORMAT
fmt
);
LONG
get_bitmask_green
(
WINED3DFORMAT
fmt
);
LONG
get_bitmask_blue
(
WINED3DFORMAT
fmt
);
LONG
get_bitmask_alpha
(
WINED3DFORMAT
fmt
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment