working opengl pipeline
continuous-integration/drone/push Build encountered an error
Details
continuous-integration/drone/push Build encountered an error
Details
parent
4b34dd374a
commit
6c6749bdcd
Binary file not shown.
@ -1,23 +1,45 @@
|
||||
#include "_ui.hpp"
|
||||
|
||||
void ui::Ui::draw(){
|
||||
if(!inited){
|
||||
namedWindow(myWindow,WINDOW_OPENGL);
|
||||
setWindowProperty(myWindow, cv::WND_PROP_FULLSCREEN, cv::WINDOW_FULLSCREEN);
|
||||
cv::setOpenGlContext(myWindow);
|
||||
moveWindow(myWindow,DEFAULT_UI_OFFSET_X+960,DEFAULT_UI_OFFSET_Y);
|
||||
resizeWindow(myWindow,DEFAULT_UI_SIZE_X,DEFAULT_UI_SIZE_Y);
|
||||
inited = true;
|
||||
ui::UiDrawer::drawStartupSequence();
|
||||
}
|
||||
try{
|
||||
DEBUG_LOG("\nBegin drawing--------------")
|
||||
fcheckManager::fcShow.tickBegin();
|
||||
UiManager::accessLocks.at(this->id)->lock();
|
||||
if(drawSurface.empty()){
|
||||
UiManager::accessLocks.at(this->id)->unlock();
|
||||
return;
|
||||
}
|
||||
drawBuffer = drawSurface;
|
||||
#ifdef OGLWIN
|
||||
DEBUG_LOG("Assigning opengl buffer")
|
||||
UMat drawBuffer = drawSurface;
|
||||
DEBUG_LOG("Done assigning opengl buffer")
|
||||
#else
|
||||
UMat drawBuffer = drawSurface;
|
||||
#endif
|
||||
UiManager::accessLocks.at(this->id)->unlock();
|
||||
DEBUG_LOG("Buffer retreived")
|
||||
#ifdef OGLWIN
|
||||
UMat blk1920x1080(cv::Size(1920, 1080), CV_8UC3,Scalar(0,0,0));
|
||||
drawTexture = Texture2D(1920,1080,cv::ogl::Texture2D::Format::RGBA,false);
|
||||
//cv::ogl::convertToGLTexture2D(drawBuffer, drawTexture);
|
||||
//imshow(this->myWindow, this->drawTexture);
|
||||
drawTexture.copyFrom(drawBuffer);
|
||||
imshow(this->myWindow, this->drawTexture);
|
||||
#else
|
||||
imshow(this->myWindow, this->drawBuffer);
|
||||
imshow(this->myWindow, drawBuffer);
|
||||
#endif
|
||||
|
||||
waitKey(10);
|
||||
fcheckManager::fcShow.tickUpdate();
|
||||
DEBUG_LOG("Done draw cycle-----------------")
|
||||
}
|
||||
catch(...){
|
||||
cerr << "exception caught in ui::draw" << endl;
|
||||
UiManager::accessLocks.at(this->id)->unlock();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue