|
2 | 2 |
|
3 | 3 | ## Introduction |
4 | 4 |
|
5 | | -SimpleGraphic.dll is the host environment for Lua. It contains the API used by the application's Lua logic, as well as a 2D OpenGL renderer, window management, input handling, and a debug console. It exports one symbol, RunLuaFileAsWin, which is passed a C-style argc/argv argument list, with the script path as argv[0]. |
| 5 | +`SimpleGraphic.dll` is the host environment for Lua. |
| 6 | +It contains the API used by the application's Lua logic, as well as a 2D OpenGL |
| 7 | +renderer, window management, input handling, and a debug console. |
| 8 | +It exports one symbol, `RunLuaFileAsWin`, which is passed a |
| 9 | +C-style argc/argv argument list, with the script path as `argv[0]`. |
6 | 10 |
|
7 | 11 | The Windows-specific code is contained in 5 files: |
8 | | -- win\entry.cpp: Contains the DLL export. It just creates the system main module, and runs it. |
9 | | -- engine\system\win\sys_main.cpp: The system main module; it initialises the application, and contains generic OS interface functions, such as input and clipboard handling. |
10 | | -- engine\system\win\sys_console.cpp: Manages the debug console window that appears during the program's initialisation. |
11 | | -- engine\system\win\sys_video.cpp: Creates and manages the main program window. |
12 | | -- engine\system\win\sys_opengl.cpp: Initialises OpenGL. |
| 12 | +- `win\entry.cpp`: Contains the DLL export |
| 13 | +It just creates the system main module, and runs it |
| 14 | +- `engine\system\win\sys_main.cpp`: The system main module. |
| 15 | +It initialises the application, and contains generic OS interface functions, |
| 16 | +such as input and clipboard handling |
| 17 | +- `engine\system\win\sys_console.cpp`: Manages the debug console window that |
| 18 | +appears during the program's initialisation |
| 19 | +- `engine\system\win\sys_video.cpp`: Creates and manages the main program window |
| 20 | +- `engine\system\win\sys_opengl.cpp`: Initialises OpenGL |
13 | 21 |
|
14 | 22 | ## Building |
15 | 23 |
|
16 | | -SimpleGraphic.dll is currently built using Visual Studio 2019. |
| 24 | +`SimpleGraphic.dll` is currently built using Visual Studio 2019. |
17 | 25 |
|
18 | | -The dll depends on a number of 3rd party libraries. Details and instructions for how to obtain them are in DEPENDENCIES.md. |
| 26 | +The DLL depends on a number of 3rd-party libraries. Details and instructions |
| 27 | +for how to obtain them are in [DEPENDENCIES.md](DEPENDENCIES.md). |
19 | 28 |
|
20 | 29 | Once the libraries are obtained, follow these instructions to build the DLL: |
21 | | -1) Open SimpleGraphic.sln in Visual Studio 2019 |
22 | | -2) Choose the `Release|x86` configuration. |
| 30 | +1) Open `SimpleGraphic.sln` in Visual Studio 2019 |
| 31 | +2) Choose the "Release|x86" configuration |
23 | 32 | 3) Build the solution |
24 | | -4) The resulting `SimpleGraphic.dll` can be found in the `Release` directory. |
25 | | -5) Copy `SimpleGraphic.dll` to the Path of Building install directory, replacing the existing file. |
| 33 | +4) The resulting `SimpleGraphic.dll` can be found in the `Release` directory |
| 34 | +5) Copy `SimpleGraphic.dll` to the Path of Building install directory, |
| 35 | +replacing the existing file. |
26 | 36 |
|
27 | 37 | ## Debugging |
28 | 38 |
|
29 | | -Since SimpleGraphic.dll is dynamically loaded by `PathOfBuilding.exe`, to debug it, run `PathOfBuilding.exe` and then attach to that process using the `Debug->Attach to Process...` menu option in Visual Studio. |
| 39 | +Since SimpleGraphic.dll is dynamically loaded by `PathOfBuilding.exe`, |
| 40 | +to debug it, run `PathOfBuilding.exe` and then attach to that process using the |
| 41 | +"Debug" > "Attach to Process..." menu option in Visual Studio. |
30 | 42 |
|
31 | | -If debugging of the initialization is desired, then adding a MessageBox or some other pause at the start will give you time to attach and continue. |
| 43 | +If debugging of the initialization is desired, then adding a `MessageBox` |
| 44 | +or some other pause at the start will give you time to attach and continue. |
0 commit comments