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

C++ setVideoMode函数代码示例

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

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



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

示例1: _priority

ProtoConnectionWrapper::ProtoConnectionWrapper(const QString &address,
											   int priority,
											   int duration_ms,
											   bool skipProtoReply)
	: _priority(priority)
	, _duration_ms(duration_ms)
	, _connection(address.toStdString())
{
	_connection.setSkipReply(skipProtoReply);
	connect(&_connection, SIGNAL(setGrabbingMode(GrabbingMode)), this, SIGNAL(setGrabbingMode(GrabbingMode)));
	connect(&_connection, SIGNAL(setVideoMode(VideoMode)), this, SIGNAL(setVideoMode(VideoMode)));
}
开发者ID:XfableX,项目名称:hyperion.ng,代码行数:12,代码来源:ProtoConnectionWrapper.cpp


示例2: endDraw

bool Graphics::resizeScreen(const int width, const int height)
{
#ifdef USE_SDL2
    endDraw();

    mRect.w = static_cast<int32_t>(width / mScale);
    mRect.h = static_cast<int32_t>(height / mScale);
    mWidth = width / mScale;
    mHeight = height / mScale;
    mActualWidth = width;
    mActualHeight = height;

#ifdef USE_OPENGL
    // +++ probably this way will not work in windows/mac
    // Setup OpenGL
    glViewport(0, 0, mActualWidth, mActualHeight);
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
#else
    // +++ need impliment resize in soft mode
#endif  // USE_OPENGL

    screenResized();
    beginDraw();
    return true;

#else
    const int prevWidth = mWidth;
    const int prevHeight = mHeight;

    endDraw();

    const bool success = setVideoMode(width, height, mScale, mBpp,
        mFullscreen, mHWAccel, mEnableResize, mNoFrame);

    // If it didn't work, try to restore the previous size. If that didn't
    // work either, bail out (but then we're in deep trouble).
    if (!success)
    {
        if (!setVideoMode(prevWidth, prevHeight, mScale, mBpp,
            mFullscreen, mHWAccel, mEnableResize, mNoFrame))
        {
            return false;
        }
    }

    screenResized();
    beginDraw();

    return success;
#endif  // USE_SDL2
}
开发者ID:supermukmin,项目名称:ManaPlus,代码行数:51,代码来源:graphics.cpp


示例3: setImageRegistrationMode

 OniStatus setImageRegistrationMode(OniImageRegistrationMode mode)
 {
   if (!isImageRegistrationModeSupported(mode))
     return ONI_STATUS_NOT_SUPPORTED;
   image_registration_mode = mode;
   return setVideoMode(video_mode);
 }
开发者ID:BoSicle,项目名称:libfreenect,代码行数:7,代码来源:DepthStream.hpp


示例4: SDLInitException

void SDLAppDisplay::init(std::string window_title, int width, int height, bool fullscreen) {

    if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO) != 0) {
        throw SDLInitException(SDL_GetError());
    }

    const SDL_VideoInfo* display_info = SDL_GetVideoInfo();

    //save the desktop resolution
    desktop_width  = display_info->current_w;
    desktop_height = display_info->current_h;
      
    atexit(SDL_Quit);

    SDL_EnableUNICODE(1);

#if SDL_VERSION_ATLEAST(1,3,0)
#else
    SDL_WM_SetCaption(window_title.c_str(),0);
#endif

    setVideoMode(width, height, fullscreen);

    //get actual opengl viewport
    GLint viewport[4];
    glGetIntegerv( GL_VIEWPORT, viewport );

    this->width      = viewport[2];
    this->height     = viewport[3];
    this->fullscreen = fullscreen;
}
开发者ID:atondwal,项目名称:Core,代码行数:31,代码来源:display.cpp


示例5: getVideoModes

	void Core::setVideoModeIndex(int index, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel) {
		std::vector<Rectangle> resList = getVideoModes();
		if(index >= resList.size())
			return;
		
		setVideoMode(resList[index].w, resList[index].h, fullScreen, vSync, aaLevel, anisotropyLevel);
	}
开发者ID:Avangelin,项目名称:Polycode,代码行数:7,代码来源:PolyCore.cpp


