diff --git a/README.md b/README.md index 97ffcf9..c281dd9 100644 --- a/README.md +++ b/README.md @@ -78,18 +78,9 @@ If networking on the server is enabled (using `-n`), the client must be aware of SGL_NET_OVER_SHARED=HOST_ADDRESS:PORT ``` -### Shared memory or network - -Starting from `0.5.0`, SharedGL offers the ability to use sockets instead of shared memory for streaming: - -| | Shared memory | Network | -|------------------------------------------------------|--------------------|--------------------| -| Requires additional drivers | :white_check_mark: | :x: | -| Requires additional host renderer arguments | :x: | :white_check_mark: | -| Requires additional environment variables for client | :x: | :white_check_mark: | -| Able to run/debug clients on host | :white_check_mark: | :white_check_mark: | -| Able to run clients in VMs | :white_check_mark: | :white_check_mark: | -| Able to run clients over LAN | :x: | :white_check_mark: | +### Network + +Starting from version `0.5.0`, network capabilities are offered. If you wish to accelerate graphics over another machine or do not wish to install any kernel drivers, use the network feature. ## Linux For your OpenGL application to communicate with the server, the client library must be specified in your library path. Upon exporting, any program you run in the terminal where you inputted this command will run with the SGL binary. diff --git a/src/client/glimpl.c b/src/client/glimpl.c index 48e14a8..cf8a42e 100644 --- a/src/client/glimpl.c +++ b/src/client/glimpl.c @@ -851,11 +851,13 @@ void glBufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage { glimpl_commit(); - pb_push(SGL_CMD_VP_UPLOAD); - pb_push(size / sizeof(int)); /* could be very bad mistake */ - int *idata = (int*)data; - for (int i = 0; i < size / sizeof(int); i++) - pb_push(idata[i]); + if (data != NULL) { + pb_push(SGL_CMD_VP_UPLOAD); + pb_push(size / sizeof(int)); /* could be very bad mistake */ + int *idata = (int*)data; + for (int i = 0; i < size / sizeof(int); i++) + pb_push(idata[i]); + } pb_push(SGL_CMD_BUFFERDATA); pb_push(target);