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
864b25e5
Commit
864b25e5
authored
Sep 23, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a separate function for updating the viewport and scissor rects.
parent
556e3e0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
device.c
dlls/wined3d/device.c
+21
-0
stateblock.c
dlls/wined3d/stateblock.c
+0
-17
No files found.
dlls/wined3d/device.c
View file @
864b25e5
...
...
@@ -827,6 +827,23 @@ void CDECL wined3d_device_release_focus_window(struct wined3d_device *device)
InterlockedExchangePointer
((
void
**
)
&
device
->
focus_window
,
NULL
);
}
static
void
device_reset_viewport_scissor
(
struct
wined3d_device
*
device
,
UINT
width
,
UINT
height
)
{
struct
wined3d_state
*
state
=
&
device
->
state
;
state
->
viewport
.
x
=
0
;
state
->
viewport
.
y
=
0
;
state
->
viewport
.
width
=
width
;
state
->
viewport
.
height
=
height
;
state
->
viewport
.
min_z
=
0
.
0
f
;
state
->
viewport
.
max_z
=
1
.
0
f
;
state
->
scissor_rect
.
left
=
0
;
state
->
scissor_rect
.
top
=
0
;
state
->
scissor_rect
.
right
=
width
;
state
->
scissor_rect
.
bottom
=
height
;
}
HRESULT
CDECL
wined3d_device_init_3d
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
swapchain_desc
)
{
...
...
@@ -895,6 +912,8 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
/* Setup all the devices defaults */
state_init_default
(
&
device
->
state
,
device
);
device_reset_viewport_scissor
(
device
,
swapchain
->
desc
.
backbuffer_width
,
swapchain
->
desc
.
backbuffer_height
);
context
=
context_acquire
(
device
,
swapchain
->
front_buffer
);
...
...
@@ -4704,6 +4723,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if
(
FAILED
(
hr
=
state_init
(
&
device
->
state
,
&
device
->
adapter
->
d3d_info
)))
ERR
(
"Failed to initialize device state, hr %#x.
\n
"
,
hr
);
state_init_default
(
&
device
->
state
,
device
);
device_reset_viewport_scissor
(
device
,
swapchain
->
desc
.
backbuffer_width
,
swapchain
->
desc
.
backbuffer_height
);
device
->
update_state
=
&
device
->
state
;
}
else
...
...
dlls/wined3d/stateblock.c
View file @
864b25e5
...
...
@@ -1181,7 +1181,6 @@ void state_init_default(struct wined3d_state *state, struct wined3d_device *devi
DWORD
d
;
}
tmpfloat
;
unsigned
int
i
;
struct
wined3d_swapchain_desc
*
swapchain_desc
;
static
const
struct
wined3d_matrix
identity
=
{{{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
...
...
@@ -1384,22 +1383,6 @@ void state_init_default(struct wined3d_state *state, struct wined3d_device *devi
{
state
->
textures
[
i
]
=
NULL
;
}
swapchain_desc
=
&
device
->
swapchains
[
0
]
->
desc
;
/* Set the default scissor rect values */
state
->
scissor_rect
.
left
=
0
;
state
->
scissor_rect
.
right
=
swapchain_desc
->
backbuffer_width
;
state
->
scissor_rect
.
top
=
0
;
state
->
scissor_rect
.
bottom
=
swapchain_desc
->
backbuffer_height
;
/* Set the default viewport */
state
->
viewport
.
x
=
0
;
state
->
viewport
.
y
=
0
;
state
->
viewport
.
width
=
swapchain_desc
->
backbuffer_width
;
state
->
viewport
.
height
=
swapchain_desc
->
backbuffer_height
;
state
->
viewport
.
min_z
=
0
.
0
f
;
state
->
viewport
.
max_z
=
1
.
0
f
;
}
static
HRESULT
stateblock_init
(
struct
wined3d_stateblock
*
stateblock
,
...
...
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