Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RGM was created because i got annoyed trying make my windows device(laptop) act as a temporary monitor and hardware extender for my Linux device alongside with an android device .I came up with the idea to make it easier to do so across devices so i can use it when working on other projects.basically i created it for my own benefit

License

Notifications You must be signed in to change notification settings

RR-Ralefaso/RGM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

45 Commits

Repository files navigation

RGM Logo

RGM - Ralefaso GlassMirror

Why I Built This

I got tired of trying to use my Windows laptop as a temporary monitor for my Linux device (alongside Android devices). I wanted a simple, cross-platform solution to mirror screens across devices without complicated setup or proprietary software.

RGM is my answer: a lightweight, zero-configuration screen sharing system that just works.

About

  • Built with: C++11
  • Network Protocol: SSDP discovery + TCP streaming
  • Resolution: 1280x720 @ 10 FPS
  • Author: RR-Ralefaso (polaris)

Current Features

Zero-configuration discovery - Receivers automatically advertise themselves, senders automatically find them
Cross-platform - Works on Windows, Linux, and macOS
Real-time streaming - 10 FPS screen capture and display
Simple to use - Just compile and run, no configuration files
SSDP-based - Uses standard UPnP discovery protocol

Future Plans

Transform the receiver into a device extender - not just mirroring, but using the receiver's hardware (GPU, CPU, peripherals) for the sender's workloads.

Supported Platforms

Desktop Mobile (Planned)
Windows iOS
Linux Android
macOS

How It Works

RGM consists of two components:

  1. Receiver (receiver.cpp) - Runs on the display device, advertises itself via SSDP, and shows the incoming video stream using SDL2
  2. Sender (sender.cpp) - Runs on the source device, discovers receivers on the network, captures the screen, and streams it

The system uses SSDP (Simple Service Discovery Protocol) to automatically find receivers - no need to manually enter IP addresses!

Compilation

Important

Order of Operations: ALWAYS run the Receiver first on the display device, then run the Sender on the source device.

Prerequisites

Linux

# Install required libraries (Debian/Ubuntu)
sudo apt update
sudo apt install libx11-dev libsdl2-dev g++ make
# For Fedora/RHEL
sudo dnf install libX11-devel SDL2-devel gcc-c++ make
# For Arch
sudo pacman -S libx11 sdl2 gcc make

MacOS

 # Install SDL2 using Homebrew
brew install sdl2

windows

  • Download SDL2 development libraries from libsdl.org
  • Extract to a known location (e.g., C:\SDL2)

BUIlD INSTRUCTIONS

linux

# Build sender
g++ -std=c++11 -o sender src/sender.cpp src/discover.cpp -lX11 -lpthread
# Build receiver 
g++ -std=c++11 -o receiver src/receiver.cpp src/discover.cpp $(sdl2-config --cflags --libs) -lpthread
# Or use the Makefile
make all

MacOS

 # Build sender
 g++ -std=c++11 -o sender src/sender.cpp src/discover.cpp -lpthread
 # Build receiver
 g++ -std=c++11 -o receiver src/receiver.cpp src/discover.cpp $(sdl2-config --cflags --libs) -lpthread
 # Or use the Makefile
 make all

Windows (MinGW)

 # Build sender
 g++ -std=c++11 -o sender.exe src/sender.cpp src/discover.cpp -lws2_32 -lgdi32 -lpthread
 # Build receiver
 g++ -std=c++11 -o receiver.exe src/receiver.cpp src/discover.cpp -lws2_32 -lSDL2 -lpthread

Windows (Visual Studio)

 cl src/sender.cpp src/discover.cpp /I"C:\SDL2\include" /link /LIBPATH:"C:\SDL2\lib\x64" ws2_32.lib /std:c++11 /EHsc /out:sender.exe
 cl src/receiver.cpp src/discover.cpp /I"C:\SDL2\include" /link /LIBPATH:"C:\SDL2\lib\x64" SDL2.lib SDL2main.lib ws2_32.lib shell32.lib /std:c++11 /EHsc /out:receiver.exe

Using the Makefile (Linux/macOS)

The included Makefile handles platform detection automatically (im amazing i know):

 # Check your build environment
make check
# Install dependencies (Linux only)
make install-deps
# Build everything
make all
# Build individually
make sender
make receiver
# Run (in separate terminals)
make run-receiver # Terminal 1 - display device
make run-sender # Terminal 2 - source device
# Clean build files
make clean

Running the Application

  1. Start the receiver on the device that will display the screen:
    • ./receiver
  2. Start the sender on the device whose screen you want to share:
    • ./sender
  3. The sender will automatically discover any receivers on the network and prompt you to select one
  4. Streaming begins automatically!

Troubleshooting

No receivers found?

  • Ensure both devices are on the same network
  • Check firewall settings (allow UDP port 1900 and TCP port 8081)
  • Make sure receiver is running BEFORE the sender

Connection fails?

  • Verify the IP address shown during discovery
  • Test basic connectivity: ping <receiver_ip>
  • Check if TCP port 8081 is accessible: telnet <receiver_ip> 8081

Poor performance?

  • The current version uses uncompressed RGB24 (high bandwidth)
  • For best results, use a wired Ethernet connection
  • Reduce resolution or FPS in the source code if needed

R-Corp Logo
ROOT ACCESS FOR EVERYONE

About

RGM was created because i got annoyed trying make my windows device(laptop) act as a temporary monitor and hardware extender for my Linux device alongside with an android device .I came up with the idea to make it easier to do so across devices so i can use it when working on other projects.basically i created it for my own benefit

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /