summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Ryan Holtz <rholtz@batcountryentertainment.com>2013-01-06 00:28:22 +0000
committer Ryan Holtz <rholtz@batcountryentertainment.com>2013-01-06 00:28:22 +0000
commitb41802d6ce8657ac1033dbbecac9e98a701791ae (patch)
treee149ed8e5010002448bf340394fdd00b74b9327d /src
parent2e6443a49f4ead8933f662c6cb69a22f5b286505 (diff)
01234567890123456789012345678901234567890123456789012345678901234567890123456789
- drawd3d.c: Move default_texture creation into device_create_resources. Should fix intermittent crashes when alt-tabbing back to a full-screen instance of MAME. [MooglyGuy]
Diffstat (limited to 'src')
-rw-r--r--src/osd/windows/drawd3d.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c
index ac9efa6a2aa..1b3a28c6238 100644
--- a/src/osd/windows/drawd3d.c
+++ b/src/osd/windows/drawd3d.c
@@ -787,22 +787,6 @@ try_again:
}
}
- if (d3d->default_bitmap.valid())
- {
- render_texinfo texture;
-
- // fake in the basic data so it looks like it came from render.c
- texture.base = d3d->default_bitmap.raw_pixptr(0);
- texture.rowpixels = d3d->default_bitmap.rowpixels();
- texture.width = d3d->default_bitmap.width();
- texture.height = d3d->default_bitmap.height();
- texture.palette = NULL;
- texture.seqid = 0;
-
- // now create it
- d3d->default_texture = texture_create(d3d, &texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32));
- }
-
int ret = d3d->hlsl->create_resources(false);
if (ret != 0)
return ret;
@@ -871,6 +855,22 @@ static int device_create_resources(d3d_info *d3d)
result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
result = (*d3dintf->device.present)(d3d->device, NULL, NULL, NULL, NULL, 0);
+ if (d3d->default_bitmap.valid())
+ {
+ render_texinfo texture;
+
+ // fake in the basic data so it looks like it came from render.c
+ texture.base = d3d->default_bitmap.raw_pixptr(0);
+ texture.rowpixels = d3d->default_bitmap.rowpixels();
+ texture.width = d3d->default_bitmap.width();
+ texture.height = d3d->default_bitmap.height();
+ texture.palette = NULL;
+ texture.seqid = 0;
+
+ // now create it
+ d3d->default_texture = texture_create(d3d, &texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32));
+ }
+
// experimental: if we have a vector bitmap, create a texture for it
if (d3d->vector_bitmap.valid())
{
@@ -952,6 +952,7 @@ static void device_delete_resources(d3d_info *d3d)
d3d->vertexbuf = NULL;
global_free(d3d->default_texture);
+ d3d->default_texture = NULL;
}