File: Notes

package info (click to toggle)
openscenegraph 1.2.0-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 26,924 kB
  • ctags: 25,229
  • sloc: cpp: 239,326; ansic: 2,178; sh: 1,990; yacc: 548; perl: 237; makefile: 227; lex: 151
file content (73 lines) | stat: -rw-r--r-- 871 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Scratchings from whiteboard:

Main application loop:

  for( ;; )
  {
      CameraGroup::sync();
      preCull Traversal;
      CameraGroup::frame();
  }

CameraGroup::frame()
{
     Barrier.release();
}

CameraGroup::sync()
{
    Barrier.wait();
}


Two possible Camera implementations:

A) ======

Camera::thread()
{
    for( ;; )
    {
	Barrier.wait();
	cull();
	SVR(); // Sync Vertical Retrace
	draw();
	Barrier.release();
	swapbuffers();
    }
}


B) ==== Threaded Cull 

Camera::thread()
{
    for( ;; )
    {
	Barrier.wait();
	CullDrawBarrier.release();
	CullDrawBarrier.wait();
	swap scene view buffers;
	Barrier.release();
    }
}

Cull::thread()
{
   for( ;; )
   {
       CullDrawBarrier.wait();
       cull();
       CullDrawBarrier.release();
   }
}

Draw::thread()
{
    for( ;; )
    {
	CullDrawBarrier.wait();
	draw();
	CullDrawBarrier.release();
    }
}