I read several chapters in the book and repeatedly talked about the directdraw principle. Here I will use my own understanding to talk about this principle, which will facilitate future review. Now there may be many errors and vulnerabilities, later discovery is an improvement.
First, you need to understand the drawing and animation production principles of directdraw. First look at the figure below:
Here, DX divides our plotting process into three planes. First, we assemble the plot elements in the C plane into an image and then put them in the B plane, the B plane is exchanged with the plane, and the B plane is pushed to the screen for display. At the same time, the C plane re-assembles the next image, and then puts the assembled finished image into the plane, after switching between A and B, the image is changed, and the animation is realized by repeating the action.
The elements assembled on C include backgrounds, characters, and animations. Of course, sometimes they can be directly moved to the plane behind the scenes for assembly, thus saving the C plane.
This is generally the case. We need to continue learning and find a problem in the routine we see,
The following error occurs during running.
DDERR_NOCOOPERATIVELEVELSET
(Error code 0x887600D4)
Find only one webpage that does not know what text it is, as shown below:
DDERR_NOCOOPERATIVELEVELSET
(00000000000000000x887600d4)
Please refer to the following link for more information: zookeeper has been added when SetCooperativeLevel.
After painstaking efforts, we found that before applying the directdraw object, in addition to instantiation, we had to set the SetCooperativeLevel and tie the sentence of its draw carrier to the object.
TMD spent money to buy a book, and the routine actually saves this step, not to mention.