SDL VNC Server module (v2)
Time for a version two! There’s a new version of the patch to SDL 1.2.14. You need a clean source tree with this, so remove v1 of the patch before applying this one.
Changes:
- Mouse cursors now work correctly.
- You can now disable the “always shared” function of the VNC server and allow a client to take exclusive control with SDL_VNC_ALWAYS_SHARED="0".
- You can change the display number manually with SDL_VNC_DISPLAY.
- 8 bpp displays are now supported.
- pygame applications work at 16, 24 and 32 bpp display depths. 8 doesn’t work properly.
- This module now lies by default about the supported display depths reported by SDL_ListModes. It defaults to 16 bpp only, in order to make pygame work properly. You can change what it says this with SDL_VNC_DEPTH, or setting it to 0 to say all depths are supported. This doesn’t limit calls to SDL_SetVideoMode.
- You can tell the VNC server to ignore all client events by setting SDL_VNC_VIEW_ONLY="1".
There’s also a README.VNC included, which documents the functionality of the library and use of it’s environment variables.
Edit (2010-08-29): Just to clarify, this software is licensed under the same terms as SDL 1.2.14 itself, the GNU Lesser General Public License version 2.1, or at your option, any later version as published by the Free Software Foundation, Inc.
SDL VNC Server module
I keep writing things related to VNC, and coding in C. It’s seriously starting to worry me.
I’ve spent the last couple of days writing a new SDL video output module, which acts as a VNC server using libvncserver. Here are the patches against SDL 1.2.14. To use VNC support, you need to run ./configure with --enable-video-vnc, and once built and installed, run the SDL application with the environment variable SDL_VIDEODRIVER="vnc".
What works:
- 16, 24 and 32-bit true-colour displays.
- Mouse events.
- Keyboard events.
What’s left to do:
- Fix mouse cursors so they display correctly.
- 8-bit (paletted) displays.
- Handle surface locking properly.
- Reduce/eliminate tearing on frequent screen updates.
- Run the libvncserver event loop inside SDL’s event loop system.
- Implement a password on the VNC server and some sort of simple access control.
- Implement a view-only mode.
- Allow setting the display number manually.
- pygame applications.
- Fix screen resolution change colour issues.
What will never work:
- OpenGL surfaces.
- CDROMs, Joysticks and Sound over VNC.
- YUV video output.
I’ve had a lot of success with using the Origyn web browser (a WebKit/SDL-based web browser) and cgterm (a SDL C64/C128 telnet client) with this output method. Any SDL application that doesn’t use OpenGL surfaces should be able to run with this output module.
Some pictures:
|[origyn web browser in tightvnc]| |[cgterm in tightvnc]|
tightvnc]| image:: /static/projects/sdlvnc/sdl-video-vnc-v1-owb_small.png .. |[cgterm in tightvnc]| image:: /static/projects/sdlvnc/sdl-video-vnc-v1-cgterm_small.png