Several layers, slow down, write code.

xiaoxiao2021-03-06  48

I have seen a sentence when the Chinese is still studying algorithms, thinking about using a list or what is still what is still, the Indian has begun to open a large number in writing code. . . Yes, it is very important, but you must first plan, and then, I am a software engineering, so I have to do this sooner or later, first skilled. The game can be divided into several relative independent layers, respectively, respectively, respectively, and combine. Master process: -------------------------------------- Initialize graphics mode read resources, Data cycle () {update user input, mouse state (); queue / immediately handle user command (); [Network Communication Send Command] interface, object message processing (); redraw update buffer page (); turn page (); Graphic engine layer. DirectX initialization, color, size, full screen / window mode selection, and dynamic switching, etc. General BLT, BLTFAST post, tied posts, alpha posts, etc. The construction of the package DirectDrawSurface, as well as bitmap, JPEG map resource read, and more. User interface layer. Label object: Directly in the formulation of Textout, no user commands. . Card Object: Directly in the formulation of the location, do not respond to user commands. . Animated object: [Inherited Dories] Read animation bitmaps, updates the animation status, and does not respond to user commands. . Button Object: [Inherited Window] Responds to the user command (). . Input box: [Inherited window] Maintains the input box's own string variable, background color (transparent), frame color, etc. . Scroll bar: [Inherited Window] Maintains the maximum minimum value of the scroll bar, current value, scrolling position, , - command, Skin. . Window Object: [Inherited Animation] Maintenance Sub-window Location, Skin function (title bar, left border, left top angle, left bottom, right box, right corner, right bottom corner, lower border), respond to user commands. . Dialog: [Inherited Window] Dialogue content, dialog button, response returns, automatic adjustment size, SKIN support. . Desktop object: Maintenance focus location, drag and drop, drag target, drag status, etc. Among them, it is possible to establish a multilateral area optional. User commands include: dragging movement, activation, loss of focus, mouse over, mouse click, mouse double-click, mouse wheel. . Network communication layer. Socket is initialized to establish a connection. Package and send of the package command. The reception of the packet, the command interpretation, and the data command response returns. Enter the control layer. Initialization of DirectInput. Update sound effect layer of keyboard and mouse state. Initialization of DirectSound. Play, decoding, etc.

转载请注明原文地址:https://www.9cbs.com/read-60199.html

New Post(0)