100 |
}; |
}; |
101 |
VOB_DEFINED(ReadPixels); |
VOB_DEFINED(ReadPixels); |
102 |
|
|
103 |
|
struct CopyPixels { |
104 |
|
enum { NTrans = 2 }; |
105 |
|
|
106 |
|
int w, h; |
107 |
|
Token type; |
108 |
|
|
109 |
|
template<class F> void params(F &f) { |
110 |
|
f(w, h, type); |
111 |
|
} |
112 |
|
|
113 |
|
template<class T> void render(const T &t1, const T &t2) const { |
114 |
|
ZPt p = t1.transform(ZPt(0,0,0)); |
115 |
|
glRasterPos3f(p.x, p.y, p.z); |
116 |
|
float ras[4]; |
117 |
|
glGetFloatv(GL_CURRENT_RASTER_POSITION, ras); |
118 |
|
|
119 |
|
p = t2.transform(ZPt(0,0,0)); |
120 |
|
glRasterPos3f(p.x, p.y, p.z); |
121 |
|
|
122 |
|
glCopyPixels((int)ras[0], (int)ras[1]-h, w, h, type); |
123 |
|
GLERR |
124 |
|
} |
125 |
|
}; |
126 |
|
VOB_DEFINED(CopyPixels); |
127 |
|
|
128 |
|
|
129 |
} |
} |
130 |
} |
} |