• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IntersectRect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IntersectRect函数的典型用法代码示例。如果您正苦于以下问题:C++ IntersectRect函数的具体用法?C++ IntersectRect怎么用?C++ IntersectRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IntersectRect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DrawDC_Vecter

void CTyHMProxy::DrawDC_Vecter(CDC *pDC, CElecMapView *pView)
{
	float minx,miny,maxx,maxy;
	pView->GetFloatRect(&minx,&miny,&maxx,&maxy);
	if (!IntersectRect(minx,miny,maxx,maxy)) return;


	GetRect(&minx,&miny,&maxx,&maxy);
	CPoint pt1,pt2;
	pt1=pView->UPtoLP(minx,miny);
	pt2=pView->UPtoLP(maxx,maxy);
	CRect rt;
	rt.SetRect(pt1,pt2);
	rt.NormalizeRect();
  //DrawVector(LPCSTR vectorname,CDC* pDC,CRect viewRect,CRect clipRect,COLORREF color,BOOL blReplace)
	DrawVector(m_str1,pDC,rt,rt,m_color1,m_bTranslate1);
}
开发者ID:github188,项目名称:MonitorSystem,代码行数:17,代码来源:ShuZhi.cpp


示例2: query_screens

static int query_screens(void)
{
    int i, count, event_base, error_base;
    XineramaScreenInfo *screens;
    RECT rc_work = {0, 0, 0, 0};

    if (!monitors)  /* first time around */
        load_xinerama();

    query_work_area( &rc_work );

    if (!pXineramaQueryExtension || !pXineramaQueryScreens ||
        !pXineramaQueryExtension( gdi_display, &event_base, &error_base ) ||
        !(screens = pXineramaQueryScreens( gdi_display, &count ))) return 0;

    if (monitors != &default_monitor) HeapFree( GetProcessHeap(), 0, monitors );
    if ((monitors = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*monitors) )))
    {
        int device = 2; /* 1 is reserved for primary */

        nb_monitors = count;
        for (i = 0; i < nb_monitors; i++)
        {
            monitors[i].cbSize = sizeof( monitors[i] );
            monitors[i].rcMonitor.left   = screens[i].x_org;
            monitors[i].rcMonitor.top    = screens[i].y_org;
            monitors[i].rcMonitor.right  = screens[i].x_org + screens[i].width;
            monitors[i].rcMonitor.bottom = screens[i].y_org + screens[i].height;
            monitors[i].dwFlags          = 0;
            if (!IntersectRect( &monitors[i].rcWork, &rc_work, &monitors[i].rcMonitor ))
                monitors[i].rcWork = monitors[i].rcMonitor;
        }

        get_primary()->dwFlags |= MONITORINFOF_PRIMARY;

        for (i = 0; i < nb_monitors; i++)
        {
            snprintfW( monitors[i].szDevice, sizeof(monitors[i].szDevice) / sizeof(WCHAR),
                       monitor_deviceW, (monitors[i].dwFlags & MONITORINFOF_PRIMARY) ? 1 : device++ );
        }
    }
    else count = 0;

    XFree( screens );
    return count;
}
开发者ID:gena-moscow,项目名称:wine-patched,代码行数:46,代码来源:xinerama.c


示例3: CheckCollision

bool CBoulder::CheckCollision(IBaseInterface* pObject)
{
	RECT rectCollisionResult = { 0, 0, 0, 0 };
	CBaseObject* pBaseObject = (CBaseObject*)pObject;
	if(IntersectRect(&rectCollisionResult, &GetCollisionRect().GetWindowsRECT(), &pBaseObject->GetCollisionRect().GetWindowsRECT()))
	{
		if(pObject->GetType() == TYPE_CHAR_ENEMY)
		//	((CEnemy*)pObject)->SufferDamage(CPlayer::GetInstance()->GetAttackDamage());

		//if(pObject->GetType() != TYPE_CHAR_PLAYER && pObject->GetType() != TYPE_WEAPON_ARROW)
		//{
		//	CMessageSystem::GetInstance()->SendMsg(new CDestroyObjectMessage(this));
		//}
		return true;
	}
	return false;
}
开发者ID:namlunthkl,项目名称:team4-trynity,代码行数:17,代码来源:CBoulder.cpp


示例4: DUIASSERT

