experimental interprocess communication with OpenGL
C++ C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CMakeLists.txt
FindSFML.cmake
README
generator.cpp
hello_ipc_opengl.cpp
hello_ipc_opengl.h
steps
ui.cpp

README

experimental minimalistic program to use OpenGL over interprocess 
communication


what it does

it is an experimental small program to explore the passing of 
OpenGL images between processes, using glReadPixels and boost's portable
version of mmap. 


usage

install sfml and boost
cmake .
make
./hello_ipc_opengl


how it works

hello_ipc_opengl first creates a file for 'mmap' to use. "hello_mmap". 
then it spawns the two child processes, 'generator' and 'ui'. 'generator'
writes images to the file, and 'ui' reads images from the file. 

the code is written without error checking, for the sake of clarity and 
for efficiency of experimentation.


result of experiment

it works well at smaller resolutions. however, in larger resolutions, 
like 1024x768, it is too slow to be usable. presumably, glReadPixels is 
not a reliablly fast function on every OpenGL video card + video driver.

curiously, runnning "LIBGL_ALWAYS_SOFTWARE=1 ./hello_ipc_opengl" 
provides excellent performance - presumably because a straight 'memcpy' 
is being called by the underlying system. 

in the case of the actual video card, in this cas an Intel 915 series 
using a Mesa open source GL driver, though, transferring between 
video memory and 'normal' memory is dozens of times slower than a 
straight 'memcpy' would be. 

it has nothing to do with the mmap functions and disk access - running 
it off a RAM disk is equally slow.

experiments with setting GL_BGRA and GL_RGBA did not have any meaningful
effect on the speed when using the Mesa Intel driver.


LICENSE

Part of the code is from SFML, which has a zlib-style copyright license. 
You can read it if you look at ui.cpp and generator.cpp

The rest of the code is GPL2.