Skip to content

Commit 9685849

Browse files
committed
Use enet for networking
1 parent c1e5a9f commit 9685849

File tree

11 files changed

+8907
-893
lines changed

11 files changed

+8907
-893
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.15)
2-
project(sharedgl VERSION 0.8.0 LANGUAGES C)
2+
project(sharedgl VERSION 0.9.0 LANGUAGES C)
33

44
include_directories(${CMAKE_SOURCE_DIR}/inc)
55

README.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ Variables labeled with `host` get their values from the host/server when their o
112112
| **Option** | **Legal values** | **Default** | **Description** |
113113
|-|-|-|-|
114114
| SGL_WINED3D_DONT_VFLIP | Boolean | false | If running a DirectX application via WineD3D, ensure this variable is set to `true` in order for the application to render the framebuffer in the proper orientation. Only available for Windows clients. |
115-
| SGL_RUN_WITH_LOW_PRIORITY | Boolean | false | On single core setups, by setting the process priority to low / `IDLE_PRIORITY_CLASS`, applications will run smoother as the kernel driver is given more CPU time. Users should only set this to `true` if the VM has only a single VCPU. Only available for Windows clients. |
115+
| SGL_NETWORK_ENDPOINT | Ip:Port | | If networking is enabled, this environment variable must exist on the guest. Available for both Windows and Linux clients. |
116+
| SGL_RUN_WITH_LOW_PRIORITY | Boolean | false | Potentially imrpove performance by setting the process priority to low / `IDLE_PRIORITY_CLASS`; applications will run smoother as the kernel is given more CPU time. This benefits those with a VCPU count lower than the hosts or if using the network feature. Only available for Windows clients. |
116117
| GL_VERSION_OVERRIDE | Digit.Digit | `host` | Override the OpenGL version on the client side. Available for both Windows and Linux clients. |
117118
| GLX_VERSION_OVERRIDE | Digit.Digit | 1.4 | Override the GLX version on the client side. Only available for Linux clients. |
118119
| GLSL_VERSION_OVERRIDE | Digit.Digit | | Override the GLSL version on the client side. Available for both Windows and Linux clients. |
119-
| SGL_NET_OVER_SHARED | Ip:Port | | If networking is enabled, this environment variable must exist on the guest. Available for both Windows and Linux clients. |
120120
121121
## Windows (in a VM)
122122
@@ -135,6 +135,9 @@ There are two possible drivers one may use:
135135
> [!WARNING]\
136136
> If you use the included driver, test signing must be on. Enable it by running the following command in an elevated command prompt: `bcdedit.exe -set testsigning on` and restart.
137137
138+
> [!NOTE]\
139+
> If you are looking for multiclient support but do not wish to install the patched driver, take a look into the networking feature which requires no drivers.
140+
138141
2. Included driver (multiclient support)
139142
1. Use the release (>= `0.4.0`) **(Windows 10 only)**
140143
1. Download the latest release for windows and extract the zip file.
@@ -218,29 +221,12 @@ make
218221
219222
# Networking
220223
221-
> [!NOTE]
222-
> Shared memory should be prefered over sockets if speed is a concern.
223-
224-
Starting from `0.5.0`, SharedGL offers a networking feature that may be used in place of shared memory. No additional drivers are required for the network feature, meaning if you wish to have a driverless experience in your virtual machine, networking is the given alternative. If the networking feature is used exclusively, the kernel drivers do not need be compiled/installed. However, installation of the ICD for either Linux or Windows is still required.
224+
No drivers are required for the network feature, meaning if you wish to have a driverless experience in your virtual machine, networking is the given alternative. If the networking feature is used exclusively, the kernel drivers do not need be compiled/installed. However, installation of the ICD for either Linux or Windows is still required.
225225
- Start the server using `-n` (and provide a port if the default is not available through `-p PORT`)
226-
- Ensure the client libraries are installed
227-
- Ensure that the environment variable `SGL_NET_OVER_SHARED=ADDRESS:PORT` exists in the guest (`ADDRESS` being the host's IP address)
228-
229-
If the network feature feels too slow, you may want to modify `SGL_FIFO_UPLOAD_COMMAND_BLOCK_COUNT` in `inc/network/packet.h`, which can be ranged from [1, 15360]:
230-
```diff
231-
/*
232-
* 256: safe, keeps packet size under 1400 bytes
233-
* 512: default
234-
* 15360: largest, may result in fragmentation
235-
*/
236-
- #define SGL_FIFO_UPLOAD_COMMAND_BLOCK_COUNT 512
237-
+ #define SGL_FIFO_UPLOAD_COMMAND_BLOCK_COUNT 15360
238-
```
239-
240-
Note that changing this file will require rebuilding the client and server.
226+
- Ensure the ICD is installed
227+
- Ensure that the environment variable `SGL_NETWORK_ENDPOINT=ADDRESS:PORT` exists in the guest (`ADDRESS` being the host's IP address)
241228
242229
# Known issues
243-
- **Network:** Incomplete framebuffers when using network feature
244230
- **Linux clients:** New GLX FB configs may cause applications using `freeglut` or `glad` to no longer run (only tested on Linux clients).
245231
246232
# Troubleshooting

0 commit comments

Comments
 (0)