MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / getFrame

Method getFrame

server/VGLTrans.cpp:253–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251
252
253Frame *VGLTrans::getFrame(int width, int height, int pixelFormat, int flags,
254 bool stereo)
255{
256 Frame *f = NULL;
257
258 if(deadYet) return NULL;
259 if(thread) thread->checkError();
260 {
261 CriticalSection::SafeLock l(mutex);
262
263 int index = -1;
264 for(int i = 0; i < NFRAMES; i++)
265 if(frames[i].isComplete()) index = i;
266 if(index < 0) THROW("No free buffers in pool");
267 f = &frames[index]; f->waitUntilComplete();
268 }
269
270 rrframeheader hdr;
271 memset(&hdr, 0, sizeof(rrframeheader));
272 hdr.x = hdr.y = 0;
273 hdr.width = hdr.framew = width;
274 hdr.height = hdr.frameh = height;
275 f->init(hdr, pixelFormat, flags, stereo);
276 return f;
277}
278
279
280bool VGLTrans::isReady(void)

Callers

nothing calls this directly

Calls 4

checkErrorMethod · 0.80
isCompleteMethod · 0.80
waitUntilCompleteMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected