A Rendering State Machine will be used to determine when the Jigsaw Puzzle application updates and presents a new frame to the user (visually the scene changes). In short, the game will update or do nothing (no updates of any kind) depending on the state the game is in. This game state is determined by the introduction of a state variable called m_stateChanged and this flag determines what state the game transitions between. There are 2 states that are discussed in this video, the Idle State (no updates of any kind) and the Render State (update, draw, present new frames).
- [Voiceover] To optimize the Jigsaw Puzzle application…so that it consumes less power…I'm going to take a look…at how the app currently renders frames.…Right now, as you can see,…from this state diagram,…the Jigsaw Puzzle application renders regardless…of if there is user input or not.…Even when it's in an idle state,…it will call, update, render, and present.…The application is power-hungry…because these functions are being called…in the idle state.…To address this, I'm going to add a rendering state machine.…
I'm going to make changes to the code…so that frames are only rendered based on a flag value.…This state diagram shows the changes…that I'm going to make.…The flag value is this m_stateChanged.…Whenever a mouseclick or a user input of any kind happens,…this m_stateChanged flag will be set to true…inside that user event handler.…This will then trigger the game state…from the idle state where there are no user inputs.…The timer won't even update.…
This is a design decision.…The game state will then transition…
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.