示例6: setProperty

    virtual OniStatus setProperty(int propertyId, const void* data, int dataSize)
    {
      switch (propertyId)
      {
        default:
        case ONI_STREAM_PROPERTY_HORIZONTAL_FOV:      // float: radians
        case ONI_STREAM_PROPERTY_VERTICAL_FOV:        // float: radians
        case ONI_STREAM_PROPERTY_MAX_VALUE:           // int
        case ONI_STREAM_PROPERTY_MIN_VALUE:           // int
        case ONI_STREAM_PROPERTY_STRIDE:              // int
        case ONI_STREAM_PROPERTY_NUMBER_OF_FRAMES:    // int
        // camera
        case ONI_STREAM_PROPERTY_AUTO_WHITE_BALANCE:  // OniBool
        case ONI_STREAM_PROPERTY_AUTO_EXPOSURE:       // OniBool
        // xn
        case XN_STREAM_PROPERTY_INPUT_FORMAT:         // unsigned long long
        case XN_STREAM_PROPERTY_CROPPING_MODE:        // XnCroppingMode
          return ONI_STATUS_NOT_SUPPORTED;

        case ONI_STREAM_PROPERTY_VIDEO_MODE:          // OniVideoMode*
        #if 0
          if (dataSize != sizeof(OniVideoMode))
          {
            LogError("Unexpected size for ONI_STREAM_PROPERTY_VIDEO_MODE");
            return ONI_STATUS_ERROR;
          }
          if (ONI_STATUS_OK != setVideoMode(*(static_cast<const OniVideoMode*>(data))))
          raisePropertyChanged(propertyId, data, dataSize);
          return ONI_STATUS_OK;
          #endif
            return ONI_STATUS_NOT_SUPPORTED;

        case ONI_STREAM_PROPERTY_CROPPING:            // OniCropping*
        #if 0
          if (dataSize != sizeof(OniCropping))
          {
            LogError("Unexpected size for ONI_STREAM_PROPERTY_CROPPING");
            return ONI_STATUS_ERROR;
          }
          cropping = *(static_cast<const OniCropping*>(data));
          raisePropertyChanged(propertyId, data, dataSize);
          return ONI_STATUS_OK;
          #endif
            return ONI_STATUS_NOT_SUPPORTED;

        case ONI_STREAM_PROPERTY_MIRRORING:           // OniBool
        #if 0
          if (dataSize != sizeof(OniBool))
          {
            LogError("Unexpected size for ONI_STREAM_PROPERTY_MIRRORING");
            return ONI_STATUS_ERROR;
          }
          mirroring = *(static_cast<const OniBool*>(data));
          raisePropertyChanged(propertyId, data, dataSize);
          return ONI_STATUS_OK;
        #endif
            return ONI_STATUS_NOT_SUPPORTED;

      }
    }
开发者ID:eruffaldi,项目名称:ros_openni2_driver,代码行数:60,代码来源:VideoStream.hpp


示例7: fprintf

bool
IOContext_SDL::init()
{
    if(!(SDL_WasInit(0) & SDL_INIT_VIDEO)) {
        if(SDL_Init(SDL_INIT_VIDEO) != 0) {
            fprintf(stderr, "IOContext_SDL::init(): Couldn't initialize SDL: %s\n", SDL_GetError());
            return false;
        }
    }

    SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);

    SDL_Surface *screen = setVideoMode();
    if(!screen) {
        fprintf(stderr, "IOContext_SDL::init(): setVideoMode failed: %s\n", SDL_GetError());
        SDL_Quit();
        return false;
    }

    if(m_windowTitle.length() > 0)
        SDL_WM_SetCaption(m_windowTitle.c_str(), NULL);
    else
        SDL_WM_SetCaption("Drome Engine", NULL);

    if(m_grabInput) {
        SDL_ShowCursor(SDL_DISABLE);
        SDL_WM_GrabInput(SDL_GRAB_ON);
    }

    fprintf(stderr, "SDL initialized\n");

    m_initialized = true;
    return true;
}
开发者ID:joshb,项目名称:DromeEngine,代码行数:34,代码来源:IOContext_SDL.cpp


示例8: FreenectVideoStream

