Ignore:
Timestamp:
02/20/06 19:06:03 (18 years ago)
Author:
mattausch
Message:

added ogre dependencies and patched ogre sources

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OGRE/trunk/ogre_changes/RenderSystems/Direct3D9/src/OgreD3D9RenderWindow.cpp

    r193 r657  
    110110        D3D9RenderWindow::~D3D9RenderWindow() 
    111111        { 
    112                 // access and update device through driver, realse only primary 
    113                 if (!mIsSwapChain)  
    114                 { 
    115                         LPDIRECT3DDEVICE9 mpD3DDevice = mDriver->getD3DDevice(); 
    116                         SAFE_RELEASE( mpD3DDevice ); 
    117                         mDriver->setD3DDevice( NULL ); 
    118                 } 
     112                destroyD3DResources(); 
    119113        } 
    120114 
     
    342336                md3dpp.BackBufferHeight                 = mHeight; 
    343337 
    344 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    345         //md3dpp.Flags |= D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; 
    346 #endif 
    347338                if (mVSync) 
    348339                        md3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; 
     
    493484                        // ignore depth buffer, access device through driver 
    494485                        mpRenderZBuffer = 0; 
    495                         LPDIRECT3DDEVICE9 mpD3DDevice = mDriver->getD3DDevice(); 
    496                         SAFE_RELEASE(mpD3DDevice); 
    497                         mDriver->setD3DDevice(NULL); 
    498486                } 
    499487        } 
     
    727715                } 
    728716 
    729                 if (!mIsFullScreen) 
    730                 { 
    731                         POINT pt={0, 0}; 
     717                D3DLOCKED_RECT lockedRect; 
     718                if(mIsFullScreen) 
     719                { 
     720                        if (FAILED(hr = pTempSurf->LockRect(&lockedRect, NULL,  
     721                        D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK))) 
     722                        { 
     723                                OGRE_EXCEPT(hr, "can't lock rect!", "D3D9RenderWindow::writeContentsToFile"); 
     724                        }  
     725                } 
     726                else 
     727                { 
    732728                        RECT srcRect; 
    733729                        GetWindowRect(mHWnd, &srcRect); 
     
    735731                        desc.Width = srcRect.right - srcRect.left; 
    736732                        desc.Height = srcRect.bottom - srcRect.top; 
    737                         desc.Format = D3DFMT_A8R8G8B8;         // this is what we get from the screen, so stick with it 
    738  
    739                         // NB we can't lock the back buffer direct because it's no created that way 
    740                         // and to do so hits performance, so copy to another surface 
    741                         // Must be the same format as the source surface 
    742                         if (FAILED(hr = mpD3DDevice->CreateOffscreenPlainSurface( 
    743                                                         desc.Width,  
    744                                                         desc.Height,  
    745                                                         desc.Format,  
    746                                                         D3DPOOL_DEFAULT,  
    747                                                         &pSurf, 
    748                                                         NULL))) 
    749                         { 
    750                                 SAFE_RELEASE(pSurf); 
    751                                 OGRE_EXCEPT(hr, "Cannot create offscreen buffer 2!", "D3D9RenderWindow::writeContentsToFile"); 
    752                         } 
    753  
    754                         // Copy 
    755                         if (FAILED(hr = mpD3DDevice->UpdateSurface(pTempSurf, &srcRect, pSurf, &pt))) 
    756                         { 
    757                                 SAFE_RELEASE(pTempSurf); 
    758                                 SAFE_RELEASE(pSurf); 
    759                                 OGRE_EXCEPT(hr, "Cannot update surface!", "D3D9RenderWindow::writeContentsToFile"); 
    760                         } 
    761  
    762                         SAFE_RELEASE(pTempSurf); 
    763                         pTempSurf = pSurf; 
    764                         pSurf = NULL; 
    765                 } 
    766  
    767                 D3DLOCKED_RECT lockedRect; 
    768                 if (FAILED(hr = pTempSurf->LockRect(&lockedRect, NULL,  
     733 
     734                        if (FAILED(hr = pTempSurf->LockRect(&lockedRect, &srcRect,  
     735 
    769736                        D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK))) 
    770737                { 
    771738                        OGRE_EXCEPT(hr, "can't lock rect!", "D3D9RenderWindow::writeContentsToFile"); 
    772739                }  
     740                } 
    773741 
    774742        ImageCodec::ImageData *imgData = new ImageCodec::ImageData(); 
Note: See TracChangeset for help on using the changeset viewer.