Chapter 7
Framelocking Sun XVR-4000 Graphics Accelerators
55
Creating a Multiscreen Application
The following is a programming example of how to create a Buffer Swap
Synchronization (multiscreen) application.
▼
Creating the Main Program
1. Create
n full screen windows, one per screen.
2. Create
n rendering threads and associate one thread per screen.
3. Create a master thread to synchronize rendering threads.
4. Execute the main window system event loop.
▼
Using the Master Thread Run Method
Do the following in a loop:
1. Notify all rendering threads to render a frame (possibly in response to an event).
Wait for all rendering threads to finish rendering.
2. Notify all rendering threads to swap buffers.
Wait for all rendering threads to finish swapping.
▼
Using the Render Thread(s) Run Method
1. Create OpenGL context for this thread’s window.
2. Make context current to this thread.
3. Initialize OpenGL context state.
4. Do the following in a loop:
a. Wait for master thread notification.
b. Render image to back buffer for this screen.
c. Notify master thread that this thread is done rendering.
d. Wait for master thread notification.
e. Swap buffers.
f. Notify master thread that this thread is done swapping.