You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/manual_gamedev_101.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ During initialization, the goal is to setup the window and load the resources. A
28
28
29
29
Window creation is the easiest part. Generally, you have to *provide a title and an initial size* for the window. The initial size of the window can take into account the size of the display or be large enough for the majority of configurations footnote:[You can check the link:https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam[Steam Hardware and Software Survey] for example]. At the time of writing, with an initial size of stem:[1360 \times 768], you target more than 98% of the users and with an initial size of stem:[1600 \times 900], you target more than 90% of the users. Moreover, you can set some properties of the window: the window may not be resizable, in this case you should provide a way to make the window fullscreen and back; or the window may not be decorated, in this case the window title bar disappears, especially the button to close the window, you may want to allow the user to close the window inside the game.
30
30
31
-
After the window is created, it's time to *load the resources* the game needs. Or at least you have to load enough resources for your game to start (e.g. a splash screen for the background and a font to display some information to the user). When you work on a _small_ game, you can load all the resources in the initialization phase. All your first games will be _small_, many of your subsequent games will be _small_. And by the time you hit the limit, say more than one second to load all the resources, you will understand how to load the resources asynchronously (see the next section).
31
+
After the window is created, it's time to *load the resources* the game needs. Or at least you have to load enough resources for your game to start (e.g. a splash screen for the background and a font to display some information to the user). When you work on a _small_ game, you can load all the resources in the initialization phase. All your first games will be _small_, many of your subsequent games will be _small_. And by the time you hit the limit, say more than one second to load all the resources, you will understand how to load the resources asynchronously.
32
32
33
33
What resources? Well, basically everything. Images must be loaded and transfered in the GPU memory: they are then called textures. Fonts must be loaded in the main memory, ready to be used for text rendering. Sounds must be loaded in the main memory, ready to be played. And then, all the game-related data must be loaded: levels, maps, characters, quests, etc. Depending on your game, that can be a short list or a very long list.
34
34
@@ -60,7 +60,7 @@ At the start of the drawing, you *choose a clear color*. It's a color that is us
60
60
61
61
Then, when you draw your entities, you have to *be very careful about the order*. In 3D, you can use link:https://en.wikipedia.org/wiki/Z-buffering[z-buffering] for not drawing parts that are hidden behind other parts. In 2D, you must often do it yourself and order your entities accordingly. You start with the entities in the background and you finish with the entities on the foreground. This may be quite difficult in certain circumstances, especially in link:https://en.wikipedia.org/wiki/2.5D[2.5D].
62
62
63
-
When you draw something, it's not put on the window surface immediately. In most cases, link:https://en.wikipedia.org/wiki/Multiple_buffering[multiple buffering] is used to prevent flicker or tearing. Your drawing commands arrive in a back buffer. Then, when you have finished, you exchange the front buffer with a back buffer and you can start to draw the next frame.
63
+
When you draw something, it's not put on the window surface immediately. In most cases, link:https://en.wikipedia.org/wiki/Multiple_buffering[multiple buffering] is used to prevent flicker or tearing. Your drawing commands arrive in a back buffer. Then, when you have finished, the front buffer is exchanged with a back buffer and you can start to draw the next frame.
0 commit comments