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
9de53720
Commit
9de53720
authored
Aug 22, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a function to update a swapchain's render_to_fbo field.
parent
7b19efd9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
37 deletions
+36
-37
device.c
dlls/wined3d/device.c
+1
-25
swapchain.c
dlls/wined3d/swapchain.c
+34
-12
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/device.c
View file @
9de53720
...
...
@@ -5879,31 +5879,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
stateblock_init_default_state
(
device
->
stateBlock
);
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
RECT
client_rect
;
GetClientRect
(
swapchain
->
win_handle
,
&
client_rect
);
if
(
!
swapchain
->
presentParms
.
BackBufferCount
)
{
TRACE
(
"Single buffered rendering
\n
"
);
swapchain
->
render_to_fbo
=
FALSE
;
}
else
if
(
swapchain
->
presentParms
.
BackBufferWidth
!=
client_rect
.
right
||
swapchain
->
presentParms
.
BackBufferHeight
!=
client_rect
.
bottom
)
{
TRACE
(
"Rendering to FBO. Backbuffer %ux%u, window %ux%u
\n
"
,
swapchain
->
presentParms
.
BackBufferWidth
,
swapchain
->
presentParms
.
BackBufferHeight
,
client_rect
.
right
,
client_rect
.
bottom
);
swapchain
->
render_to_fbo
=
TRUE
;
}
else
{
TRACE
(
"Rendering directly to GL_BACK
\n
"
);
swapchain
->
render_to_fbo
=
FALSE
;
}
}
swapchain_update_render_to_fbo
(
swapchain
);
hr
=
create_primary_opengl_context
(
device
,
swapchain
);
wined3d_swapchain_decref
(
swapchain
);
...
...
dlls/wined3d/swapchain.c
View file @
9de53720
...
...
@@ -803,6 +803,39 @@ static const struct wined3d_swapchain_ops swapchain_gdi_ops =
swapchain_gdi_present
,
};
void
swapchain_update_render_to_fbo
(
struct
wined3d_swapchain
*
swapchain
)
{
RECT
client_rect
;
if
(
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
)
return
;
if
(
!
swapchain
->
presentParms
.
BackBufferCount
)
{
TRACE
(
"Single buffered rendering.
\n
"
);
swapchain
->
render_to_fbo
=
FALSE
;
return
;
}
GetClientRect
(
swapchain
->
win_handle
,
&
client_rect
);
TRACE
(
"Backbuffer %ux%u, window %ux%u.
\n
"
,
swapchain
->
presentParms
.
BackBufferWidth
,
swapchain
->
presentParms
.
BackBufferHeight
,
client_rect
.
right
,
client_rect
.
bottom
);
if
(
swapchain
->
presentParms
.
BackBufferWidth
==
client_rect
.
right
&&
swapchain
->
presentParms
.
BackBufferHeight
==
client_rect
.
bottom
)
{
TRACE
(
"Backbuffer dimensions match window dimensions, rendering onscreen.
\n
"
);
swapchain
->
render_to_fbo
=
FALSE
;
return
;
}
TRACE
(
"Rendering to FBO.
\n
"
);
swapchain
->
render_to_fbo
=
TRUE
;
}
/* Do not call while under the GL lock. */
static
HRESULT
swapchain_init
(
struct
wined3d_swapchain
*
swapchain
,
WINED3DSURFTYPE
surface_type
,
struct
wined3d_device
*
device
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
,
...
...
@@ -885,18 +918,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY
}
}
swapchain
->
presentParms
=
*
present_parameters
;
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
&&
present_parameters
->
BackBufferCount
&&
(
present_parameters
->
BackBufferWidth
!=
client_rect
.
right
||
present_parameters
->
BackBufferHeight
!=
client_rect
.
bottom
))
{
TRACE
(
"Rendering to FBO. Backbuffer %ux%u, window %ux%u.
\n
"
,
present_parameters
->
BackBufferWidth
,
present_parameters
->
BackBufferHeight
,
client_rect
.
right
,
client_rect
.
bottom
);
swapchain
->
render_to_fbo
=
TRUE
;
}
swapchain_update_render_to_fbo
(
swapchain
);
TRACE
(
"Creating front buffer.
\n
"
);
hr
=
device
->
device_parent
->
ops
->
create_rendertarget
(
device
->
device_parent
,
parent
,
...
...
dlls/wined3d/wined3d_private.h
View file @
9de53720
...
...
@@ -2441,6 +2441,7 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r
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
;
void
swapchain_update_render_to_fbo
(
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
#define DEFAULT_REFRESH_RATE 0
...
...
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