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

added ogre dependencies and patched ogre sources

Location:
OGRE/trunk/ogre_changes/RenderSystems/Direct3D9
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • OGRE/trunk/ogre_changes/RenderSystems/Direct3D9/include/OgreD3D9HardwareOcclusionQuery.h

    r115 r657  
    3434 
    3535// If you use multiple rendering passes you can test only the first pass and all other passes don't have to be rendered  
    36         // if the first pass resultet has too few pixels visible. 
     36        // if the first pass results has too few pixels visible. 
    3737 
    38 // Be sure to render all occlluder first and whats out so the RenderQue don't switch places on  
     38        // Be sure to render all occluder first and whats out so the RenderQue don't switch places on  
    3939// the occluding objects and the tested objects because it thinks it's more effective.. 
    4040 
     
    4646        * 
    4747        * Updated on 12/7/2004 by Chris McGuirk 
     48        * Updated on 4/8/2005 by Tuan Kuranes email: tuan.kuranes@free.fr 
    4849  */ 
    4950class D3D9HardwareOcclusionQuery : public HardwareOcclusionQuery 
     
    7374                bool pullOcclusionQuery( unsigned int* NumOfFragments, const HW_OCCLUSIONQUERY flag = HWOCCLUSIONQUERY_FLUSH); 
    7475                unsigned int getLastQuerysPixelcount() { return mPixelCount; } 
     76        bool isStillOutstanding(void); 
    7577 
    7678                // These functions are optional, it's a simple filter that simply skips some hardware occlusion tests on visible objects only 
     
    8284          *    
    8385                * Remarks This function allows you to set how often the hardware occlusion query is sent to the driver 
    84           * if you set it to 0 every hw occlusion test is acctually made. If you set it to 1 only the half of your queries are sent  
    85                 * 2 will result in 25% of all queries to acctualy be sent.  
     86                * if you set it to 0 every hardware occlusion test is actually made. If you set it to 1 only the half of your queries are sent  
     87                * 2 will result in 25% of all queries to factually be sent.  
    8688                * This functionality is here because this class can keep track on visible and none visible objects for you. 
    8789          * Once you you set the SkipRate for any hardware occlusion instance it effects all others. 
    8890          */ 
    8991 
    90                 void setSkipRate( int skip ) { mSkipInterval = skip; }                  // Using 2 only 50 % of the tests are actully made and 3 results in only 33% of the tests. So on. 
     92                void setSkipRate( int skip ) { mSkipInterval = skip; }                  // Using 2 only 50 % of the tests are actually made and 3 results in only 33% of the tests. So on. 
    9193                int      getSkipRate() { return mSkipInterval; }  
    9294 
     
    105107                int                                     mSkipInterval; 
    106108                bool                            mHasOcclusionSupport; 
     109                bool                            mIsQueryResultStillOutstanding; 
    107110}; 
    108111 
  • OGRE/trunk/ogre_changes/RenderSystems/Direct3D9/include/OgreD3D9Texture.h

    r193 r657  
    6868                /// device capabilities pointer 
    6969                D3DCAPS9                                                mDevCaps; 
    70         // Auto-generated mipmaps? 
    71         bool                            mAutoGenMipmaps; 
    7270                // Dynamic textures? 
    7371                bool                            mDynamicTextures; 
     
    9593                D3DFORMAT _chooseD3DFormat(); 
    9694 
    97                 /// internal method, free D3D9 resources 
    98                 void _freeResources(); 
     95                /// @copydoc Texture::createInternalResourcesImpl 
     96                void createInternalResourcesImpl(void); 
     97                /// free internal resources 
     98                void freeInternalResourcesImpl(void); 
    9999                /// internal method, set Texture class source image protected attributes 
    100100                void _setSrcAttributes(unsigned long width, unsigned long height, unsigned long depth, PixelFormat format); 
     
    116116                /// internal method, create D3D9HardwarePixelBuffers for every face and 
    117117                /// mipmap level. This method must be called after the D3D texture object was created 
    118                 void _createSurfaceList(bool updateOldList=false); 
     118                void _createSurfaceList(void); 
    119119 
    120120        /// overriden from Resource 
    121121        void loadImpl(); 
    122         /// overriden from Resource 
    123         void unloadImpl(); 
    124122        public: 
    125123                /// constructor  
     
    135133                void loadImage( const Image &img ); 
    136134 
    137         /// @copydoc Texture::createInternalResources 
    138         void createInternalResources(void); 
    139135 
    140136                /// @copydoc Texture::getBuffer 
  • OGRE/trunk/ogre_changes/RenderSystems/Direct3D9/src/OgreD3D9HardwareOcclusionQuery.cpp

    r193 r657  
    113113        // This version of pullOcclusionQuery causes the DX9 API/Driver to not flush all commands to the 3D card 
    114114// to allow a fast result from the query, but the batching of API calls to the card will be normal.  
    115         // But the query wont be processed until the card recives the query in the next batch. 
     115        // But the query wont be processed until the card receives the query in the next batch. 
    116116// Note: OpenGL dosn't use this flag at all so the application running OpenGL won't display any different behaviour. 
    117117//-- 
  • 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.