342 |
|
|
343 |
bool setCurrent() { |
bool setCurrent() { |
344 |
DBG(dbg) << "setcurrent pixmap "<<pix<<" "<<ws->pxContext<<"\n"; |
DBG(dbg) << "setcurrent pixmap "<<pix<<" "<<ws->pxContext<<"\n"; |
345 |
bool ret = glXMakeContextCurrent(ws->dpy, pix, pix, ws->pxContext); |
bool ret = glXMakeCurrent(ws->dpy, pix, ws->pxContext); |
346 |
DBG(dbg) << "setcurrent pixmap ret: "<<ret<<"\n"; |
DBG(dbg) << "setcurrent pixmap ret: "<<ret<<"\n"; |
347 |
if(!ret) throw "Can't draw into pixmap"; |
if(!ret) throw "Can't draw into pixmap"; |
348 |
return ret; |
return ret; |
349 |
} |
} |
350 |
bool releaseCurrent() { |
bool releaseCurrent() { |
351 |
DBG(dbg) << "Releasecurrent pixmap "<<pix<<" "<<ws->pxContext<<"\n"; |
DBG(dbg) << "Releasecurrent pixmap "<<pix<<" "<<ws->pxContext<<"\n"; |
352 |
bool ret = glXMakeContextCurrent(ws->dpy, None, None, NULL); |
bool ret = glXMakeCurrent(ws->dpy, None, NULL); |
353 |
DBG(dbg) << "Releasecurrent pixmap ret: "<<ret<<"\n"; |
DBG(dbg) << "Releasecurrent pixmap ret: "<<ret<<"\n"; |
354 |
if(!ret)throw "Can't draw into pixmap"; |
if(!ret)throw "Can't draw into pixmap"; |
355 |
return ret; |
return ret; |
391 |
|
|
392 |
bool setCurrent() { |
bool setCurrent() { |
393 |
DBG(dbg) << "setcurrent pbuf "<<pbuf<<" "<<ws->pbContext<<"\n"; |
DBG(dbg) << "setcurrent pbuf "<<pbuf<<" "<<ws->pbContext<<"\n"; |
394 |
bool ret = glXMakeContextCurrent(ws->dpy, pbuf, pbuf, ws->pbContext); |
bool ret = glXMakeCurrent(ws->dpy, pbuf, ws->pbContext); |
|
if(!ret) |
|
|
XSync(ws->dpy, False); |
|
395 |
DBG(dbg) << "setcurrent pbuf ret: "<<ret<<"\n"; |
DBG(dbg) << "setcurrent pbuf ret: "<<ret<<"\n"; |
396 |
if(!ret) throw "Can't draw into pbuf"; |
if(!ret) throw "Can't draw into pbuf"; |
397 |
return ret; |
return ret; |
398 |
} |
} |
399 |
bool releaseCurrent() { |
bool releaseCurrent() { |
400 |
DBG(dbg) << "Releasecurrent pbuf "<<pbuf<<" "<<ws->pbContext<<"\n"; |
DBG(dbg) << "Releasecurrent pbuf "<<pbuf<<" "<<ws->pbContext<<"\n"; |
401 |
bool ret = glXMakeContextCurrent(ws->dpy, None, None, NULL); |
bool ret = glXMakeCurrent(ws->dpy, None, NULL); |
402 |
DBG(dbg) << "Releasecurrent pbuf ret: "<<ret<<"\n"; |
DBG(dbg) << "Releasecurrent pbuf ret: "<<ret<<"\n"; |
403 |
if(!ret) throw "Can't draw into pbuf"; |
if(!ret) throw "Can't draw into pbuf"; |
404 |
return ret; |
return ret; |