Changeset 657 for OGRE/trunk/ogre_changes/RenderSystems/Direct3D7
- Timestamp:
- 02/20/06 19:06:03 (19 years ago)
- Location:
- OGRE/trunk/ogre_changes/RenderSystems/Direct3D7
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
OGRE/trunk/ogre_changes/RenderSystems/Direct3D7/include/OgreD3D7RenderWindow.h
r153 r657 119 119 */ 120 120 void writeContentsToFile(const String& filename); 121 121 // DirectDraw Methods 122 void createDDSurfaces(void); 123 void releaseDDSurfaces(void); 124 void restoreDDSurfaces(void); 125 void createDepthBuffer(void); 122 126 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 123 127 uchar *getBufferContents(int &dimx, int &dimy); … … 159 163 LPDIRECT3DDEVICE7 mlpD3DDevice; 160 164 161 // DirectDraw Methods162 void createDDSurfaces(void);163 void releaseDDSurfaces(void);164 void restoreDDSurfaces(void);165 void createDepthBuffer(void);166 165 167 166 // Method for dealing with resize / move & 3d library -
OGRE/trunk/ogre_changes/RenderSystems/Direct3D7/include/OgreD3D7Texture.h
r154 r657 53 53 LPDIRECTDRAWSURFACE7 getDDSurface(void); 54 54 55 /// @copydoc Texture::createInternalResources56 void createInternalResources(void);57 58 55 /// @copydoc Texture::getBuffer 59 56 HardwarePixelBufferSharedPtr getBuffer(size_t face, size_t mipmap); … … 63 60 static PixelFormat closestD3DXFormat( PixelFormat format ); 64 61 static bool OgreFormat_to_DDPixelFormat( PixelFormat format, DDPIXELFORMAT & out ); 62 63 /// Restore this texture from a lost device 64 void restoreFromLostDevice(void); 65 65 66 protected: 66 67 IDirect3DDevice7 * mD3DDevice; ///< A pointer to the Direct3D device. … … 71 72 typedef std::vector<HardwarePixelBufferSharedPtr> SurfaceList; 72 73 SurfaceList mSurfaceList; 74 /// Are we restoring from a lost device? 75 bool mRestoring; 76 73 77 74 78 75 79 /// @copydoc Resource::loadImpl 76 80 void loadImpl(void); 77 /// @copydoc Resource::unloadImpl 78 void unloadImpl(void); 81 /// @copydoc Texture::createInternalResourcesImpl 82 void createInternalResourcesImpl(void); 83 /// @copydoc Resource::freeInternalResourcesImpl 84 void freeInternalResourcesImpl(void); 79 85 80 86 void createSurface2D(void); -
OGRE/trunk/ogre_changes/RenderSystems/Direct3D7/src/OgreD3D7RenderWindow.cpp
r153 r657 96 96 break; 97 97 98 case WM_MOVE:99 // Move messages need to be tracked to update the screen rects100 // used for blitting the backbuffer to the primary.101 if(win->mActive && win->mReady)102 win->windowMovedOrResized();103 break;104 105 98 case WM_ENTERSIZEMOVE: 106 99 // Prevent rendering while moving / sizing … … 113 106 break; 114 107 108 case WM_MOVE: 115 109 case WM_SIZE: 116 110 // Check to see if we are losing or gaining our window. Set the … … 391 385 void D3D7RenderWindow::swapBuffers(bool waitForVSync) 392 386 { 387 if (!mlpDDSFront) 388 return; 389 393 390 HRESULT hr; 394 391 DWORD flags; … … 423 420 { 424 421 // Restore surfaces 425 restoreDDSurfaces();422 //restoreDDSurfaces(); 426 423 } 427 424 else if (FAILED(hr)) … … 539 536 ddscaps.dwCaps = DDSCAPS_ZBUFFER; 540 537 538 if (!mlpDDSBack->IsLost()) 539 { 541 540 LPDIRECTDRAWSURFACE7 zBufSurface; 542 541 … … 546 545 zBufSurface->Release(); 547 546 zBufSurface->Release(); 547 } 548 548 549 549 // Release std buffers … … 563 563 564 564 if( FAILED( hr ) ) 565 { 566 if (hr == DDERR_WRONGMODE) 567 { 568 // Fullscreen exclusive mode problem 569 // Need to release & recreate 570 releaseDDSurfaces(); 571 createDDSurfaces(); 572 createDepthBuffer(); 573 return; 574 } 575 else 576 { 577 char szBuffer[512]; 578 D3DXGetErrorString( hr, 512, szBuffer ); 565 579 OGRE_EXCEPT( 566 580 Exception::ERR_INTERNAL_ERROR, 567 "Error restoring lost primary surface.",581 "Error restoring lost primary surface." + String(szBuffer), 568 582 "D3D7RenderWindow - restoreDDSurfaces" ); 569 583 } 584 } 585 } 570 586 571 587 if( mlpDDSBack->IsLost() ) … … 574 590 575 591 if( FAILED( hr ) ) 592 { 593 char szBuffer[512]; 594 D3DXGetErrorString( hr, 512, szBuffer ); 576 595 OGRE_EXCEPT( 577 596 Exception::ERR_INTERNAL_ERROR, 578 "Error restoring lost back buffer surface." ,597 "Error restoring lost back buffer surface." + String(szBuffer), 579 598 "D3D7RenderWindow - restoreDDSurfaces" ); 580 599 } 600 } 581 601 } 582 602 … … 592 612 ClientToScreen( mHWnd, (POINT*)&rcCheck.left ); 593 613 ClientToScreen( mHWnd, (POINT*)&rcCheck.right ); 614 615 if ((rcCheck.right - rcCheck.left) == 0 || 616 (rcCheck.bottom - rcCheck.top) == 0) 617 { 618 return; 619 } 594 620 595 621 // Has the window resized? If so, we need to recreate surfaces
Note: See TracChangeset
for help on using the changeset viewer.