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
2735947d
Commit
2735947d
authored
Aug 07, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a separate function to resize swapchain buffers.
parent
7fd7bcf0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
2 deletions
+96
-2
device.c
dlls/wined3d/device.c
+0
-0
swapchain.c
dlls/wined3d/swapchain.c
+93
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-1
No files found.
dlls/wined3d/device.c
View file @
2735947d
This diff is collapsed.
Click to expand it.
dlls/wined3d/swapchain.c
View file @
2735947d
...
...
@@ -731,7 +731,7 @@ static const struct wined3d_swapchain_ops swapchain_gdi_ops =
swapchain_gdi_present
,
};
void
swapchain_update_render_to_fbo
(
struct
wined3d_swapchain
*
swapchain
)
static
void
swapchain_update_render_to_fbo
(
struct
wined3d_swapchain
*
swapchain
)
{
RECT
client_rect
;
...
...
@@ -1224,3 +1224,95 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
device
->
filter_messages
=
filter_messages
;
}
HRESULT
wined3d_swapchain_resize_buffers
(
struct
wined3d_swapchain
*
swapchain
,
unsigned
int
buffer_count
,
unsigned
int
width
,
unsigned
int
height
,
enum
wined3d_format_id
format_id
,
enum
wined3d_multisample_type
multisample_type
,
unsigned
int
multisample_quality
)
{
BOOL
update_desc
=
FALSE
;
TRACE
(
"swapchain %p, buffer_count %u, width %u, height %u, format %s, "
"multisample_type %#x, multisample_quality %#x.
\n
"
,
swapchain
,
buffer_count
,
width
,
height
,
debug_d3dformat
(
format_id
),
multisample_type
,
multisample_quality
);
if
(
buffer_count
&&
buffer_count
!=
swapchain
->
desc
.
backbuffer_count
)
FIXME
(
"Cannot change the back buffer count yet.
\n
"
);
if
(
!
width
||
!
height
)
{
/* The application is requesting that either the swapchain width or
* height be set to the corresponding dimension in the window's
* client rect. */
RECT
client_rect
;
if
(
!
swapchain
->
desc
.
windowed
)
return
WINED3DERR_INVALIDCALL
;
if
(
!
GetClientRect
(
swapchain
->
device_window
,
&
client_rect
))
{
ERR
(
"Failed to get client rect, last error %#x.
\n
"
,
GetLastError
());
return
WINED3DERR_INVALIDCALL
;
}
if
(
!
width
)
width
=
client_rect
.
right
;
if
(
!
height
)
height
=
client_rect
.
bottom
;
}
if
(
width
!=
swapchain
->
desc
.
backbuffer_width
||
height
!=
swapchain
->
desc
.
backbuffer_height
)
{
swapchain
->
desc
.
backbuffer_width
=
width
;
swapchain
->
desc
.
backbuffer_height
=
height
;
update_desc
=
TRUE
;
}
if
(
format_id
==
WINED3DFMT_UNKNOWN
)
{
if
(
!
swapchain
->
desc
.
windowed
)
return
WINED3DERR_INVALIDCALL
;
format_id
=
swapchain
->
original_mode
.
format_id
;
}
if
(
format_id
!=
swapchain
->
desc
.
backbuffer_format
)
{
swapchain
->
desc
.
backbuffer_format
=
format_id
;
update_desc
=
TRUE
;
}
if
(
multisample_type
!=
swapchain
->
desc
.
multisample_type
||
multisample_quality
!=
swapchain
->
desc
.
multisample_quality
)
{
swapchain
->
desc
.
multisample_type
=
multisample_type
;
swapchain
->
desc
.
multisample_quality
=
multisample_quality
;
update_desc
=
TRUE
;
}
if
(
update_desc
)
{
HRESULT
hr
;
UINT
i
;
if
(
FAILED
(
hr
=
wined3d_texture_update_desc
(
swapchain
->
front_buffer
,
swapchain
->
desc
.
backbuffer_width
,
swapchain
->
desc
.
backbuffer_height
,
swapchain
->
desc
.
backbuffer_format
,
swapchain
->
desc
.
multisample_type
,
swapchain
->
desc
.
multisample_quality
,
NULL
,
0
)))
return
hr
;
for
(
i
=
0
;
i
<
swapchain
->
desc
.
backbuffer_count
;
++
i
)
{
if
(
FAILED
(
hr
=
wined3d_texture_update_desc
(
swapchain
->
back_buffers
[
i
],
swapchain
->
desc
.
backbuffer_width
,
swapchain
->
desc
.
backbuffer_height
,
swapchain
->
desc
.
backbuffer_format
,
swapchain
->
desc
.
multisample_type
,
swapchain
->
desc
.
multisample_quality
,
NULL
,
0
)))
return
hr
;
}
}
swapchain_update_render_to_fbo
(
swapchain
);
swapchain_update_draw_bindings
(
swapchain
);
return
WINED3D_OK
;
}
dlls/wined3d/wined3d_private.h
View file @
2735947d
...
...
@@ -2812,8 +2812,10 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
struct
wined3d_context
*
swapchain_get_context
(
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
void
swapchain_destroy_contexts
(
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
HDC
swapchain_get_backup_dc
(
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_swapchain_resize_buffers
(
struct
wined3d_swapchain
*
swapchain
,
unsigned
int
buffer_count
,
unsigned
int
width
,
unsigned
int
height
,
enum
wined3d_format_id
format_id
,
enum
wined3d_multisample_type
multisample_type
,
unsigned
int
multisample_quality
)
DECLSPEC_HIDDEN
;
void
swapchain_update_draw_bindings
(
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
void
swapchain_update_render_to_fbo
(
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* Utility function prototypes
...
...
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