FreenectDepthStream::FreenectDepthStream(Freenect::FreenectDevice* pDevice) : FreenectVideoStream(pDevice)
{
	video_mode = makeOniVideoMode(ONI_PIXEL_FORMAT_DEPTH_1_MM, 640, 480, 30);
	image_registration_mode = ONI_IMAGE_REGISTRATION_DEPTH_TO_COLOR;
	mirroring = false;
	setVideoMode(video_mode);
}
开发者ID:juanii,项目名称:OpenNI2-FreenectDriver,代码行数:7,代码来源:FreenectDepthStream.cpp


示例9: SDL_QuitSubSystem

//----------------------------------------------------------------------------
void  Video::updateSettings( void)
{
    bool fullscreen = _isFullscreen;
    ConfigS::instance()->getBoolean( "fullscreen", _isFullscreen);

    int width = 0;
    ConfigS::instance()->getInteger( "width", width);
    int height = 0;
    ConfigS::instance()->getInteger( "height", height);
    if( (fullscreen != _isFullscreen) || (width != _width) || (height != _height))
    {
#ifdef DYNAMIC_GL
        SDL_QuitSubSystem( SDL_INIT_VIDEO);
        if( SDL_InitSubSystem( SDL_INIT_VIDEO) < 0 )
        {
            LOG_ERROR << "Update Video: failed # " << SDL_GetError() << endl;
        }
#endif
        setVideoMode();
        reload();
#ifdef DYNAMIC_GL
        grabAndWarpMouse();
#endif
    }

    ConfigS::instance()->getBoolean( "showStarfield", _showStarfield);
    ConfigS::instance()->getBoolean( "showNebulas", _showNebulas);
}
开发者ID:BackupTheBerlios,项目名称:sotu-svn,代码行数:29,代码来源:Video.cpp


示例10: main

int main(int argc, char * argv[])
{
	struct pwcmech * pwcmech;
	pwcmech->dev = ifinit_pwcblock();
	pwcmech->com = ifinit_usbcom();

	ifbind_pwcblock(pwcmech->dev, pwcmech->com);

	//use driver
	usb_init(pwcmech->com);
	if ( usb_open(pwcmech->com) )
	{
		finish(pwcmech);
		return 0;
	}

	//should work seamlessly
	usb_if_claim(pwcmech->com, pwcmech->com->standard_descriptors.highspeed.cameraStream.cameraStreamConf);

	setVideoMode(pwcmech, 9);

	setLeds(pwcmech, 10,5);

	usb_release_interface(pwcmech->com, pwcmech->com->standard_descriptors.highspeed.cameraStream.cameraStreamConf);

	usb_close(pwcmech->com);

	finish(pwcmech);

	return 0;
}
开发者ID:rfajardo,项目名称:devmech,代码行数:31,代码来源:main.c


示例11: setVideoMode

bool Graphics::setFullscreen(const bool fs)
{
    if (mFullscreen == fs)
        return true;

    return setVideoMode(mActualWidth, mActualHeight, mScale, mBpp, fs,
        mHWAccel, mEnableResize, mNoFrame);
}
开发者ID:supermukmin,项目名称:ManaPlus,代码行数:8,代码来源:graphics.cpp


示例12: setVideoMode

bool Graphics::setFullscreen(bool fs)
{
    if (mFullscreen == fs)
        return true;

    return setVideoMode(mScreen->w, mScreen->h,
            mScreen->format->BitsPerPixel, fs, mHWAccel);
}
开发者ID:mekolat,项目名称:elektrogamesvn,代码行数:8,代码来源:graphics.cpp


示例13: Menu

