Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d4b63bbd
Commit
d4b63bbd
authored
Jan 10, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the scissor rect in the stateblock.
parent
222c531b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
device.c
dlls/wined3d/device.c
+10
-9
stateblock.c
dlls/wined3d/stateblock.c
+14
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-0
No files found.
dlls/wined3d/device.c
View file @
d4b63bbd
...
...
@@ -3180,6 +3180,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetScissorRect(IWineD3DDevice *iface, C
RECT
windowRect
;
UINT
winHeight
;
This
->
updateStateBlock
->
set
.
scissorRect
=
TRUE
;
This
->
updateStateBlock
->
changed
.
scissorRect
=
TRUE
;
memcpy
(
&
This
->
updateStateBlock
->
scissorRect
,
pRect
,
sizeof
(
*
pRect
));
if
(
This
->
isRecordingState
)
{
TRACE
(
"Recording... not performing anything
\n
"
);
return
WINED3D_OK
;
}
GetClientRect
(((
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
])
->
win_handle
,
&
windowRect
);
/* Warning: glScissor uses window coordinates, not viewport coordinates, so our viewport correction does not apply
* Warning2: Even in windowed mode the coords are relative to the window, not the screen
...
...
@@ -3197,17 +3206,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetScissorRect(IWineD3DDevice *iface, C
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetScissorRect
(
IWineD3DDevice
*
iface
,
RECT
*
pRect
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
GLint
scissorBox
[
4
];
ENTER_GL
();
/** FIXME: Windows uses a top,left origin openGL uses a bottom Right? **/
glGetIntegerv
(
GL_SCISSOR_BOX
,
scissorBox
);
pRect
->
left
=
scissorBox
[
0
];
pRect
->
top
=
scissorBox
[
1
];
pRect
->
right
=
scissorBox
[
0
]
+
scissorBox
[
2
];
pRect
->
bottom
=
scissorBox
[
1
]
+
scissorBox
[
3
];
memcpy
(
pRect
,
&
This
->
updateStateBlock
->
scissorRect
,
sizeof
(
pRect
));
TRACE
(
"(%p)Returning a Scissor Rect of %d:%d-%d:%d
\n
"
,
This
,
pRect
->
left
,
pRect
->
top
,
pRect
->
right
,
pRect
->
bottom
);
LEAVE_GL
();
return
WINED3D_OK
;
}
...
...
dlls/wined3d/stateblock.c
View file @
d4b63bbd
...
...
@@ -78,6 +78,7 @@ void stateblock_savedstates_copy(
dest
->
vertexDecl
=
source
->
vertexDecl
;
dest
->
pixelShader
=
source
->
pixelShader
;
dest
->
vertexShader
=
source
->
vertexShader
;
dest
->
scissorRect
=
dest
->
scissorRect
;
/* Fixed size arrays */
memcpy
(
dest
->
streamSource
,
source
->
streamSource
,
bsize
*
MAX_STREAMS
);
...
...
@@ -115,6 +116,7 @@ void stateblock_savedstates_set(
states
->
vertexDecl
=
value
;
states
->
pixelShader
=
value
;
states
->
vertexShader
=
value
;
states
->
scissorRect
=
value
;
/* Fixed size arrays */
memset
(
states
->
streamSource
,
value
,
bsize
*
MAX_STREAMS
);
...
...
@@ -168,6 +170,7 @@ void stateblock_copy(
Dest
->
material
=
This
->
material
;
Dest
->
pixelShader
=
This
->
pixelShader
;
Dest
->
glsl_program
=
This
->
glsl_program
;
memcpy
(
&
Dest
->
scissorRect
,
&
This
->
scissorRect
,
sizeof
(
Dest
->
scissorRect
));
/* Fixed size arrays */
memcpy
(
Dest
->
vertexShaderConstantB
,
This
->
vertexShaderConstantB
,
sizeof
(
BOOL
)
*
MAX_CONST_B
);
...
...
@@ -484,6 +487,14 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
memcpy
(
&
This
->
viewport
,
&
targetStateBlock
->
viewport
,
sizeof
(
WINED3DVIEWPORT
));
}
if
(
This
->
set
.
scissorRect
&&
memcmp
(
&
targetStateBlock
->
scissorRect
,
&
This
->
scissorRect
,
sizeof
(
targetStateBlock
->
scissorRect
)))
{
TRACE
(
"Updating scissor rect
\n
"
);
memcpy
(
&
targetStateBlock
->
scissorRect
,
&
This
->
scissorRect
,
sizeof
(
targetStateBlock
->
scissorRect
));
}
for
(
i
=
0
;
i
<
MAX_STREAMS
;
i
++
)
{
if
(
This
->
set
.
streamSource
[
i
]
&&
((
This
->
streamStride
[
i
]
!=
targetStateBlock
->
streamStride
[
i
])
||
...
...
@@ -656,6 +667,9 @@ should really perform a delta so that only the changes get updated*/
if
(
This
->
set
.
viewport
&&
This
->
changed
.
viewport
)
IWineD3DDevice_SetViewport
(
pDevice
,
&
This
->
viewport
);
if
(
This
->
set
.
scissorRect
&&
This
->
changed
.
scissorRect
)
IWineD3DDevice_SetScissorRect
(
pDevice
,
&
This
->
scissorRect
);
/* TODO: Proper implementation using SetStreamSource offset (set to 0 for the moment)\n") */
for
(
i
=
0
;
i
<
MAX_STREAMS
;
i
++
)
{
if
(
This
->
set
.
streamSource
[
i
]
&&
This
->
changed
.
streamSource
[
i
])
...
...
dlls/wined3d/wined3d_private.h
View file @
d4b63bbd
...
...
@@ -1155,6 +1155,7 @@ typedef struct SAVEDSTATES {
BOOL
vertexShaderConstantsB
[
MAX_CONST_B
];
BOOL
vertexShaderConstantsI
[
MAX_CONST_I
];
BOOL
*
vertexShaderConstantsF
;
BOOL
scissorRect
;
}
SAVEDSTATES
;
typedef
struct
{
...
...
@@ -1243,6 +1244,9 @@ struct IWineD3DStateBlockImpl
/* Current GLSL Shader Program */
struct
glsl_shader_prog_link
*
glsl_program
;
/* Scissor test rectangle */
RECT
scissorRect
;
};
extern
void
stateblock_savedstates_set
(
...
...
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