本文整理汇总了C++中CComQIPtr::Draw方法的典型用法代码示例。如果您正苦于以下问题:C++ CComQIPtr::Draw方法的具体用法?C++ CComQIPtr::Draw怎么用?C++ CComQIPtr::Draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComQIPtr
的用法示例。
在下文中一共展示了CComQIPtr::Draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderBehavior
void CPElement::RenderBehavior(Gdiplus::Graphics* pGraphics)
{
for (int i = 0; i < m_behaviors.GetSize(); i++)
{
CComQIPtr<IHTMLPainter> htmlPainter = m_behaviors[i]->m_p;
if (htmlPainter)
{
CRect rcBounds(0, 0, 400, 400); // TODO
CRect rcUpdate(0, 0, 400, 400); // TODO
long lDrawFlags = 0; // HTMLPAINT_DRAW_UPDATEREGION = 0x000001,
// HTMLPAINT_DRAW_USE_XFORM = 0x000002
HDC hDC = pGraphics->GetHDC();
//CPoint oldOrg;
//OffsetViewportOrgEx(hDC, -pC->m_clipBox.left, -pC->m_clipBox.top, &oldOrg);
htmlPainter->Draw(rcBounds, rcUpdate, lDrawFlags, hDC, NULL);
//SetViewportOrgEx(hDC, oldOrg.x, oldOrg.y, NULL);
pGraphics->ReleaseHDC(hDC);
}
}
}
示例2: if
//.........这里部分代码省略.........
if (m_viewpointStack.GetSize() > 0)
{
pViewpoint = static_cast<CLViewpoint*>(m_viewpointStack[0]);
}
else
{
// hmm...
}
// glViewport(m_viewR[view].left, m_viewR[view].top, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPickMatrix(winx, winy, 3, 3, viewport);
// glLoadMatrixd(projm);
//
double fov;
if (pViewpoint)
{
CLSFFloat* fieldOfView = static_cast<CLSFFloat*>(pViewpoint->m_fieldOfView);
fov = fieldOfView->m_value;
}
else
{
fov = M_PI/4;
}
gluPerspective(gmDegrees(fov), (GLfloat)w / (GLfloat)h, 1.0, 10000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//glLoadMatrixf((float*)modelm);
CX3DDrawContext xdc;
#if 0
// NavigationInfo
{
BOOL headlight;
if (m_navigationinfoStack.GetSize() > 0)
{
CLNavigationInfo* pNavigationInfo = static_cast<CLNavigationInfo*>(m_navigationinfoStack[0]);
headlight = static_cast<CLSFBool*>(pNavigationInfo->m_headlight)->m_v;
}
else
{
// Default values
headlight = TRUE;
}
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
if (TRUE)//TRUE/*bAnyLights*/)
{
}
if (headlight)
{
GLfloat light_direction[4] = { 0, 0, 1, 0}; // directional
GLfloat color[4] = {1, 1, 1, 1};
GLfloat ambient[4] = {0, 0, 0, 1};
glEnable(GL_LIGHT0+xdc.m_nLight);
glLightfv(GL_LIGHT0+xdc.m_nLight, GL_POSITION, light_direction);