BOOL CGdiAlpha::AlphaBackup(HDC hdc,LPCRECT pRect,ALPHAINFO &alphaInfo)
{
    HBITMAP hBmp=(HBITMAP)GetCurrentObject(hdc,OBJ_BITMAP);
    DUIASSERT(hBmp);
    BITMAP  bm;
    GetObject(hBmp,sizeof(BITMAP),&bm);

    if(bm.bmBitsPixel!=32) return FALSE;
    alphaInfo.rc=*pRect;
    POINT pt;
    GetViewportOrgEx(hdc,&pt);
    RECT rcImg= {0,0,bm.bmWidth,bm.bmHeight};
    OffsetRect(&alphaInfo.rc,pt.x,pt.y);
    IntersectRect(&alphaInfo.rc,&alphaInfo.rc,&rcImg);
    alphaInfo.lpBuf=ALPHABACKUP(&bm,alphaInfo.rc.left,alphaInfo.rc.top,alphaInfo.rc.right - alphaInfo.rc.left, alphaInfo.rc.bottom - alphaInfo.rc.top);
    return TRUE;
}
开发者ID:azunite,项目名称:duiengine,代码行数:17,代码来源:gdialpha.cpp


示例5: SetPixel

/*********************** Generl drawing support ******************************/
void GUIAPI SetPixel(HDC hdc, int x, int y, gal_pixel c)
{
    PDC pdc;
    PCLIPRECT pClipRect;
    RECT rcOutput;

    pdc = dc_HDC2PDC (hdc);

    if (dc_IsGeneralHDC(hdc)) {
        pthread_mutex_lock (&pdc->pGCRInfo->lock);
        if (!dc_GenerateECRgn (pdc, FALSE)) {
            pthread_mutex_unlock (&pdc->pGCRInfo->lock);
            return;
        }
    }

    coor_LP2SP (pdc, &x, &y);

    rcOutput.left = x - 1;
    rcOutput.top  = y - 1;
    rcOutput.right = x + 1;
    rcOutput.bottom = y + 1;

    pthread_mutex_lock (&__mg_gdilock);
    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);
    if (!dc_IsMemHDC(hdc)) ShowCursorForGDI (FALSE, &rcOutput);

    // set graphics context.
    GAL_SetGC (pdc->gc);
    GAL_SetFgColor (pdc->gc, c);

    pClipRect = pdc->ecrgn.head;
    while(pClipRect)
    {
        if(PtInRect(&(pClipRect->rc), x, y)) {
            GAL_DrawPixel (pdc->gc, x, y, c);
            break;
        }
        pClipRect = pClipRect->next;
    }

    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);
    pthread_mutex_unlock(&__mg_gdilock);

    if (dc_IsGeneralHDC(hdc)) pthread_mutex_unlock (&pdc->pGCRInfo->lock);
}
开发者ID:channinglan,项目名称:MINIGUI_1.3.3,代码行数:47,代码来源:draw.c


示例6: ammoMonsterCollision

bool Collision::ammoMonsterCollision(Physical* ammo, MonsterManager* mm, int damage)
{
    vUnit* mons = mm->getMonsters();
    RECT r;

    viUnit iter = mons->begin();
    for (; iter != mons->end(); iter++)
    {
        if (IntersectRect(&r, &ammo->getRect(), &(*iter)->getRect()))
        {
            (*iter)->hit((ammo->getSpeedX() < 0) ? LEFT : RIGHT, damage);
            return true;
        }
    }

    return false;
}
开发者ID:wakeup5,项目名称:Terraria,代码行数:17,代码来源:Collision.cpp


示例7: HWAccelBlit

