uint32_t surfaceHeight,
uint32_t horizontalDpi,
uint32_t verticalDpi,
- bool initialize )
+ bool initialize,
+ bool enablePartialUpdate )
: mCore( NULL ),
mSurfaceWidth( surfaceWidth ),
mSurfaceHeight( surfaceHeight ),
mFrame( 0u ),
mDpi{ horizontalDpi, verticalDpi },
- mLastVSyncTime(0u)
+ mLastVSyncTime(0u),
+ mPartialUpdateEnabled(enablePartialUpdate)
{
if( initialize )
{
mGlContextHelperAbstraction,
Integration::RenderToFrameBuffer::FALSE,
Integration::DepthBufferAvailable::TRUE,
- Integration::StencilBufferAvailable::TRUE );
+ Integration::StencilBufferAvailable::TRUE,
+ mPartialUpdateEnabled ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE );
mCore->ContextCreated();
mRenderStatus.SetNeedsPostRender( false );
mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
- mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/);
- mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/);
+ mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ );
+ mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ );
mCore->PostRender( false /*do not skip rendering*/ );
mFrame++;
return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
}
+bool TestApplication::PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects)
+{
+ DoUpdate(intervalMilliseconds, location);
+
+ mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
+ mCore->PreRender(mScene, damagedRects);
+
+ return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
+}
+
+bool TestApplication::RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect)
+{
+ mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/, clippingRect);
+ mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/, clippingRect);
+ mCore->PostRender(false /*do not skip rendering*/);
+
+ mFrame++;
+
+ return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
+}
+
uint32_t TestApplication::GetUpdateStatus()
{
return mStatus.KeepUpdating();
{
// Update Time values
mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
- mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/);
- mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/);
+ mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ );
+ mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ );
mCore->PostRender( false /*do not skip rendering*/ );
mFrame++;
uint32_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
uint32_t horizontalDpi = DEFAULT_HORIZONTAL_DPI,
uint32_t verticalDpi = DEFAULT_VERTICAL_DPI,
- bool initialize = true );
+ bool initialize = true,
+ bool enablePartialUpdate = false );
void Initialize();
void CreateCore();
void ProcessEvent(const Integration::Event& event);
void SendNotification();
bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
+ bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
+ bool RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
uint32_t GetUpdateStatus();
bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
bool RenderOnly( );
struct { uint32_t x; uint32_t y; } mDpi;
uint32_t mLastVSyncTime;
+ bool mPartialUpdateEnabled;
static bool mLoggingEnabled;
};