void GLObject::Draw(bool forID, float IDcolor[]) { glPushMatrix(); glTranslatef(x, y, z); float mat[4][4]; fRotation.toOpenGLMatrix(mat); glMultMatrixf((GLfloat*)mat); if (forID) { glColor3fv(IDcolor); } DoDrawing(forID); glPopMatrix(); changed = false; }
void wxLCDWindow::OnPaint(wxPaintEvent& event) { wxPaintDC dc(this); int dw = GetClientSize().GetWidth(); int dh = GetClientSize().GetHeight(); int bw = GetBitmapWidth(); int bh = GetBitmapHeight(); double xs = (double) dw / bw; double ys = (double) dh / bh; double as = xs > ys? ys : xs; dc.SetUserScale(as, as); dc.SetDeviceOrigin(((dw - bw * as) / 2), ((dh - bh * as) / 2)); DoDrawing(&dc); }