static int HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect,
                       GAL_Surface *dst, GAL_Rect *dstrect)
{
    RECT rc_src = {srcrect->x, srcrect->y, srcrect->x + srcrect->w, srcrect->y + srcrect->h};
    RECT rc_dst = {dstrect->x, dstrect->y, dstrect->x + dstrect->w, dstrect->y + dstrect->h};
    RECT rc_inter, rc_sub [4];
    
    if (rc_src.top < rc_dst.top && IntersectRect (&rc_inter, &rc_src, &rc_dst)) {
        int i, sub_count, inter_h;
        Sint32 off_x = dstrect->x - srcrect->x;
        Sint32 off_y = dstrect->y - srcrect->y;
        GAL_Rect tmp_src, tmp_dst;

        inter_h = rc_inter.bottom - rc_inter.top;
        for (i = 0; i < inter_h; i++) {
            rc_inter.top = rc_inter.bottom - 1;
            make_rects (&tmp_src, &tmp_dst, &rc_inter, off_x, off_y);
            HWAccelBlit_helper (src, &tmp_src, dst, &tmp_dst);
            rc_inter.bottom --;
        }

        sub_count = SubtractRect (rc_sub, &rc_src, &rc_dst);
        for (i = 0; i < sub_count; i++) {
            make_rects (&tmp_src, &tmp_dst, rc_sub + i, off_x, off_y);
            HWAccelBlit_helper (src, &tmp_src, dst, &tmp_dst);
        }
    }
    else if (rc_src.top == rc_dst.top && rc_src.left < rc_dst.left) {
        int i;
        GAL_Rect tmp_src, tmp_dst;
        Sint32 off_x = dstrect->x - srcrect->x;
        RECT rc = rc_src;

        for (i = 0; i < rc_src.right - rc_src.left; i++) {
            rc.left = rc.right - 1;
            make_rects (&tmp_src, &tmp_dst, &rc, off_x, 0);
            HWAccelBlit_helper (src, &tmp_src, dst, &tmp_dst);
            rc.right --;
        }
    }
    else
        HWAccelBlit_helper (src, srcrect, dst, dstrect);

	return(0);
}
开发者ID:VVillwin,项目名称:minigui,代码行数:45,代码来源:fbneomagic.c


示例8: x11_copy_to_screen

/* Helper function that blits the front buffer contents to the target window. */
void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *rect)
{
    struct wined3d_surface *front;
    POINT offset = {0, 0};
    HDC src_dc, dst_dc;
    RECT draw_rect;
    HWND window;

    TRACE("swapchain %p, rect %s.\n", swapchain, wine_dbgstr_rect(rect));

    front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
    if (swapchain->palette)
        wined3d_palette_apply_to_dc(swapchain->palette, front->hDC);

    if (front->resource.map_count)
        ERR("Trying to blit a mapped surface.\n");

    TRACE("Copying surface %p to screen.\n", front);

    surface_load_location(front, NULL, WINED3D_LOCATION_DIB);

    src_dc = front->hDC;
    window = swapchain->win_handle;
    dst_dc = GetDCEx(window, 0, DCX_CLIPSIBLINGS | DCX_CACHE);

    /* Front buffer coordinates are screen coordinates. Map them to the
     * destination window if not fullscreened. */
    if (swapchain->desc.windowed)
        ClientToScreen(window, &offset);

    TRACE("offset %s.\n", wine_dbgstr_point(&offset));

    draw_rect.left = 0;
    draw_rect.right = front->resource.width;
    draw_rect.top = 0;
    draw_rect.bottom = front->resource.height;

    if (rect)
        IntersectRect(&draw_rect, &draw_rect, rect);

    BitBlt(dst_dc, draw_rect.left - offset.x, draw_rect.top - offset.y,
            draw_rect.right - draw_rect.left, draw_rect.bottom - draw_rect.top,
            src_dc, draw_rect.left, draw_rect.top, SRCCOPY);
    ReleaseDC(window, dst_dc);
}
开发者ID:AlexSteel,项目名称:wine,代码行数:46,代码来源:swapchain.c


示例9: PutSavedBoxOnDC

void GUIAPI PutSavedBoxOnDC (HDC hdc, int x, int y, int w, int h, void* vbuf)
{
    PCLIPRECT pClipRect;
    PDC pdc;
    RECT rcOutput;

    pdc = dc_HDC2PDC(hdc);

    if (dc_IsGeneralHDC(hdc)) {
        if (!dc_GenerateECRgn (pdc, FALSE)) {
            return;
        }
    }

    // Transfer logical to device to screen here.
    w += x; h += y;
    coor_LP2SP(pdc, &x, &y);
    coor_LP2SP(pdc, &w, &h);
    rcOutput.left = x;
    rcOutput.top = y;
    rcOutput.right = w;
    rcOutput.bottom = h;
    NormalizeRect (&rcOutput);
    w = RECTW (rcOutput); h = RECTH (rcOutput);

    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);
    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(FALSE, &rcOutput);

    GAL_SetGC (pdc->gc);

    pClipRect = pdc->ecrgn.head;
    while(pClipRect)
    {
        if (DoesIntersect (&rcOutput, &pClipRect->rc)) {
            GAL_SetClipping(pdc->gc, pClipRect->rc.left, pClipRect->rc.top,
                    pClipRect->rc.right - 1, pClipRect->rc.bottom - 1);

            GAL_PutBox (pdc->gc, x, y, w, h, vbuf);
        }

        pClipRect = pClipRect->next;
    }

    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);
}
开发者ID:channinglan,项目名称:MINIGUI_1.3.3,代码行数:45,代码来源:bitmap-lite.c


