예제 #1
0
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;
}
예제 #2
0
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);
}