void Menu()
{
	int done = 0;
	int ctrl = 0;

	// Set video mode based on aspect ratio
	if(CONF_GetAspectRatio() == CONF_ASPECT_16_9) isWide = 1;
	setVideoMode();
	drawLogo();

	dListTotal = findPaks();
	dListCurrentPosition = 0;
	if(dListTotal != 1)
	{
		sortList();
		getAllLogs();
		initMenu(1);
		drawMenu();
		pControl = ControlMenu;

		while(!done)
		{
			ctrl = Control();
			switch(ctrl)
			{
				case 1:
				case 2:
					done = 1;
					break;

				case 3:
					drawLogs();
					break;

				case -1:
					drawMenu();
					break;

				case -2:
					// BGM player isn't supported
					break;
			}
		}
		freeAllLogs();
		termMenu();
		if(ctrl == 2)
		{
			if (filelist)
			{
				free(filelist);
				filelist = NULL;
			}
			borExit(0);
		}
	}
	getBasePath(packfile, filelist[dListCurrentPosition+dListScrollPosition].filename, 1);
	free(filelist);
}
开发者ID:DavidKnight247,项目名称:OpenBOR-for-the-GCW0,代码行数:58,代码来源:menu.c


示例14: setVideoMode

void Renderer::init()
{
  if (m_initialized) return;

  // Set Video mode, if requested.
  // Must be done before DirectFBCreate()!
  if (m_videoMode != -1)
  {
    setVideoMode(m_videoMode);
  }

  DFBSurfaceDescription dsc;

  if (DirectFBCreate(&m_dfb) != DFB_OK) {
    fprintf(stderr, "Error in DirectFBCreate!\n"); return;
  }

  if (m_dfb->SetCooperativeLevel(m_dfb, DFSCL_EXCLUSIVE) != DFB_OK) {
    fprintf(stderr, "Error in SetCooperativeLevel!\n"); return;
  }
  
  dsc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_CAPS | DSDESC_PIXELFORMAT);
  dsc.caps  = (DFBSurfaceCapabilities)(DSCAPS_PRIMARY | DSCAPS_DOUBLE);
  dsc.pixelformat = (DFBSurfacePixelFormat)DSPF_ARGB;
  
  if (m_dfb->CreateSurface( m_dfb, &dsc, &m_surface ) != DFB_OK) {
    fprintf(stderr, "Error in CreateSurface!\n"); return;
  }
  
  if (m_surface->GetSize (m_surface, &m_width, &m_height) != DFB_OK) {
    fprintf(stderr, "Error in GetSize!\n"); return;
  }

  m_scale = ((float)m_width) / VIRTUAL_WIDTH;
  m_width = VIRTUAL_WIDTH;
  m_height = VIRTUAL_HEIGHT;
  
  m_curr_buffer = 0;

  color(0,0,0,0xff);
  rect(0,0,m_width, m_height); flip();
  rect(0,0,m_width, m_height); flip();

  if (m_dfb->GetInputDevice (m_dfb, INPUT_DEVICE, &m_input) != DFB_OK) {
    fprintf(stderr, "Error in GetInputDevice!\n"); return;    
  }
  
  if (m_input->CreateEventBuffer (m_input, &m_eventBuffer) != DFB_OK) {
    fprintf(stderr, "Error in CreateEventBuffer!\n"); return;    
  }

  // m_image_loader = new ImageLoader();
  // m_image_loader->start();

  m_exit = false;
  m_initialized = true;
}
开发者ID:aaleswara,项目名称:tanktv,代码行数:57,代码来源:Renderer.cpp


示例15: ExecKernel

static int ExecKernel(void *binary)
{
	entry_t	kernelEntry;
	int	ret;

	bootArgs->kaddr = bootArgs->ksize = 0;

	ret = DecodeKernel(binary, &kernelEntry, (char **)&bootArgs->kaddr, (int *)&bootArgs->ksize);
	if (ret != 0) {
		return ret;
	}

	// Reserve space for boot args
	reserveKernBootStruct();

	// Load boot drivers from the specifed root path.
	if (!gHaveKernelCache) {
		LoadDrivers("/");
	}

	clearActivityIndicator();

	if (gErrors) {
		printf("Errors encountered while starting up the computer.\n");
		printf("Pausing %d seconds...\n", kBootErrorTimeout);
		sleep(kBootErrorTimeout);
	}

	setupFakeEfi();

	verbose("Starting Darwin %s\n",( archCpuType == CPU_TYPE_I386 ) ? "x86" : "x86_64");

	bool dummyVal;
	if (getBoolForKey(kWaitForKeypressKey, &dummyVal, &bootInfo->bootConfig) && dummyVal) {
		printf("Press any key to continue...");
		getc();
	}

	// If we were in text mode, switch to graphics mode.
	// This will draw the boot graphics unless we are in
	// verbose mode.
	if (gVerboseMode) {
		setVideoMode(GRAPHICS_MODE, 1);
	} else {
		drawBootGraphics();
	}

	finalizeBootStruct();

	// Jump to kernel's entry point. There's no going back now.
	startprog(kernelEntry, bootArgs);

	// Not reached
	return 0;
}
开发者ID:AlexSeverinov,项目名称:Chameleon,代码行数:55,代码来源:boot.c


