/* * draw - Draw the SliceWidget. * * parameter glContextData - GLContextData& */ void SliceWidget::draw(GLContextData& glContextData) const { Widget::draw(glContextData); DataItem* dataItem = glContextData.retrieveDataItem<DataItem> (this); if (sliceChanged) updateSliceTexture(dataItem); GLfloat x1 = SliceWidgetAreaBox.getCorner(0)[0]; GLfloat x2 = SliceWidgetAreaBox.getCorner(1)[0]; GLfloat y1 = SliceWidgetAreaBox.getCorner(0)[1]; GLfloat y2 = SliceWidgetAreaBox.getCorner(2)[1]; GLfloat z = SliceWidgetAreaBox.getCorner(0)[2]; GLfloat width = x2 - x1; GLfloat height = y2 - y1; drawMargin(); GLboolean lightingEnabled = glIsEnabled(GL_LIGHTING); if (lightingEnabled) glDisable(GL_LIGHTING); glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glDepthMask(GL_FALSE); drawSliceWidget(dataItem, x1, y1, z, width, height); glDepthMask(GL_TRUE); glDisable(GL_BLEND); if (lightingEnabled) glEnable(GL_LIGHTING); } // end draw()
void renderMaze(void) { glClear(GL_COLOR_BUFFER_BIT); drawMargin(screenWidth,screenHeight); node *head=matrixDraw(2,3); printf("%f\n",head->point.x); glFlush(); }