Previous 199869 Revisions Next

r20095 Sunday 6th January, 2013 at 00:28:22 UTC by Ryan Holtz
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]
[src/osd/windows]drawd3d.c

trunk/src/osd/windows/drawd3d.c
r20094r20095
787787      }
788788   }
789789
790   if (d3d->default_bitmap.valid())
791   {
792      render_texinfo texture;
793
794      // fake in the basic data so it looks like it came from render.c
795      texture.base = d3d->default_bitmap.raw_pixptr(0);
796      texture.rowpixels = d3d->default_bitmap.rowpixels();
797      texture.width = d3d->default_bitmap.width();
798      texture.height = d3d->default_bitmap.height();
799      texture.palette = NULL;
800      texture.seqid = 0;
801
802      // now create it
803      d3d->default_texture = texture_create(d3d, &texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32));
804   }
805
806790   int ret = d3d->hlsl->create_resources(false);
807791   if (ret != 0)
808792       return ret;
r20094r20095
871855   result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
872856   result = (*d3dintf->device.present)(d3d->device, NULL, NULL, NULL, NULL, 0);
873857
858   if (d3d->default_bitmap.valid())
859   {
860      render_texinfo texture;
861
862      // fake in the basic data so it looks like it came from render.c
863      texture.base = d3d->default_bitmap.raw_pixptr(0);
864      texture.rowpixels = d3d->default_bitmap.rowpixels();
865      texture.width = d3d->default_bitmap.width();
866      texture.height = d3d->default_bitmap.height();
867      texture.palette = NULL;
868      texture.seqid = 0;
869
870      // now create it
871      d3d->default_texture = texture_create(d3d, &texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32));
872   }
873
874874   // experimental: if we have a vector bitmap, create a texture for it
875875   if (d3d->vector_bitmap.valid())
876876   {
r20094r20095
952952   d3d->vertexbuf = NULL;
953953
954954   global_free(d3d->default_texture);
955   d3d->default_texture = NULL;
955956}
956957
957958

Previous 199869 Revisions Next


© 1997-2024 The MAME Team