示例16: SDL_WM_ToggleFullScreen

bool Graphics::setFullscreen(bool fs)
{
    if (mFullscreen == fs)
        return true;

#ifdef X11
    logger->log("Switching to %s mode", fs ? "fullscreen" : "windowed");
    return SDL_WM_ToggleFullScreen(mTarget);
#else
    return setVideoMode(mWidth, mHeight, mBpp, fs, mHWAccel);
#endif
}
开发者ID:Aethyra,项目名称:Client,代码行数:12,代码来源:graphics.cpp


示例17: setVideoMode

bool Graphics::resizeVideoMode(int w, int h)
{
    bool success = setVideoMode(w, h, mBpp, mFullscreen, mHWAccel);

    if (success)
    {
        gcn::Graphics::popClipArea();
        _beginDraw();
    }

    return success;
}
开发者ID:Aethyra,项目名称:Client,代码行数:12,代码来源:graphics.cpp


示例18: setVideoMode

void
IOContext_SDL::setFullScreen(bool value)
{
    m_fullscreen = value;

    if(m_initialized) {
        SDL_Surface *screen = setVideoMode();
        if(!screen) {
            fprintf(stderr, "IOContext_SDL::setWindowDimensions(): setVideoMode failed: %s\n", SDL_GetError());
            SDL_Quit();
        }
    }
}
开发者ID:joshb,项目名称:DromeEngine,代码行数:13,代码来源:IOContext_SDL.cpp


示例19: showBootLogo

void showBootLogo()
{
	uint8_t *bootImageData = NULL;
	uint8_t *appleBootLogo = (uint8_t *) decodeRLE(appleLogoRLE, 686, 16384); 

	setVideoMode(GRAPHICS_MODE);
	// Fill the background to 75% grey (same as BootX). 
	drawColorRectangle(0, 0, VIDEO(width), VIDEO(height), 0x01);

	convertImage(APPLE_LOGO_WIDTH, APPLE_LOGO_HEIGHT, appleBootLogo, &bootImageData);

	drawDataRectangle(APPLE_LOGO_X, APPLE_LOGO_Y, APPLE_LOGO_WIDTH, APPLE_LOGO_HEIGHT, bootImageData);

	free(bootImageData);
	free(appleBootLogo); 
}
开发者ID:Dawn13,项目名称:RevoBoot,代码行数:16,代码来源:bootlogo.c


示例20: switch

bool ProtoConnection::parseReply(const proto::HyperionReply &reply)
{
	bool success = false;
	
	switch (reply.type())
	{
		case proto::HyperionReply::REPLY:
		{
			if (!_skipReply)
			{
				if (!reply.success())
				{
					if (reply.has_error())
					{
						throw std::runtime_error("PROTOCONNECTION ERROR: " + reply.error());
					}
					else
					{
						throw std::runtime_error("PROTOCONNECTION ERROR: No error info");
					}
				}
				else
				{
					success = true;
				}
			}
			break;
		}
		case proto::HyperionReply::GRABBING:
		{
			int grabbing = reply.has_grabbing() ? reply.grabbing() : 7;
			GrabbingMode gMode = (GrabbingMode)grabbing;
			emit setGrabbingMode(gMode);
			break;
		}
		case proto::HyperionReply::VIDEO:
		{
			int video = reply.has_video() ? reply.video() : 0;
			VideoMode vMode = (VideoMode)video;
			emit setVideoMode(vMode);
			break;
		}
	}
	
	return success;
}
开发者ID:XfableX,项目名称:hyperion.ng,代码行数:46,代码来源:ProtoConnection.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setView函数代码示例发布时间:2022-05-30
下一篇:
C++ setVersion函数代码示例发布时间: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