bool TrackerThread::init() { try { m_pImagingContext = GLContext::create( GLConfig(false, false, true, 1, GLConfig::AUTO, false)); createBandpassFilter(); AVG_TRACE(Logger::category::CONFIG, Logger::severity::INFO, "Using fragment shaders for imaging operations."); } catch (Exception& e) { AVG_LOG_WARNING(e.getStr()); AVG_TRACE(Logger::category::CONFIG, Logger::severity::WARNING, "Using CPU for imaging operations (slow and inaccurate)."); m_pImagingContext = 0; m_pBandpassFilter = FilterPtr(new FilterFastBandpass()); } try { m_StartTime = TimeSource::get()->getCurrentMillisecs(); m_HistoryDelay = m_pConfig->getIntParam("/tracker/historydelay/@value"); } catch (Exception& e) { AVG_LOG_WARNING(e.getStr()); } // Done in TrackerInputDevice::ctor to work around Leopard/libdc1394 threading issue. // m_pCamera->open(); return true; }
ExampleGLCanvas(wxEvtHandler* handler, wxWindow* parent) : wxGLCanvas( parent, wxID_ANY, GLConfig(), wxDefaultPosition, wxDefaultSize) , evt_handler(handler) { Connect( wxEVT_MOTION, wxMouseEventHandler(ExampleGLCanvas::OnMouseEvent)); }
void Framework::DoRender(){ GLConfig(); //Light //Framework::InitLight(); //Skybox m_skybox->RenderSkybox(m_camera->m_pos); m_currentNode->Render(m_wireFrame, m_colorToRender); //See if the camera is on another node. If so, we have to generate its neighbours if(m_currentNode->IsWithin(m_camera->m_pos) == false){ m_currentNode = m_currentNode->FindCurrentStandingNode(m_camera->m_pos); } // Draw tweak bars TwDraw(); /* for (m_iterator = m_sceneGraph.begin(); m_iterator != m_sceneGraph.end(); m_iterator++ ) { Node& node = **m_iterator; //cout << &node; //cout << "\n"; node.Render(); //See if the camera is on the node if(node.IsWithin(camera->m_pos)){ //See if the node is different from the last one (so we have to generate more patchs) if(m_currentNode->m_position.equals(node.m_position) == false){ //cout << "caiu"; node.GenerateNeighbours(m_currentNode); m_currentNode = &node; } //node.GenerateNeighbours(); } } */ }
void CGLDrawingArea::MakeDrawingAreaAnOpenGLContext() /***************************************/ { GtkWidget* widget = reinterpret_cast<GtkWidget*>(gobj()); gtk_widget_set_gl_capability(widget, GLConfig(), NULL, TRUE, GDK_GL_RGBA_TYPE); }
MainFrame(wxApp& app, const wxString& example_name) : wxFrame( (wxWindow*)0, wxID_ANY, wxT("OGLplus example"), wxDefaultPosition, wxSize(300, 600)) , status_bar(new wxStatusBar(this)) , tmp_canvas(new wxGLCanvas( (wxWindow*)this, wxID_ANY, GLConfig(), wxDefaultPosition, wxDefaultSize)) , gl_context(tmp_canvas) , api_init(nullptr) , example_frame(nullptr) { InitComponents(example_name); Show(); SetStatus(wxT("Initializing GL")); gl_context.SetCurrent(*tmp_canvas); api_init = new oglplus::GLAPIInitializer(); delete tmp_canvas; SetStatus(wxT("Ready")); Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(MainFrame::OnClose)); example_frame = new ExampleFrame( app, (wxWindow*)this, example_name, (ExampleInfoDisplay*)this, &gl_context); SetStatus(wxT("Running")); }