示例10: Destroy

bool CScreenBuffer::Create(HDC hDev,const RECT & rc,LPCTSTR szName )
{
	TrackDebugOut;
	Destroy();
	m_hMemDC = CreateCompatibleDC(hDev);
	if(m_hMemDC == NULL){
		DebugOutF(filelog::log_error,("CreateCompatibleDC failed with %d"),GetLastError() );
		return false;
	}
	RECT rcscreen = GetDCRect(hDev);
	RECT rcdest;
	IntersectRect(&rcdest,&rcscreen,&rc);

	LONG lWidth		= rcdest.right - rcdest.left;
	LONG lHeight	= rcdest.bottom - rcdest.top; 
	LONG lBitsPPix	= 32;//GetDeviceCaps(hDev,BITSPIXEL);
	LONG dwImageSize = lHeight*CalculatePitch(CalculateLine(lWidth,lBitsPPix));


	// save [bmp file header] + [bmp info header] + [bmp data] to the file mapping object
	//DWORD filesize = 0;
	LONG biClrUsed = 0;
	RGBQUAD rgbquad[256];
	if (lBitsPPix < 16)
	{
		TrackDebugOut;
		biClrUsed = GetDIBColorTable(hDev,0,256,rgbquad);
	}
	
	if(!CFileMappingBitmap::Create(lWidth,lHeight,lBitsPPix,biClrUsed,rgbquad,szName))
	{
		return false;
	}
	
	m_hBmp = CreateDIBSection(m_hMemDC,(BITMAPINFO*)InfoHeader(),DIB_RGB_COLORS, (void**)&m_pBuff, GetHandle(), FileHeader()->bfOffBits);
	if(m_hBmp == NULL){
		DebugOutF(filelog::log_error,("CreateDIBSection failed %d"),GetLastError() );
		return false;
	}
	SelectObject(m_hMemDC,m_hBmp);
	//HDC hdc = GetDC(0);
	BitBlt(m_hMemDC,0,0,rcdest.right-rcdest.left,rcdest.bottom-rcdest.top,hDev,rcdest.left,rcdest.top,SRCCOPY|CAPTUREBLT);
	//ReleaseDC(0,hdc);
	return true;
}
开发者ID:Nillouise,项目名称:WinRobot,代码行数:45,代码来源:ScreenBuffer.cpp


示例11: RemoveOverlaps

// ----------------------------------------------------------------------------
//
//  RemoveOverlaps()
//    This is called from CleanupDesktopRectangles make sure the monitor array
//  is non-overlapping.
//
// ----------------------------------------------------------------------------
void NEAR PASCAL RemoveOverlaps(LPRECT arc, UINT count)
{
    LPRECT lprc1, lprc2, lprcL;

    //
    // Center the rectangles around a common origin.  We will move them outward
    // when there are conflicts so centering (a) reduces running time and
    // hence (b) reduces the chances of totally mangling the positions.
    //
    CenterRectangles(arc, count);

    //
    // Now loop through the array fixing any overlaps.
    //
    lprcL = arc + count;
    lprc2 = arc + 1;

ReScan:
    while (lprc2 < lprcL)
    {
        //
        // Scan all rectangles before this one looking for intersections.
        //
        for (lprc1 = arc; lprc1 < lprc2; lprc1++)
        {
            RECT rcI;

            //
            // Move one of the rectanges if there is an intersection.
            //
            if (IntersectRect(&rcI, lprc1, lprc2))
            {
                //
                // Move one of the rectangles out of the way and then restart
                // the scan for overlaps with that rectangle (since moving it
                // may have created new overlaps).
                //
                lprc2 = RemoveOverlap(lprc1, lprc2, &rcI);
                goto ReScan;
            }
        }

        lprc2++;
    }
}
开发者ID:conioh,项目名称:os-design,代码行数:52,代码来源:alignrec.c


