Now time for you to implement that Rendering State Machine by making some simple code changes to the source code of the Jigsaw Puzzle app. The optimization code changes include adding that state flag m_stateChanged as a member variable to the GameState class as well as some accessor and setter methods. Most of the code changes are properly setting the value of m_stateChanged to each input event handler i.e. OnPointerMoved. This is all done so you can add a simple if statement that dictates when to call Update, Draw and Present in order to change what is shown on screen.
- [Voiceover] The jigsaw puzzle app is…a DirectX universal app…which uses the common app run method.…It's inside this app run method…that the update in rendering occurs.…In this method, you can see that the app…doesn't care if the window is visible.…Update, Render, and Present are called…and this thing is continuously updated.…The first thing to point out here…is to pay attention to the API options you use.…I'm going to look at this ProcessEvents…which uses this ProcessAllIfPresent API option.…
This option does not block the thread.…It checks if there is an event to handle.…If there is not a user input,…it will return immediately.…When it returns, these three functions are called,…so do research on what the different API options are…to identify the best option for your scenario.…The first code change I'm going to make…is to change this ProcessAllIfPresent…to ProcessOneAndAllPending.…What this will do is check if there is a user input…and if there's not, it will keep waiting.…
It's going to block this thread,…meaning these three functions will not be called…
With these diagnostic tools and some efficient programming, you can reduce your app's power consumption while improving its response times. In this course, Thomas Pantels introduces a handful of tools used to measure and optimize power consumption. You will see demos on how to use the Intel Power Gadget, Windows Performance Toolkit, TypePerf, and SoC Watch, along with some simple coding tips for making any Windows app more energy efficient.
- Collecting and analyzing power data with Intel Power Gadget
- Implementing a rendering state machine
- Collecting and analyzing data with the Windows Performance Toolkit
- Understanding idle states, call stack walking, and thread activity
- Windows OS Timer Tick Resolution Rate change
- Optimization techniques to make your app power efficient
- Collecting, analyzing, and comparing data with Windows TypePerf and SoC Watch
Skill Level Intermediate
1. How to Use Intel Power Gadget
2. How to Use Windows Performance Toolkit
3. How to Use Windows Typeperf
4. How to Use Intel Energy Profiler SoC Watch
Next steps2m 27s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.