void mouseClick(GLFWwindow* Window, Cell*** cellList) { double xcursor, ycursor; glfwGetCursorPos(Window, &xcursor, &ycursor); printf("A: %f %f ", xcursor, ycursor); xcursor = xcursor * cellDim / DIM; ycursor = cellDim - ycursor * cellDim / DIM; printf("B: %f %f ", xcursor, ycursor); toggleLights(cellList, (int) xcursor, (int) ycursor); }
LabCanvas::LabCanvas(QWidget *parent, QMenuBar *menu) : SupportCanvas3D(parent) { // default render settings m_renderTechnique = RENDER_SHADED; m_lightingEnabled = true; m_menuOffset = LABCANVAS_BUTTON_SPACING; makeRenderTechniqueButton("Points", RENDER_POINT); makeRenderTechniqueButton("Wireframe", RENDER_WIREFRAME); makeRenderTechniqueButton("Shaded", RENDER_SHADED); QPushButton* b = makeButton("Toggle Lighting"); b->setCheckable(true); b->setChecked(m_lightingEnabled); connect(b, SIGNAL(clicked()), this, SLOT(toggleLights())); }