您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CGMainDisplayID函数代码示例

51自学网 2021-06-01 19:59:55
  C++
这篇教程C++ CGMainDisplayID函数代码示例写得很实用,希望能帮到您。

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

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

示例1: main

int main(int argc, char * argv[]){    IOReturn            err;    CGDirectDisplayID   dspy = CGMainDisplayID();    io_service_t        framebuffer;    CGRect              bounds;    vm_address_t        buffer;    vm_size_t           size, rowBytes;    framebuffer = CGDisplayIOServicePort(dspy);    assert (framebuffer != MACH_PORT_NULL);    dspy = CGMainDisplayID();    bounds = CGDisplayBounds(dspy);    rowBytes = CGDisplayBytesPerRow(dspy);    err = IOAccelReadFramebuffer(framebuffer, bounds.size.width, bounds.size.height, rowBytes,                                 &buffer, &size);    if (kIOReturnSuccess == err)    {        fprintf(stderr, "writing 0x%x bytes from 0x%x/n", size, buffer);        write(STDOUT_FILENO, (const void *) buffer, size);        vm_deallocate(mach_task_self(), buffer, size);    }    return (0);}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:25,


示例2: screen

static CGDirectDisplayID screen(void* w) {  HIRect bounds;  OSStatus err = HIWindowGetBounds((WindowRef)w, kWindowGlobalPortRgn,                                    kHICoordSpace72DPIGlobal, &bounds);  if (err) {    lprintf("HIWindowGetBounds failed: %d/n", err);    return CGMainDisplayID();  }  CGDirectDisplayID display;  CGDisplayCount displayCount;  CGDisplayErr e = CGGetDisplaysWithRect(bounds, 1,                                          &display, &displayCount);  return (displayCount && !e) ? display : CGMainDisplayID();}
开发者ID:ardeujho,项目名称:self,代码行数:14,


示例3: GetMonitorProfile

            void GetMonitorProfile(wxString& profileName, cmsHPROFILE& profile)            {                ColorsyncIteratorData data;                data.dispuuid = CGDisplayCreateUUIDFromDisplayID(CGMainDisplayID());                if (data.dispuuid == NULL)                {                    DEBUG_INFO("CGDisplayCreateUUIDFromDisplayID() failed.");                    return;                }                data.url = NULL;                ColorSyncIterateDeviceProfiles(ColorSyncIterateCallback, (void *)&data);                CFRelease(data.dispuuid);                CFStringRef urlstr = CFURLCopyFileSystemPath(data.url, kCFURLPOSIXPathStyle);                CFRelease(data.url);                if (urlstr == NULL)                {                    DEBUG_INFO("Failed to get URL in CFString");                }                else                {                    CFRetain(urlstr);                    profileName = wxCFStringRef(urlstr).AsString(wxLocale::GetSystemEncoding());                    profile = cmsOpenProfileFromFile(profileName.c_str(), "r");                    DEBUG_INFO("Found profile: " << profileName.c_str());                };            };
开发者ID:ndevenish,项目名称:Hugin,代码行数:27,


示例4: listDisplays

voidlistDisplays(void){   CGDisplayErr      dErr;    CGDisplayCount    displayCount, i;    CGDirectDisplayID mainDisplay;    CGDisplayCount    maxDisplays = MAX_DISPLAYS;    CGDirectDisplayID onlineDisplays[MAX_DISPLAYS];       mainDisplay = CGMainDisplayID();       dErr = CGGetOnlineDisplayList(maxDisplays, onlineDisplays, &displayCount);    if (dErr != kCGErrorSuccess) {        fprintf(stderr, "CGGetOnlineDisplayList: error %d./n", dErr);        exit(1);    }       printf("Display ID       Resolution/n");    for (i = 0; i < displayCount; i++) {        CGDirectDisplayID dID = onlineDisplays[i];        printf("%-16p %lux%lu %32s", dID,               CGDisplayPixelsWide(dID), CGDisplayPixelsHigh(dID),               (dID == mainDisplay) ? "[main display]/n" : "/n");    }       exit(0);}
开发者ID:Pfiver,项目名称:fb-rotate,代码行数:27,


