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
9bc6200e
Commit
9bc6200e
authored
Nov 30, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add a method for querying the gl drawable size of rendertarget.
parent
a06caa0e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
1 deletion
+73
-1
device.c
dlls/wined3d/device.c
+26
-0
surface.c
dlls/wined3d/surface.c
+31
-1
swapchain.c
dlls/wined3d/swapchain.c
+8
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+8
-0
No files found.
dlls/wined3d/device.c
View file @
9bc6200e
...
...
@@ -7362,3 +7362,29 @@ void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
context
->
isStateDirty
[
idx
]
|=
(
1
<<
shift
);
}
}
void
get_drawable_size_pbuffer
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DDeviceImpl
*
dev
=
This
->
resource
.
wineD3DDevice
;
/* The drawable size of a pbuffer render target is the current pbuffer size
*/
*
width
=
dev
->
pbufferWidth
;
*
height
=
dev
->
pbufferHeight
;
}
void
get_drawable_size_fbo
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
)
{
/* The drawable size of a fbo target is the opengl texture size, which is the power of two size
*/
*
width
=
This
->
pow2Width
;
*
height
=
This
->
pow2Height
;
}
void
get_drawable_size_backbuffer
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DDeviceImpl
*
dev
=
This
->
resource
.
wineD3DDevice
;
/* The drawable size of a backbuffer / aux buffer offscreen target is the size of the
* current context's drawable, which is the size of the back buffer of the swapchain
* the active context belongs to. The back buffer of the swapchain is stored as the
* surface the context belongs to.
*/
*
width
=
((
IWineD3DSurfaceImpl
*
)
dev
->
activeContext
->
surface
)
->
currentDesc
.
Width
;
*
height
=
((
IWineD3DSurfaceImpl
*
)
dev
->
activeContext
->
surface
)
->
currentDesc
.
Height
;
}
dlls/wined3d/surface.c
View file @
9bc6200e
...
...
@@ -3480,6 +3480,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
This
->
glRect
.
bottom
=
This
->
pow2Height
;
}
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
{
switch
(
wined3d_settings
.
offscreen_rendering_mode
)
{
case
ORM_FBO
:
This
->
get_drawable_size
=
get_drawable_size_fbo
;
break
;
case
ORM_PBUFFER
:
This
->
get_drawable_size
=
get_drawable_size_pbuffer
;
break
;
case
ORM_BACKBUFFER
:
This
->
get_drawable_size
=
get_drawable_size_backbuffer
;
break
;
}
}
This
->
Flags
|=
SFLAG_INSYSMEM
;
return
WINED3D_OK
;
...
...
@@ -3877,6 +3885,28 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
return
WINED3D_OK
;
}
HRESULT
WINAPI
IWineD3DSurfaceImpl_SetContainer
(
IWineD3DSurface
*
iface
,
IWineD3DBase
*
container
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
IWineD3DSwapChain
*
swapchain
=
NULL
;
/* Update the drawable size method */
if
(
container
)
{
IWineD3DBase_QueryInterface
(
container
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
swapchain
);
}
if
(
swapchain
)
{
This
->
get_drawable_size
=
get_drawable_size_swapchain
;
IWineD3DSwapChain_Release
(
swapchain
);
}
else
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
{
switch
(
wined3d_settings
.
offscreen_rendering_mode
)
{
case
ORM_FBO
:
This
->
get_drawable_size
=
get_drawable_size_fbo
;
break
;
case
ORM_PBUFFER
:
This
->
get_drawable_size
=
get_drawable_size_pbuffer
;
break
;
case
ORM_BACKBUFFER
:
This
->
get_drawable_size
=
get_drawable_size_backbuffer
;
break
;
}
}
return
IWineD3DBaseSurfaceImpl_SetContainer
(
iface
,
container
);
}
const
IWineD3DSurfaceVtbl
IWineD3DSurface_Vtbl
=
{
/* IUnknown */
...
...
@@ -3924,7 +3954,7 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DSurfaceImpl_LoadTexture
,
IWineD3DSurfaceImpl_BindTexture
,
IWineD3DSurfaceImpl_SaveSnapshot
,
IWineD3D
Base
SurfaceImpl_SetContainer
,
IWineD3DSurfaceImpl_SetContainer
,
IWineD3DSurfaceImpl_SetGlTextureDesc
,
IWineD3DSurfaceImpl_GetGlDesc
,
IWineD3DSurfaceImpl_GetData
,
...
...
dlls/wined3d/swapchain.c
View file @
9bc6200e
...
...
@@ -585,3 +585,11 @@ WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *
TRACE
(
"Returning context %p
\n
"
,
ctx
);
return
ctx
;
}
void
get_drawable_size_swapchain
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
)
{
/* The drawable size of an onscreen drawable is the surface size.
* (Actually: The window size, but the surface is created in window size)
*/
*
width
=
This
->
currentDesc
.
Width
;
*
height
=
This
->
currentDesc
.
Height
;
}
dlls/wined3d/wined3d_private.h
View file @
9bc6200e
...
...
@@ -1087,6 +1087,9 @@ struct IWineD3DSurfaceImpl
UINT
pow2Width
;
UINT
pow2Height
;
/* A method to retrieve the drawable size. Not in the Vtable to make it changeable */
void
(
*
get_drawable_size
)(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
/* Oversized texture */
RECT
glRect
;
...
...
@@ -1162,6 +1165,11 @@ void WINAPI IWineD3DBaseSurfaceImpl_BindTexture(IWineD3DSurface *iface);
const
void
*
WINAPI
IWineD3DSurfaceImpl_GetData
(
IWineD3DSurface
*
iface
);
void
get_drawable_size_swapchain
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_backbuffer
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_pbuffer
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_fbo
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
/* Surface flags: */
#define SFLAG_OVERSIZE 0x00000001
/* Surface is bigger than gl size, blts only */
#define SFLAG_CONVERTED 0x00000002
/* Converted for color keying or Palettized */
...
...
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