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
99d3c621
Commit
99d3c621
authored
Jan 13, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix surface creation error handling.
parent
2654a148
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
25 deletions
+34
-25
device.c
dlls/wined3d/device.c
+34
-25
No files found.
dlls/wined3d/device.c
View file @
99d3c621
...
...
@@ -662,7 +662,31 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
return
WINED3DERR_OUTOFVIDEOMEMORY
;
}
object
->
lpVtbl
=
&
IWineD3DSurface_Vtbl
;
/* Look at the implementation and set the correct Vtable */
switch
(
Impl
)
{
case
SURFACE_OPENGL
:
/* Check if a 3D adapter is available when creating gl surfaces */
if
(
!
This
->
adapter
)
{
ERR
(
"OpenGL surfaces are not available without opengl
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
WINED3DERR_NOTAVAILABLE
;
}
object
->
lpVtbl
=
&
IWineD3DSurface_Vtbl
;
break
;
case
SURFACE_GDI
:
object
->
lpVtbl
=
&
IWineGDISurface_Vtbl
;
break
;
default:
/* To be sure to catch this */
ERR
(
"Unknown requested surface implementation %d!
\n
"
,
Impl
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
WINED3DERR_INVALIDCALL
;
}
hr
=
resource_init
(
&
object
->
resource
,
WINED3DRTYPE_SURFACE
,
This
,
Size
,
Usage
,
Format
,
Pool
,
parent
);
if
(
FAILED
(
hr
))
{
...
...
@@ -745,34 +769,19 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
This
,
Width
,
Height
,
Format
,
debug_d3dformat
(
Format
),
(
WINED3DFMT_D16_LOCKABLE
==
Format
),
*
ppSurface
,
object
->
resource
.
allocatedMemory
,
object
->
resource
.
size
);
/* Look at the implementation and set the correct Vtable */
switch
(
Impl
)
{
case
SURFACE_OPENGL
:
/* Check if a 3D adapter is available when creating gl surfaces */
if
(
!
This
->
adapter
)
{
ERR
(
"OpenGL surfaces are not available without opengl
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
->
resource
.
allocatedMemory
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
WINED3DERR_NOTAVAILABLE
;
}
break
;
case
SURFACE_GDI
:
object
->
lpVtbl
=
&
IWineGDISurface_Vtbl
;
break
;
default:
/* To be sure to catch this */
ERR
(
"Unknown requested surface implementation %d!
\n
"
,
Impl
);
IWineD3DSurface_Release
((
IWineD3DSurface
*
)
object
);
return
WINED3DERR_INVALIDCALL
;
}
list_init
(
&
object
->
renderbuffers
);
/* Call the private setup routine */
return
IWineD3DSurface_PrivateSetup
(
(
IWineD3DSurface
*
)
object
);
hr
=
IWineD3DSurface_PrivateSetup
((
IWineD3DSurface
*
)
object
);
if
(
FAILED
(
hr
))
{
ERR
(
"Private setup failed, returning %#x
\n
"
,
hr
);
IWineD3DSurface_Release
(
*
ppSurface
);
*
ppSurface
=
NULL
;
return
hr
;
}
return
hr
;
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateTexture
(
IWineD3DDevice
*
iface
,
UINT
Width
,
UINT
Height
,
UINT
Levels
,
...
...
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