level 1
周恩周
楼主
void C串口V2Dlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作矩形中居中
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 绘制图标
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
// Clear out the color & depth buffers
::glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
RenderScene();//绘图都放在这
// Tell OpenGL to flush its pipeline
glPointSize(5.0f);
glColor3f(1.0f,1.0f,1.0f);
glBegin(GL_POINTS);
glVertex3f(xRot, 0.5f,sin(xRot));
glEnd();
glFlush();
::glFinish();
//Now Swap the buffers
::SwapBuffers( m_pDC->GetSafeHdc());
}
2015年05月21日 12点05分
1
{
if (IsIconic())
{
CPaintDC dc(this); // 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作矩形中居中
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 绘制图标
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
// Clear out the color & depth buffers
::glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
RenderScene();//绘图都放在这
// Tell OpenGL to flush its pipeline
glPointSize(5.0f);
glColor3f(1.0f,1.0f,1.0f);
glBegin(GL_POINTS);
glVertex3f(xRot, 0.5f,sin(xRot));
glEnd();
glFlush();
::glFinish();
//Now Swap the buffers
::SwapBuffers( m_pDC->GetSafeHdc());
}