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
e37b1d31
Commit
e37b1d31
authored
Apr 16, 2001
by
Ove Kaaven
Committed by
Alexandre Julliard
Apr 16, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented the IDirectDrawGammaControl interface.
parent
c9ada023
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
2 deletions
+141
-2
Makefile.in
dlls/ddraw/Makefile.in
+1
-0
gamma.c
dlls/ddraw/dsurface/gamma.c
+66
-0
main.c
dlls/ddraw/dsurface/main.c
+60
-1
main.h
dlls/ddraw/dsurface/main.h
+14
-1
No files found.
dlls/ddraw/Makefile.in
View file @
e37b1d31
...
...
@@ -33,6 +33,7 @@ C_SRCS = \
dsurface/dib.c
\
dsurface/dibtexture.c
\
dsurface/fakezbuffer.c
\
dsurface/gamma.c
\
dsurface/main.c
\
dsurface/thunks.c
\
dsurface/user.c
\
...
...
dlls/ddraw/dsurface/gamma.c
0 → 100644
View file @
e37b1d31
/* DirectDrawGammaControl implementation
*
* Copyright 2001 TransGaming Technologies Inc.
*/
#include "config.h"
#include "winerror.h"
#include <assert.h>
#include <stdlib.h>
#include "debugtools.h"
#include "ddraw_private.h"
#include "dsurface/main.h"
DEFAULT_DEBUG_CHANNEL
(
ddraw
);
#define CONVERT(pddgc) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, \
IDirectDrawGammaControl, \
IDirectDrawSurface7, \
(pddgc))
static
HRESULT
WINAPI
DirectDrawGammaControl_QueryInterface
(
LPDIRECTDRAWGAMMACONTROL
iface
,
REFIID
riid
,
LPVOID
*
ppObj
)
{
TRACE
(
"(%p)->(%s,%p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppObj
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
DirectDrawGammaControl_AddRef
(
LPDIRECTDRAWGAMMACONTROL
iface
)
{
return
IDirectDrawSurface7_AddRef
(
CONVERT
(
iface
));
}
static
ULONG
WINAPI
DirectDrawGammaControl_Release
(
LPDIRECTDRAWGAMMACONTROL
iface
)
{
return
IDirectDrawSurface7_Release
(
CONVERT
(
iface
));
}
static
HRESULT
WINAPI
DirectDrawGammaControl_GetGammaRamp
(
LPDIRECTDRAWGAMMACONTROL
iface
,
DWORD
dwFlags
,
LPDDGAMMARAMP
lpGammaRamp
)
{
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirectDrawGammaControl
,
iface
);
TRACE
(
"(%p)->(%08lx,%p)
\n
"
,
iface
,
dwFlags
,
lpGammaRamp
);
return
This
->
get_gamma_ramp
(
This
,
dwFlags
,
lpGammaRamp
);
}
static
HRESULT
WINAPI
DirectDrawGammaControl_SetGammaRamp
(
LPDIRECTDRAWGAMMACONTROL
iface
,
DWORD
dwFlags
,
LPDDGAMMARAMP
lpGammaRamp
)
{
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirectDrawGammaControl
,
iface
);
TRACE
(
"(%p)->(%08lx,%p)
\n
"
,
iface
,
dwFlags
,
lpGammaRamp
);
return
This
->
set_gamma_ramp
(
This
,
dwFlags
,
lpGammaRamp
);
}
ICOM_VTABLE
(
IDirectDrawGammaControl
)
DDRAW_IDDGC_VTable
=
{
DirectDrawGammaControl_QueryInterface
,
DirectDrawGammaControl_AddRef
,
DirectDrawGammaControl_Release
,
DirectDrawGammaControl_GetGammaRamp
,
DirectDrawGammaControl_SetGammaRamp
};
dlls/ddraw/dsurface/main.c
View file @
e37b1d31
...
...
@@ -2,7 +2,7 @@
*
* Copyright 1997-2000 Marcus Meissner
* Copyright 1998-2000 Lionel Ulmer (most of Direct3D stuff)
* Copyright 2000 TransGaming Technologies Inc.
* Copyright 2000
-2001
TransGaming Technologies Inc.
*/
#include "config.h"
#include "winerror.h"
...
...
@@ -32,7 +32,23 @@ Main_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl *This,
This
->
uniqueness_value
=
1
;
/* unchecked */
This
->
ref
=
1
;
This
->
local
.
lpSurfMore
=
&
This
->
more
;
This
->
local
.
lpGbl
=
&
This
->
global
;
This
->
local
.
dwProcessId
=
GetCurrentProcessId
();
This
->
local
.
dwFlags
=
0
;
/* FIXME */
This
->
local
.
ddsCaps
.
dwCaps
=
This
->
surface_desc
.
ddsCaps
.
dwCaps
;
/* FIXME: more local stuff */
This
->
more
.
lpDD_lcl
=
&
pDD
->
local
;
This
->
more
.
ddsCapsEx
.
dwCaps2
=
This
->
surface_desc
.
ddsCaps
.
dwCaps2
;
This
->
more
.
ddsCapsEx
.
dwCaps3
=
This
->
surface_desc
.
ddsCaps
.
dwCaps3
;
This
->
more
.
ddsCapsEx
.
dwCaps4
=
This
->
surface_desc
.
ddsCaps
.
dwCaps4
;
/* FIXME: more more stuff */
This
->
gmore
=
&
This
->
global_more
;
This
->
global
.
u3
.
lpDD
=
pDD
->
local
.
lpGbl
;
/* FIXME: more global stuff */
This
->
final_release
=
Main_DirectDrawSurface_final_release
;
This
->
late_allocate
=
Main_DirectDrawSurface_late_allocate
;
This
->
attach
=
Main_DirectDrawSurface_attach
;
This
->
detach
=
Main_DirectDrawSurface_detach
;
This
->
lock_update
=
Main_DirectDrawSurface_lock_update
;
...
...
@@ -41,9 +57,13 @@ Main_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl *This,
This
->
set_palette
=
Main_DirectDrawSurface_set_palette
;
This
->
update_palette
=
Main_DirectDrawSurface_update_palette
;
This
->
get_display_window
=
Main_DirectDrawSurface_get_display_window
;
This
->
get_gamma_ramp
=
Main_DirectDrawSurface_get_gamma_ramp
;
This
->
set_gamma_ramp
=
Main_DirectDrawSurface_set_gamma_ramp
;
ICOM_INIT_INTERFACE
(
This
,
IDirectDrawSurface3
,
DDRAW_IDDS3_Thunk_VTable
);
ICOM_INIT_INTERFACE
(
This
,
IDirectDrawGammaControl
,
DDRAW_IDDGC_VTable
);
/* There is no generic implementation of IDDS7 */
Main_DirectDraw_AddSurface
(
pDD
,
This
);
...
...
@@ -55,6 +75,11 @@ void Main_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This)
Main_DirectDraw_RemoveSurface
(
This
->
ddraw_owner
,
This
);
}
HRESULT
Main_DirectDrawSurface_late_allocate
(
IDirectDrawSurfaceImpl
*
This
)
{
return
DD_OK
;
}
static
void
Main_DirectDrawSurface_Destroy
(
IDirectDrawSurfaceImpl
*
This
)
{
This
->
final_release
(
This
);
...
...
@@ -113,6 +138,12 @@ Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid,
*
ppObj
=
ICOM_INTERFACE
(
This
,
IDirectDrawSurface3
);
return
S_OK
;
}
else
if
(
IsEqualGUID
(
&
IID_IDirectDrawGammaControl
,
riid
))
{
This
->
ref
++
;
*
ppObj
=
ICOM_INTERFACE
(
This
,
IDirectDrawGammaControl
);
return
S_OK
;
}
else
return
E_NOINTERFACE
;
}
...
...
@@ -167,6 +198,34 @@ Main_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This)
return
0
;
}
HRESULT
Main_DirectDrawSurface_get_gamma_ramp
(
IDirectDrawSurfaceImpl
*
This
,
DWORD
dwFlags
,
LPDDGAMMARAMP
lpGammaRamp
)
{
HDC
hDC
;
HRESULT
hr
;
hr
=
This
->
get_dc
(
This
,
&
hDC
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
GetDeviceGammaRamp
(
hDC
,
lpGammaRamp
)
?
DD_OK
:
DDERR_UNSUPPORTED
;
This
->
release_dc
(
This
,
hDC
);
return
hr
;
}
HRESULT
Main_DirectDrawSurface_set_gamma_ramp
(
IDirectDrawSurfaceImpl
*
This
,
DWORD
dwFlags
,
LPDDGAMMARAMP
lpGammaRamp
)
{
HDC
hDC
;
HRESULT
hr
;
hr
=
This
->
get_dc
(
This
,
&
hDC
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
SetDeviceGammaRamp
(
hDC
,
lpGammaRamp
)
?
DD_OK
:
DDERR_UNSUPPORTED
;
This
->
release_dc
(
This
,
hDC
);
return
hr
;
}
/*** Interface functions */
...
...
dlls/ddraw/dsurface/main.h
View file @
e37b1d31
/* Copyright 2000 TransGaming Technologies Inc. */
/* Copyright 2000
-2001
TransGaming Technologies Inc. */
#ifndef DDRAW_DSURFACE_MAIN_H_INCLUDED
#define DDRAW_DSURFACE_MAIN_H_INCLUDED
...
...
@@ -25,6 +25,8 @@ typedef struct PrivateData
DWORD
size
;
}
PrivateData
;
extern
ICOM_VTABLE
(
IDirectDrawGammaControl
)
DDRAW_IDDGC_VTable
;
/* Non-interface functions */
HRESULT
Main_DirectDrawSurface_Construct
(
IDirectDrawSurfaceImpl
*
This
,
...
...
@@ -34,6 +36,8 @@ void Main_DirectDrawSurface_ForceDestroy(IDirectDrawSurfaceImpl* This);
void
Main_DirectDrawSurface_final_release
(
IDirectDrawSurfaceImpl
*
This
);
HRESULT
Main_DirectDrawSurface_late_allocate
(
IDirectDrawSurfaceImpl
*
This
);
BOOL
Main_DirectDrawSurface_attach
(
IDirectDrawSurfaceImpl
*
This
,
IDirectDrawSurfaceImpl
*
to
);
...
...
@@ -57,6 +61,15 @@ Main_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
HWND
Main_DirectDrawSurface_get_display_window
(
IDirectDrawSurfaceImpl
*
This
);
HRESULT
Main_DirectDrawSurface_get_gamma_ramp
(
IDirectDrawSurfaceImpl
*
This
,
DWORD
dwFlags
,
LPDDGAMMARAMP
lpGammaRamp
);
HRESULT
Main_DirectDrawSurface_set_gamma_ramp
(
IDirectDrawSurfaceImpl
*
This
,
DWORD
dwFlags
,
LPDDGAMMARAMP
lpGammaRamp
);
BOOL
Main_DirectDrawSurface_flip_data
(
IDirectDrawSurfaceImpl
*
front
,
IDirectDrawSurfaceImpl
*
back
,
DWORD
dwFlags
);
...
...
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