How is GUI and Game Program Flow compared to Web programs

前端 未结 3 1547
粉色の甜心
粉色の甜心 2020-12-31 23:44

I\'ve been developing Web applications for a while now and have dipped my toe into GUI and Game application development.

In the web application (php for me), a reque

3条回答
  •  长发绾君心
    2021-01-01 00:20

    For applications and to a lesser extent Games the software is event driven. The user does "something" with the keyboard or mouse and that event is sent to the rest of the software.

    In Games the Game Loop is important because is focused on processing the screen and the game state. With many Games needing real time performance. With modern 3D Graphics API much of the screen processing is able to be dumped onto the GPU. However the Game State is tracked by the main loop. Much of the effort of a team for a game is focused on making the processing of the loop very smooth.

    For application typically heavy processing is spawned on onto a thread. It is a complex subject because of the issues surrounding two things trying to access the same data. There are whole books on the subject.

    For applications the sequence is

    1. user does X, X and associated information (like X,Y coordinates) is sent to the UI_Controller.
    2. The UI decides which command to execute.
    3. The Command is Executed.
    4. The model/data is modified.
    5. The Command tells the UI_Controller to update various areas of the UI.
    6. The UI_Controller redraws the UI.
    7. The Command returns.
    8. The Application waits for the next event.

    There are several variants of this. The model can allow listeners to wait for changes in the data. When the data the listener execute and redraws the UI.

提交回复
热议问题