Advertisement
| 10.07.2008 at 08:15AM PDT, ID: 23794038 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: |
if( m_bDeviceLost == true )
{
// Yield some CPU time to other processes
Sleep( 100 ); // 100 milliseconds
// Test the cooperative level to see if it's okay to render.
// The application can determine what to do on encountering a lost
// device by querying the return value of the TestCooperativeLevel
// method.
//
if( FAILED( hr = m_device->TestCooperativeLevel() ) )
{
// The device has been lost but cannot be reset at this time.
// Therefore, rendering is not possible and we'll have to return
// and try again at a later time.
if( hr == D3DERR_DEVICELOST )
return S_OK;
// The device has been lost but it can be reset at this time.
if( hr == D3DERR_DEVICENOTRESET )
{
//
// If the device can be restored, the application prepares the
// device by destroying all video-memory resources and any
// swap chains.
//
// delete all Direct3D objects except IDirect3D9 and IDirect3DDevice9
DeleteDirect3D( true );
//
// Then, the application calls the Reset method.
//
// Reset is the only method that has an effect when a device
// is lost, and is the only method by which an application can
// change the device from a lost to an operational state.
// Reset will fail unless the application releases all
// resources that are allocated in D3DPOOL_MANAGED, including
// those created by the IDirect3DDevice9::CreateRenderTarget
// and IDirect3DDevice9::CreateDepthStencilSurface methods.
//
hr = m_device->Reset( &m_pp );
if( FAILED(hr ) )
return S_OK;
//
// Finally, a lost device must re-create resources (including
// video memory resources) after it has been reset.
//
InitResources();
// Init(m_window, m_width, m_height, m_fontName, m_fontSizee);
m_init = true;
StringMap tmp = _T("");
InitScene( true, true, tmp);
m_init = false;
}
return S_OK;
}
m_bDeviceLost = false;
}
|
| Answered By: | jgordos |
| Expert Since: | 06/06/2005 |
| Accepted Solutions: | 114 |
| Computer Expertise: | Guru |
| Education: | Ohio University, Bachelor's Degree |
Advertisement