From dd8d7751d1ad84b916d5eb4a7c927dd8c90cf406 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 10 Dec 2006 19:36:56 +0000 Subject: [PATCH] A win bug fix --- osdwin.cc | 16 ++++++++++++++-- osdwin.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/osdwin.cc b/osdwin.cc index 7d89c79..58cf1ef 100644 --- a/osdwin.cc +++ b/osdwin.cc @@ -38,6 +38,7 @@ OsdWin::OsdWin() d3drtsurf=NULL; external_driving=false; dsallocator=NULL; + filter_type=D3DTEXF_NONE; lastrendertime=timeGetTime(); event = CreateEvent(NULL,/*FALSE*/TRUE,FALSE,NULL); d3dmutex = CreateMutex(NULL,FALSE,NULL); @@ -86,6 +87,18 @@ int OsdWin::init(void* device) Log::getInstance()->log("OSD", Log::WARN, "Could not create Direct3D9 vertex buf!"); return 0; } + /* We have to determine which kind of filtering is supported*/ + D3DCAPS9 caps; + d3ddevice->GetDeviceCaps(&caps); + filter_type=D3DTEXF_NONE; + if ( ((caps.StretchRectFilterCaps & D3DPTFILTERCAPS_MINFPOINT)!=0) + && ((caps.StretchRectFilterCaps & D3DPTFILTERCAPS_MAGFPOINT)!=0)) { + filter_type=D3DTEXF_POINT; + } + if ( ((caps.StretchRectFilterCaps & D3DPTFILTERCAPS_MINFLINEAR)!=0) + && ((caps.StretchRectFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR)!=0)) { + filter_type=D3DTEXF_LINEAR; + } //Now we will create the Screen screen = new SurfaceWin(Surface::SCREEN); @@ -224,8 +237,7 @@ void OsdWin::InternalRendering(LPDIRECT3DSURFACE9 present){ sourcerect.left=(surf_desc.Width-correction)/2; sourcerect.right=sourcerect.left+correction; } - - d3ddevice->StretchRect(present,&sourcerect,d3drtsurf ,&destrect,D3DTEXF_LINEAR); + d3ddevice->StretchRect(present,&sourcerect,d3drtsurf ,&destrect,filter_type); } } else { VideoWin* video =(VideoWin*) Video::getInstance(); diff --git a/osdwin.h b/osdwin.h index e52dc76..05505e3 100644 --- a/osdwin.h +++ b/osdwin.h @@ -77,6 +77,7 @@ private: int InitVertexBuffer(); OSDVERTEX osdvertices[4]; HANDLE event; + D3DTEXTUREFILTERTYPE filter_type; }; #endif -- 2.39.5