示例5: Open

static int Open(void * hwnd){    CGLRendererInfoObj renderer;    long numRenderer;	CGDirectDisplayID l[32];	CGDisplayCount count;	SYS_ASSERT(g_pCGLC == 0);	UNUSED(hwnd);	CGGetActiveDisplayList (sizeof(l), l, &count);#ifdef _DEBUG	// Debug in multiple monitor. Use the secondary monitor for rendering	g_cgDisplayID = l[count-1];#else	g_cgDisplayID = CGMainDisplayID ();#endif	g_cgPrevDisplayMode = CGDisplayCurrentMode (g_cgDisplayID);	g_cgDisplayModeList = CGDisplayAvailableModes (g_cgDisplayID);    CGLQueryRendererInfo(CGDisplayIDToOpenGLDisplayMask(g_cgDisplayID), &renderer, &numRenderer);    CGLDestroyRendererInfo(renderer);    return 0;}
开发者ID:cbxbiker61,项目名称:nogravity,代码行数:26,


示例6: CGMainDisplayID

nglVideoMode::nglVideoMode(){#ifdef __NGL_MACHO__  mDisplay = CGMainDisplayID();#endif    Init();#ifdef __NGL_MACHO__  CFDictionaryRef displayMode ;  CFNumberRef number ;  displayMode = (CFDictionaryRef) CGDisplayCurrentMode((CGDirectDisplayID)mDisplay) ;  /* Get the height and width of this display mode. Print them out. */  number = (CFNumberRef)CFDictionaryGetValue( displayMode, kCGDisplayWidth ) ;  CFNumberGetValue( number, kCFNumberLongType, &mWidth ) ;  number = (CFNumberRef)CFDictionaryGetValue( displayMode, kCGDisplayHeight ) ;  CFNumberGetValue( number, kCFNumberLongType, &mHeight ) ;  number = (CFNumberRef)CFDictionaryGetValue( displayMode, kCGDisplayRefreshRate ) ;  CFNumberGetValue( number, kCFNumberLongType, &mRate ) ;  number = (CFNumberRef)CFDictionaryGetValue( displayMode, kCGDisplayBitsPerPixel ) ;  CFNumberGetValue( number, kCFNumberLongType, &mBPP ) ;#else  mWidth = 800;  mHeight = 600;  mBPP = 32;  mRate = 60;#endif}
开发者ID:hamedmohammadi,项目名称:nui3,代码行数:29,


示例7: macdrv_displays_changed

/*********************************************************************** *              macdrv_displays_changed * * Handler for DISPLAYS_CHANGED events. */void macdrv_displays_changed(const macdrv_event *event){    HWND hwnd = GetDesktopWindow();    /* A system display change will get delivered to all GUI-attached threads,       so the desktop-window-owning thread will get it and all others should       ignore it.  A synthesized display change event due to activation       will only get delivered to the activated process.  So, it needs to       process it (by sending it to the desktop window). */    if (event->displays_changed.activating ||        GetWindowThreadProcessId(hwnd, NULL) == GetCurrentThreadId())    {        CGDirectDisplayID mainDisplay = CGMainDisplayID();        CGDisplayModeRef mode = CGDisplayCopyDisplayMode(mainDisplay);        size_t width = CGDisplayModeGetWidth(mode);        size_t height = CGDisplayModeGetHeight(mode);        int mode_bpp = display_mode_bits_per_pixel(mode);        struct display_mode_descriptor* desc = create_original_display_mode_descriptor(mainDisplay);        BOOL is_original = display_mode_matches_descriptor(mode, desc);        free_display_mode_descriptor(desc);        CGDisplayModeRelease(mode);        if (is_original && retina_enabled)        {            width *= 2;            height *= 2;        }        SendMessageW(hwnd, WM_MACDRV_UPDATE_DESKTOP_RECT, mode_bpp,                     MAKELPARAM(width, height));    }}
开发者ID:AmesianX,项目名称:wine,代码行数:38,


示例8: VID_GetGamma

int VID_GetGamma(unsigned short *ramps, int rampsize){	CGGammaValue table_red [GAMMA_TABLE_SIZE];	CGGammaValue table_green [GAMMA_TABLE_SIZE];	CGGammaValue table_blue [GAMMA_TABLE_SIZE];	CGTableCount actualsize = 0;	int i;	// Get the gamma ramps from the system	if (CGGetDisplayTransferByTable(CGMainDisplayID(), rampsize, table_red, table_green, table_blue, &actualsize) != CGDisplayNoErr)	{		Con_Print("VID_GetGamma: ERROR: CGGetDisplayTransferByTable failed!/n");		return false;	}	if (actualsize != (unsigned int)rampsize)	{		Con_Printf("VID_GetGamma: ERROR: invalid gamma table size (%u != %u)/n", actualsize, rampsize);		return false;	}	// Convert the 3 float tables into 1 unsigned short table	for (i = 0; i < rampsize; i++)		ramps[i] = table_red[i] * 65535.0f;	for (i = 0; i < rampsize; i++)		ramps[i + rampsize] = table_green[i] * 65535.0f;	for (i = 0; i < rampsize; i++)		ramps[i + 2 * rampsize] = table_blue[i] * 65535.0f;	return true;}
开发者ID:CyberSys,项目名称:darkplaces,代码行数:30,


示例9: VID_ListModes

size_t VID_ListModes(vid_mode_t *modes, size_t maxcount){	CGDirectDisplayID mainDisplay = CGMainDisplayID();	CFArrayRef vidmodes = CGDisplayAvailableModes(mainDisplay);	CFDictionaryRef thismode;	unsigned int n = CFArrayGetCount(vidmodes);	unsigned int i;	size_t k;	k = 0;	for(i = 0; i < n; ++i)	{		thismode = (CFDictionaryRef) CFArrayGetValueAtIndex(vidmodes, i);		if(!GetDictionaryBoolean(thismode, kCGDisplayModeIsSafeForHardware))			continue;		if(k >= maxcount)			break;		modes[k].width = GetDictionaryLong(thismode, kCGDisplayWidth);		modes[k].height = GetDictionaryLong(thismode, kCGDisplayHeight);		modes[k].bpp = GetDictionaryLong(thismode, kCGDisplayBitsPerPixel);		modes[k].refreshrate = GetDictionaryLong(thismode, kCGDisplayRefreshRate);		modes[k].pixelheight_num = 1;		modes[k].pixelheight_denom = 1; // OS X doesn't expose this either		++k;	}	return k;}
开发者ID:CyberSys,项目名称:darkplaces,代码行数:28,


示例10: screeninit

voidscreeninit(void){	int fmt;	int dx, dy;	ProcessSerialNumber psn = { 0, kCurrentProcess };	TransformProcessType(&psn, kProcessTransformToForegroundApplication);	SetFrontProcess(&psn);	fmt = XBGR32; //XRGB32;	devRect = max_bounds();	dx = devRect.size.width;	dy = devRect.size.height;	gscreen = allocmemimage(Rect(0,0,dx,dy), fmt);	dataProviderRef = CGDataProviderCreateWithData(0, gscreen->data->bdata,					dx * dy * 4, 0);	fullScreenImage = CGImageCreate(dx, dy, 8, 32, dx * 4,				CGColorSpaceCreateDeviceRGB(),				kCGImageAlphaNoneSkipLast,				dataProviderRef, 0, 0, kCGRenderingIntentDefault);	devRect = CGDisplayBounds(CGMainDisplayID());	kproc("osxscreen", winproc, nil, 0);	kproc("osxflush", flushproc, nil, 0);	Sleep(&rend, isready, nil);}
开发者ID:Vykook,项目名称:acme-sac,代码行数:28,


示例11: glutWarpPointer

void Input::confineMouse(){    if (!bWarpMouse)        return;#ifdef TARGET_WIN32    glutWarpPointer(renderer->windowX/2,renderer->windowY/2);#endif#ifdef TARGET_LINUX    glutWarpPointer(renderer->windowX/2,renderer->windowY/2);#endif#ifdef TARGET_MACOSX	CGPoint myPoint;	    int centerX=renderer->windowX/2;	    int centerY=renderer->windowY/2;	myPoint.x=centerX+renderer->windowPosX;	myPoint.y=centerY+renderer->windowPosY;	CGDisplayMoveCursorToPoint( CGMainDisplayID (),myPoint);#endif	mouseX=renderer->windowX/2;	mouseY=renderer->windowY/2;}
开发者ID:ElementalSpork,项目名称:Moviesandbox,代码行数:26,


示例12: CGMainDisplayID

VideoMode VideoModeImpl::getDesktopMode(){    CGDirectDisplayID display = CGMainDisplayID();    return VideoMode(CGDisplayPixelsWide(display),                      CGDisplayPixelsHigh(display),                      displayBitsPerPixel(display));}
开发者ID:AdamFlores,项目名称:SFML,代码行数:7,


示例13: sizeof

static void *gfx_ctx_cgl_init(void *video_driver){   CGError err;   gfx_ctx_cgl_data_t *cgl = (gfx_ctx_cgl_data_t*)calloc(1, sizeof(gfx_ctx_cgl_data_t));   if (!cgl)      goto error;   cgl->displayID = CGMainDisplayID();   err = CGDisplayCapture(cgl->displayID);   if (err != kCGErrorSuccess)      goto error;   cgl->glCtx = gfx_ctx_cgl_init_create();   if (!cgl->glCtx)      goto error;   attach_gl_context_to_window(cgl->glCtx,   CGShieldingWindowID(cgl->displayID), &cgl->width, &cgl->height);   printf("size:%dx%d/n", cgl->width, cgl->height);   CGLSetCurrentContext(cgl->glCtx);   return cgl;error:   gfx_ctx_cgl_destroy(cgl);   return NULL;}
开发者ID:Sotsukun,项目名称:RetroArch,代码行数:34,


示例14: wxDisplayDepth

// Returns depth of screenint wxDisplayDepth(){    int theDepth = 0;    #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060    if ( UMAGetSystemVersion() >= 0x1060 )     {        CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay);        CFStringRef encoding = CGDisplayModeCopyPixelEncoding(currentMode);                if(CFStringCompare(encoding, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)            theDepth = 32;        else if(CFStringCompare(encoding, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)            theDepth = 16;        else if(CFStringCompare(encoding, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)            theDepth = 8;        else            theDepth = 32; // some reasonable default        CFRelease(encoding);        CGDisplayModeRelease(currentMode);    }    else#endif    {#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060        theDepth = (int) CGDisplayBitsPerPixel(CGMainDisplayID());#endif    }    return theDepth;}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:32,


示例15: CGMainDisplayID

//---------------------------------------------------------------------------// AGL init//---------------------------------------------------------------------------bool Pipe::configInit(){    CGDirectDisplayID displayID = CGMainDisplayID();    const uint32_t device = getPipe()->getDevice();    if( device != LB_UNDEFINED_UINT32 )    {        CGDirectDisplayID *displayIDs = static_cast< CGDirectDisplayID* >(            alloca( (device+1) * sizeof( displayIDs )));        CGDisplayCount    nDisplays;        if( CGGetOnlineDisplayList( device+1, displayIDs, &nDisplays ) !=            kCGErrorSuccess )        {            sendError( ERROR_AGLPIPE_DISPLAYS_NOTFOUND );            return false;        }        if( nDisplays <= device )        {            sendError( ERROR_AGLPIPE_DEVICE_NOTFOUND );            return false;        }        displayID = displayIDs[device];    }    _setCGDisplayID( displayID );    LBVERB << "Using CG displayID " << displayID << std::endl;    return true;}
开发者ID:ImpressionMe,项目名称:Equalizer,代码行数:34,


示例16: MacGetBounds

OSStatus wxOverlayImpl::CreateOverlayWindow(){    OSStatus err;    WindowAttributes overlayAttributes  = kWindowIgnoreClicksAttribute;    if ( m_window )    {        m_overlayParentWindow =(WindowRef) m_window->MacGetTopLevelWindowRef();        Rect bounds ;        MacGetBounds(&bounds);        err  = CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, &m_overlayWindow );        if ( err == noErr )        {            SetWindowGroup( m_overlayWindow, GetWindowGroup(m_overlayParentWindow));    //  Put them in the same group so that their window layers are consistent        }    }    else    {        m_overlayParentWindow = NULL ;        CGRect cgbounds ;        cgbounds = CGDisplayBounds(CGMainDisplayID());        Rect bounds;        bounds.top = (short)cgbounds.origin.y;        bounds.left = (short)cgbounds.origin.x;        bounds.bottom = (short)(bounds.top + cgbounds.size.height);        bounds.right = (short)(bounds.left  + cgbounds.size.width);        err  = CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, &m_overlayWindow );    }    ShowWindow(m_overlayWindow);    return err;}
开发者ID:EdgarTx,项目名称:wx,代码行数:33,


示例17: praat_reportGraphicalProperties

void praat_reportGraphicalProperties () {	MelderInfo_open ();	MelderInfo_writeLine (U"Graphical properties of this edition of Praat on this computer:/n");	double x, y, width, height;	Gui_getWindowPositioningBounds (& x, & y, & width, & height);	MelderInfo_writeLine (U"Window positioning area: x = ", x, U", y = ", y,		U", width = ", width, U", height = ", height);	#if defined (macintosh)		CGDirectDisplayID screen = CGMainDisplayID ();		CGSize screenSize_mm = CGDisplayScreenSize (screen);		double diagonal_mm = sqrt (screenSize_mm. width * screenSize_mm. width + screenSize_mm. height * screenSize_mm. height);		double diagonal_inch = diagonal_mm / 25.4;		MelderInfo_writeLine (U"/nScreen size: ", screenSize_mm. width, U" x ", screenSize_mm. height,			U" mm (diagonal ", Melder_fixed (diagonal_mm, 1), U" mm = ", Melder_fixed (diagonal_inch, 1), U" inch)");		size_t screenWidth_pixels = CGDisplayPixelsWide (screen);		size_t screenHeight_pixels = CGDisplayPixelsHigh (screen);		MelderInfo_writeLine (U"Screen /"resolution/": ", screenWidth_pixels, U" x ", screenHeight_pixels, U" pixels");		double resolution = 25.4 * screenWidth_pixels / screenSize_mm. width;		MelderInfo_writeLine (U"Screen resolution: ", Melder_fixed (resolution, 1), U" pixels/inch");	#elif defined (_WIN32)		/*for (int i = 0; i <= 88; i ++)			MelderInfo_writeLine (U"System metric ", i, U": ", GetSystemMetrics (i));*/	#endif	MelderInfo_close ();}
开发者ID:guilhermegarcia,项目名称:praat-1,代码行数:25,


示例18: wxWindowDCImpl

// Create a DC representing the whole screenwxScreenDCImpl::wxScreenDCImpl( wxDC *owner ) :   wxWindowDCImpl( owner ){#if wxOSX_USE_COCOA_OR_CARBON    CGRect cgbounds ;    cgbounds = CGDisplayBounds(CGMainDisplayID());    m_width = (wxCoord)cgbounds.size.width;    m_height = (wxCoord)cgbounds.size.height;#else    wxDisplaySize( &m_width, &m_height );#endif#if wxOSX_USE_COCOA_OR_IPHONE    SetGraphicsContext( wxGraphicsContext::Create() );#else    Rect bounds;    bounds.top = (short)cgbounds.origin.y;    bounds.left = (short)cgbounds.origin.x;    bounds.bottom = bounds.top + (short)cgbounds.size.height;    bounds.right = bounds.left  + (short)cgbounds.size.width;    WindowAttributes overlayAttributes  = kWindowIgnoreClicksAttribute;    CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, (WindowRef*) &m_overlayWindow );    ShowWindow((WindowRef)m_overlayWindow);    SetGraphicsContext( wxGraphicsContext::CreateFromNativeWindow( m_overlayWindow ) );#endif    m_ok = true ;}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:27,


示例19: GetMBarHeight

/* void lock (); */NS_IMETHODIMP OSLock::Lock(){    WindowRef maskWindow = NULL;    Rect winRect;    winRect.top = 0;    winRect.left = 0;    winRect.bottom = GetMBarHeight();    winRect.right = CGDisplayPixelsWide(CGMainDisplayID());    CreateNewWindow(kOverlayWindowClass, kWindowOpaqueForEventsAttribute |                    kWindowDoesNotCycleAttribute,                    &winRect, &maskWindow);    if (maskWindow == NULL) {        printf("maskWindow is NULL/n");    } else {        if (ChangeWindowAttributes(maskWindow, kWindowNoAttributes,                                   kWindowHideOnFullScreenAttribute) != 0) {            printf("Unable to remove kWindowHideOnFullScreenAttribute!/n");        }        ShowWindow(maskWindow);    }        SetSystemUIMode(kUIModeAllHidden, kUIOptionDisableAppleMenu |                    kUIOptionDisableProcessSwitch); // | kUIOptionDisableForceQuit);    //CGCaptureAllDisplays();    return NS_OK;}
开发者ID:ppatrik,项目名称:osl-fx-kiosk,代码行数:28,


示例20: foreach

void Overlay::toggleShow() {	if (g.ocIntercept) {		g.ocIntercept->hideGui();	} else {		foreach(OverlayClient *oc, qlClients) {			if (oc->uiPid) {#if defined(Q_OS_WIN)				HWND hwnd = GetForegroundWindow();				DWORD pid = 0;				GetWindowThreadProcessId(hwnd, &pid);				if (pid != oc->uiPid)					continue;#elif defined(Q_OS_MAC)				pid_t pid = 0;				ProcessSerialNumber psn;				GetFrontProcess(&psn);				GetProcessPID(&psn, &pid);				if (pid != oc->uiPid)					continue;#if 0				// Fullscreen only.				if (! CGDisplayIsCaptured(CGMainDisplayID()))					continue;#endif#endif				oc->showGui();				return;			}		}	}}
开发者ID:Acidburn0zzz,项目名称:mumble,代码行数:31,


示例21: GetListOfResolutions

// Search for available resolutions - TODO: Move to Common?static wxArrayString GetListOfResolutions(){	wxArrayString retlist;	retlist.Add(_("Auto"));#ifdef _WIN32	DWORD iModeNum = 0;	DEVMODE dmi;	ZeroMemory(&dmi, sizeof(dmi));	dmi.dmSize = sizeof(dmi);	std::vector<std::string> resos;	while (EnumDisplaySettings(nullptr, iModeNum++, &dmi) != 0)	{		char res[100];		sprintf(res, "%dx%d", dmi.dmPelsWidth, dmi.dmPelsHeight);		std::string strRes(res);		// Only add unique resolutions		if (std::find(resos.begin(), resos.end(), strRes) == resos.end())		{			resos.push_back(strRes);			retlist.Add(StrToWxStr(res));		}		ZeroMemory(&dmi, sizeof(dmi));	}#elif defined(HAVE_XRANDR) && HAVE_XRANDR	std::vector<std::string> resos;	main_frame->m_XRRConfig->AddResolutions(resos);	for (auto res : resos)		retlist.Add(StrToWxStr(res));#elif defined(__APPLE__)	CFArrayRef modes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), nullptr);	for (CFIndex i = 0; i < CFArrayGetCount(modes); i++)	{		std::stringstream res;		CGDisplayModeRef mode;		CFStringRef encoding;		size_t w, h;		bool is32;		mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(modes, i);		w = CGDisplayModeGetWidth(mode);		h = CGDisplayModeGetHeight(mode);		encoding = CGDisplayModeCopyPixelEncoding(mode);		is32 = CFEqual(encoding, CFSTR(IO32BitDirectPixels));		CFRelease(encoding);		if (!is32)			continue;		if (CGDisplayModeGetIOFlags(mode) & kDisplayModeStretchedFlag)			continue;		res << w << "x" << h;		retlist.Add(res.str());	}	CFRelease(modes);#endif	return retlist;}
开发者ID:TraceBullet,项目名称:dolphin,代码行数:60,


示例22: main

int main (int argc, const char * argv[]){    Command cmd;    char lineBuff[100];        // http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/Quartz_Services_Ref/Reference/reference.html#//apple_ref/doc/uid/TP30001070    g_screenWidth = CGDisplayPixelsWide(CGDisplayPrimaryDisplay(CGMainDisplayID()));    g_screenHeight = CGDisplayPixelsHigh(CGDisplayPrimaryDisplay(CGMainDisplayID()));        while (true) {        readLine(lineBuff, 100);        parseCommand(&cmd, lineBuff);        execCommand(&cmd);    }        return 0;}
开发者ID:Aiur,项目名称:Airtab,代码行数:17,


示例23: inputBegin

InputContext* inputBegin() {  OSXInputContext* ctx = new OSXInputContext();  ctx->displayID = CGMainDisplayID();  printf("inputBegin complete/n");  return ctx;}
开发者ID:joeferner,项目名称:camera-multitouch,代码行数:8,


示例24: wxDisplaySizeMM

void wxDisplaySizeMM(int *width, int *height){    CGSize size = CGDisplayScreenSize(CGMainDisplayID());    if ( width )        *width = (int)size.width ;    if ( height )        *height = (int)size.height;}
开发者ID:Metallicow,项目名称:wxWidgets,代码行数:8,


示例25: wxDisplaySize

// Get size of displayvoid wxDisplaySize(int *width, int *height){    // TODO adapt for multi-displays    CGRect bounds = CGDisplayBounds(CGMainDisplayID());    if ( width )        *width = (int)bounds.size.width ;    if ( height )        *height = (int)bounds.size.height;}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:10,


示例26: convertSFModeToCGMode

CFDictionaryRef convertSFModeToCGMode(VideoMode sfmode){    // If sfmode is in VideoMode::GetFullscreenModes    // then this should be an exact match (see NULL parameter doc).    return CGDisplayBestModeForParameters(CGMainDisplayID(),                                          sfmode.BitsPerPixel,                                          sfmode.width,                                          sfmode.height,                                          NULL);}
开发者ID:Ancurio,项目名称:SFML,代码行数:10,


示例27: defined

//--------------------------------------------------------------bool ofxDetectDisplays::isMirroringEnabled(){#if defined(TARGET_OSX)    return CGDisplayIsInMirrorSet(CGMainDisplayID());#elif defined(TARGET_WIN32)	// have not found yet how to do this on Windows	return false;#endif}
开发者ID:smallfly,项目名称:ofxDetectDisplays,代码行数:11,



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


C++ CGPointMake函数代码示例
C++ CGInteger函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。