示例12: FindChildAtPointEnumProc

// ChildWindowFromPoint() messes up with group boxes
static BOOL CALLBACK FindChildAtPointEnumProc(HWND hwnd, LPARAM lParam)
{
	if (IsWindowVisible(hwnd)) {
		struct FindChildAtPointData *fcap = (struct FindChildAtPointData*)lParam;
		RECT rcVisible, rc, rcParent;
		GetWindowRect(hwnd, &rc);
		GetWindowRect(GetParent(hwnd), &rcParent);
		IntersectRect(&rcVisible, &rcParent, &rc);
		if (PtInRect(&rcVisible, fcap->pt)) {
			int thisArea = (rc.bottom - rc.top)*(rc.right - rc.left);
			if (thisArea && (thisArea<fcap->bestArea || fcap->bestArea == 0)) {
				fcap->bestArea = thisArea;
				fcap->hwnd = hwnd;
			}
		}
	}
	return TRUE;
}
开发者ID:wyrover,项目名称:miranda-ng,代码行数:19,代码来源:dlgboxsubclass.cpp


示例13: WdeFindObjectsInRect

bool WdeFindObjectsInRect( RECT *r, LIST **obj_list, LIST *olist )
{
    OBJPTR   child;
    RECT     child_rect;
    RECT     irect;

    *obj_list = NULL;

    for( ; olist != NULL; olist = ListNext( olist ) ) {
        child = ListElement( olist );
        Location( child, &child_rect );
        if( IntersectRect( &irect, &child_rect, r ) ) {
            WdeInsertObject( obj_list, child );
        }
    }

    return( *obj_list != NULL );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:18,代码来源:wdezordr.c


示例14: IntersectRect

HRESULT IE_IOleInSiteWindowless::InvalidateRect(LPCRECT pRect, BOOL fErase)
{
	//DEBUG("************IOleInPlaceSiteWindowless::InvalidateRect");
	// Clip the rectangle against the object's size and invalidate it
	RECT rcI = { 0, 0, 0, 0 };
	RECT posRect=m_fs->m_IEWindow->SetBounds();
	if (pRect == NULL)
	{
		rcI = posRect;
	}
	else
	{
		IntersectRect(&rcI, &posRect, pRect);
	}
	::InvalidateRect(m_fs->m_hWndParent, &rcI, fErase);
 
	return S_OK;
}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:18,代码来源:CWebSite.cpp


示例15: DrawDC_Bmp

void CTyHMProxy::DrawDC_Bmp(CDC *pDC, CElecMapView *pView)
{
	float minx,miny,maxx,maxy;
	pView->GetFloatRect(&minx,&miny,&maxx,&maxy);
	if (!IntersectRect(minx,miny,maxx,maxy)) return;


	GetRect(&minx,&miny,&maxx,&maxy);
	CPoint pt1,pt2;
	pt1=pView->UPtoLP(minx,miny);
	pt2=pView->UPtoLP(maxx,maxy);
	CRect rt;
	rt.SetRect(pt1,pt2);
	rt.NormalizeRect();
  
	DrawImage(m_str1,pDC,pt1.x,pt1.y,rt.Width(),rt.Height(),m_bTranslate1,m_color1);

}
开发者ID:github188,项目名称:MonitorSystem,代码行数:18,代码来源:ShuZhi.cpp


示例16: playerMonsterCollision

bool Collision::playerMonsterCollision(Player* player, MonsterManager* mm)
{
    vUnit* mons = mm->getMonsters();
    RECT r;

    viUnit iter = mons->begin();
    for (; iter != mons->end(); iter++)
    {
        if (IntersectRect(&r, &player->getRect(), &(*iter)->getRect()) &&
                !player->isUnbeatable())
        {
            player->hit((player->getX() < (*iter)->getX()) ? LEFT : RIGHT, (*iter)->getAtk());
            return true;
        }
    }

    return false;
}
开发者ID:wakeup5,项目名称:Terraria,代码行数:18,代码来源:Collision.cpp


示例17: MakeRealRect

BOOL Protocol::ItemInRect
  (
  OpWndItemD* wi,
  LPRECT      lprc,
  BOOL        fReqFullEnclosure
  )

  {
  BOOL  fRet;
  RECT  rcItem;

  if(m_fFrames)
    {
    if(fReqFullEnclosure)
      {
      MakeRealRect(&rcItem, &wi->m_rcItem);

      fRet =  (lprc->left   <= rcItem.left)
                     &&
              (lprc->top    <= rcItem.top)
                     &&
              (lprc->right  >= rcItem.right)
                     &&
              (lprc->bottom >= rcItem.bottom);
      }
    else
      {
      RECT  rcIntr;
      RECT  rcTemp;

      MakeRealRect(&rcItem, &wi->m_rcItem);
      CopyRect(&rcTemp, lprc);

      if (rcTemp.left == rcTemp.right) rcTemp.right++;
      if (rcTemp.top == rcTemp.bottom) rcTemp.bottom++;

      fRet = IntersectRect(&rcIntr, &rcTemp, &rcItem);
      }
    }
  else
    fRet = wi->ItemInRect(lprc, fReqFullEnclosure);

  return fRet;
  }
开发者ID:benbucksch,项目名称:AppWare,代码行数:44,代码来源:LAY_PROT.CPP


示例18: IntersectRect

STDMETHODIMP CGfxFB::SetDstRect(const RECT *pRect)
{
	if(EqualRect(pRect,&m_rectDst))
		return S_OK;

	m_rectDst = *pRect;
	IntersectRect(&m_rectDst,&m_rectScn,&m_rectDst);

#ifdef PXA_LINUX
	DP("FB Setdest(%d,%d,%d,%d) \n",m_rectDst.left, m_rectDst.top, m_rectDst.right, m_rectDst.bottom);
	return E_UNEXPECTED;

	m_fbvinfo.xres  = (m_rectDst.right - m_rectDst.left)&(~(DST_ALIGN-1));
	m_fbvinfo.yres  = (m_rectDst.bottom - m_rectDst.top)&(~(DST_ALIGN -1));

	m_fbvinfo.bits_per_pixel = 19;
	m_fbvinfo.nonstd = (FORMAT_PLANAR_420<< 20) | (m_rectDst.top << 10) | m_rectDst.left;

	if (m_pBuff != NULL)
	{
		munmap(m_pBuff, m_iBufSize);
		m_pBuff = NULL;
	}

	DP("Update info: left = %d, top = %d, xres = %d, yres = %d\n", m_fbvinfo.nonstd&0x3ff, (m_fbvinfo.nonstd>>10)&0x3ff, m_fbvinfo.xres, m_fbvinfo.yres);


	int ret = ioctl(m_iHndFB, FBIOPUT_VSCREENINFO, &m_fbvinfo);
	DP("Update()::FBIOPUT_VSCREENINFO :%d \n", ret);
	
	ioctl(m_iHndFB, FBIOGET_FSCREENINFO, &m_fbfinfo);
	m_iBufSize = m_fbfinfo.smem_len;
	DP("Update()::m_iBufSize  :%d \n", m_iBufSize );
	m_pBuff = (unsigned char *)mmap(0, m_iBufSize, PROT_READ | PROT_WRITE, MAP_SHARED, m_iHndFB, 0);
	if(m_pBuff ==NULL)
	{
		DP("Update()::set dest failed \n");
		return E_FAIL;
	}
#endif

	Update();
	return S_OK;
}
开发者ID:xuweiqiang,项目名称:LibVRPresent,代码行数:44,代码来源:GfxFramebuffer.cpp


示例19: __createWindow0

HWND __createWindow0(   MHND hmMonitor,LPCTSTR lpClassName,LPCTSTR lpWindowName,
                        DWORD dwStyle,int x,int y,int nWidth,
                        int nHeight,HWND hWndParent,HMENU hMenu,
                        HANDLE hInstance,LPVOID lpParam )
{
    HWND    retCode = NULL;

    if( (NULL != hmMonitor) && (NULL != lpClassName) &&
        (NULL != lpWindowName) && (NULL != hInstance) )
    {
        RECT    rRW     = {0,0,0,0};
        RECT    rRM     = {0,0,0,0};
        RECT    rSect   = {0,0,0,0};

        SetRect(&rRW,x,y,x+nWidth,y+nHeight);

        if( TRUE == _monitorBounds(hmMonitor,&rRM) )
        {
            __normaRectPos(&rRW,rRW,rRM);

            IntersectRect(&rSect,&rRM,&rRW);

            if( TRUE == EqualRect(&rSect,&rRW) )
            {
                x = rSect.left;
                y = rSect.top;
                nWidth = rSect.right - rSect.left;
                nHeight = rSect.bottom - rSect.top;
                retCode = CreateWindow(
                                            lpClassName,lpWindowName,
                                            dwStyle,x,y,nWidth,
                                            nHeight,hWndParent,hMenu,
                                            (HINSTANCE)hInstance,lpParam
                                        );
            } else  {
                    //  A coisa indefinida. Nao tenho sabdoria o que
                    //  fazer aqui mesmo
                    //  E necessario perguntar Jeannette
                    }
        }
    }

    return retCode;
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:44,代码来源:awt_MMStub.cpp


示例20: GUARD

/*
====================
Flush
====================
*/
VOID BrushCircle::Flush(const Map* map, const Vector3& pt)
{
	GUARD(BrushCircle::Flush);

	CHECK(map);

	// compute the view
	F32 radius = this->Radius();
	Vector4 rect(pt[0]-radius, pt[1]-radius, pt[0]+radius, pt[1]+radius);
	Rect src, dst, clip;
/*	
	src.left	= U2P(rect[0])/U2P(CHUNK_STRIDE);
	src.top		= U2P(rect[1])/U2P(CHUNK_STRIDE);
	src.right	= (U2P(rect[2])%U2P(CHUNK_STRIDE)) ? (U2P(rect[2])/U2P(CHUNK_STRIDE)+1) : U2P(rect[2])/U2P(CHUNK_STRIDE);
	src.bottom	= (U2P(rect[3])%U2P(CHUNK_STRIDE)) ? (U2P(rect[3])/U2P(CHUNK_STRIDE)+1) : U2P(rect[3])/U2P(CHUNK_STRIDE);
*/
	src.left	= (U2P(rect[0])%U2P(CHUNK_STRIDE)) ? (U2P(rect[0])/U2P(CHUNK_STRIDE)-1) : U2P(rect[0])/U2P(CHUNK_STRIDE);
	src.top		= (U2P(rect[1])%U2P(CHUNK_STRIDE)) ? (U2P(rect[1])/U2P(CHUNK_STRIDE)-1) : U2P(rect[1])/U2P(CHUNK_STRIDE);
	src.right	= (U2P(rect[2])%U2P(CHUNK_STRIDE)) ? (U2P(rect[2])/U2P(CHUNK_STRIDE)+1) : U2P(rect[2])/U2P(CHUNK_STRIDE);
	src.bottom	= (U2P(rect[3])%U2P(CHUNK_STRIDE)) ? (U2P(rect[3])/U2P(CHUNK_STRIDE)+1) : U2P(rect[3])/U2P(CHUNK_STRIDE);

	dst.left	= -map->mWidth/2;
	dst.top		= 0;
	dst.right	= map->mWidth/2;
	dst.bottom	= map->mHeight;	
	IntersectRect(&clip, &dst, &src);
	for(I32 j = clip.top; j < clip.bottom; j++)
	{
		for(I32 i = clip.left; i < clip.right; i++)
		{
			std::pair<I32,I32> coord(i,j);
			std::map< std::pair<I32,I32>, ChunkPtr >::const_iterator it = map->mChunks.find(coord);
			if(it == map->mChunks.end()) continue;
			EChunkPtr chunk =  dynamic_ptr_cast<EChunk>(it->second);
			Matrix world = Matrix::makeTranslate(i*CHUNK_STRIDE,j*CHUNK_STRIDE,0);
			Matrix world_inv; world_inv.invert(world);
			Vector3 point = pt * world_inv;
			this->Flush(chunk.Ptr(), point);
		}
	}

	UNGUARD;
}
开发者ID:sundoom,项目名称:glare,代码行数:48,代码来源:Brush.cpp



注:本文中的IntersectRect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Intersection函数代码示例发布时间:2022-05-30
下一篇:
C++ InterruptTheCard函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap