当前位置: 首页>>代码示例>>C++>>正文


C++ setWindow函数代码示例

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


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

示例1: draw

void draw() {
	glClear(GL_COLOR_BUFFER_BIT);
	static bool zoomIn;
	static float left, right, bottom, top;
	// Initialize static variables
	if (left == 0) {
		left = SCREEN_MAX_LEFT, right = SCREEN_MAX_RIGHT, bottom = SCREEN_MAX_BOTTOM, top = SCREEN_MAX_TOP;
		zoomIn = true;
	}

	// Should you zoom in further?
	if (zoomIn && left <= -MIN_HEX_SIZE) {
		setWindow(left, right, bottom, top);
		left += ZOOM_FACTOR;
		right -= ZOOM_FACTOR;
		bottom += ZOOM_FACTOR;
		top -= ZOOM_FACTOR;
		glutPostRedisplay();
	} else if (zoomIn) { // Maximum zoom, start zooming out
		zoomIn = false;
	// Should you zoom out further?
	} else if (!zoomIn && left > SCREEN_MAX_LEFT) {
		setWindow(left, right, bottom, top);
		left -= ZOOM_FACTOR;
		right += ZOOM_FACTOR;
		bottom -= ZOOM_FACTOR;
		top += ZOOM_FACTOR;
		glutPostRedisplay();
	} else if (!zoomIn) { // Minimum zoom, start zooming in
		zoomIn = true;
	}
}
开发者ID:coweatyou,项目名称:school,代码行数:32,代码来源:hexanim.cpp

示例2: change_current_window

inline void change_current_window(LPARAM lParam)
{
	std::list<HWND> l_hwnd;
	EnumDesktopWindows(NULL, EnumWindowsProc, (LPARAM)&l_hwnd);

	int wheelData = (int)(((PMSLLHOOKSTRUCT)lParam)->mouseData) >> 16;

	HWND previous = NULL;
	HWND currentHwnd = GetForegroundWindow();

	if( wheelData < 0 )
	{
		std::list<HWND>::iterator it = l_hwnd.begin();
		it++;
		
		SetWindowPos( currentHwnd, HWND_BOTTOM, 0,0,0,0, SWP_NOSIZE | SWP_NOMOVE );
		
		setWindow( *it );
	}
	else
	{
		for( std::list<HWND>::iterator it = l_hwnd.begin(); it != l_hwnd.end(); it++ )
		{
			previous = (*it);
		}
		setWindow( previous );
	}
}
开发者ID:chhavi1996,项目名称:guipro,代码行数:28,代码来源:mouse.cpp

示例3: throw

    /**
     * This just creates a default window.
     */
    Window::Window(int existingWindowId) throw (WindowException) : 
      AddonCallback("Window"), window(NULL), iWindowId(-1),
      iOldWindowId(0), iCurrentControlId(3000), bModal(false), m_actionEvent(true),
      canPulse(false), existingWindow(true), destroyAfterDeInit(false)
    {
      TRACE;
      CSingleLock lock(g_graphicsContext);

      if (existingWindowId == -1)
      {
        // in this case just do the other constructor.
        canPulse = true;
        existingWindow = false;

        setWindow(new Interceptor<CGUIWindow>("CGUIWindow",this,getNextAvailalbeWindowId()));
      }
      else
      {
        // user specified window id, use this one if it exists
        // It is not possible to capture key presses or button presses
        CGUIWindow* pWindow = g_windowManager.GetWindow(existingWindowId);
        if (!pWindow)
          throw WindowException("Window id does not exist");

        setWindow(new ProxyExistingWindowInterceptor(pWindow));
      }
    }
开发者ID:A600,项目名称:xbmc,代码行数:30,代码来源:Window.cpp

示例4: Display

void Display()
{
	glClear(GL_COLOR_BUFFER_BIT);
	double l = (pos.x-(_screenw/2)/scale);
	double r = (pos.x+(_screenw/2)/scale);
	double b = (pos.y-(_screenh/2)/scale);
	double t = (pos.y+(_screenh/2)/scale);
	setWindow(l,r,b,t);
	
	world->drawBodies();
	double BP = world->GetProfile("bp");
	double NP = world->GetProfile("np");
	double SLV = world->GetProfile("slv");
	double MV = world->GetProfile("mv");
	glColor3f(1,1,1);
	outputNum(fps, 10, _screenh-20, true);
	outputString("bp:", 10, _screenh-40, true);
	outputNum(((int)(BP*1000000000))/1000000.0, 50, _screenh-40, true);
	outputString("np:", 10, _screenh-60, true);
	outputNum(((int)(NP*1000000000))/1000000.0, 50, _screenh-60, true);
	outputString("slv:", 10, _screenh-80, true);
	outputNum(((int)(SLV*1000000000))/1000000.0, 50, _screenh-80, true);
	outputString("mv:", 10, _screenh-100, true);
	outputNum(((int)(MV*1000000000))/1000000.0, 50, _screenh-100, true);
	outputString("best:", 10, _screenh-120, true);
	outputNum(world->best(), 100, _screenh-120, true);
	
	glFlush();
	glutSwapBuffers();
	glutPostRedisplay();
}
开发者ID:EthanRutherford,项目名称:geneticcars,代码行数:31,代码来源:main.cpp

示例5: ASSERT

void JSDOMWindowShell::setWindow(RefPtr<DOMWindow>&& domWindow)
{
    // Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
    // so we'd better never try to.
    ASSERT(!window() || domWindow.get() != &window()->wrapped());
    // Explicitly protect the global object's prototype so it isn't collected
    // when we allocate the global object. (Once the global object is fully
    // constructed, it can mark its own prototype.)
    
    VM& vm = JSDOMWindow::commonVM();
    Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(vm, 0, jsNull());
    Strong<JSDOMWindowPrototype> prototype(vm, JSDOMWindowPrototype::create(vm, 0, prototypeStructure));

    Structure* structure = JSDOMWindow::createStructure(vm, 0, prototype.get());
    JSDOMWindow* jsDOMWindow = JSDOMWindow::create(vm, structure, *domWindow, this);
    prototype->structure()->setGlobalObject(vm, jsDOMWindow);

    Structure* windowPropertiesStructure = JSDOMWindowProperties::createStructure(vm, jsDOMWindow, JSEventTarget::prototype(vm, jsDOMWindow));
    JSDOMWindowProperties* windowProperties = JSDOMWindowProperties::create(windowPropertiesStructure, *jsDOMWindow);

    prototype->structure()->setPrototypeWithoutTransition(vm, windowProperties);
    setWindow(vm, jsDOMWindow);
    ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
    ASSERT(prototype->globalObject() == jsDOMWindow);
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:25,代码来源:JSDOMWindowShell.cpp

示例6: myReshape

extern void myReshape(int width, int height) {
    glClearColor(0.0, 0.0, 0.0, 0.0);
    setWindow(-10.0f,-10.0f,20.0f*width/height,20);
    GLPoint xy = calViewportXYWantScreenCentre(0,0,1*width/height,1,width,height,width,height);
    glViewport(0, 0, width, height);

};
开发者ID:jypeitao,项目名称:opengl_learn,代码行数:7,代码来源:drawOrthoCircle.c

示例7: QLineEdit

AddressWidget::AddressWidget(Window *window, QWidget *parent) : QLineEdit(parent),
	m_window(NULL),
	m_completer(new QCompleter(AddressCompletionModel::getInstance(), this)),
	m_bookmarkLabel(NULL),
	m_feedsLabel(NULL),
	m_loadPluginsLabel(NULL),
	m_urlIconLabel(NULL),
	m_simpleMode(false)
{
	m_completer->setCaseSensitivity(Qt::CaseInsensitive);
	m_completer->setCompletionMode(QCompleter::InlineCompletion);
	m_completer->setCompletionRole(Qt::DisplayRole);
	m_completer->setFilterMode(Qt::MatchStartsWith);

	setWindow(window);
	setCompleter(m_completer);
	setMinimumWidth(100);

	ToolBarWidget *toolBar = qobject_cast<ToolBarWidget*>(parent);

	if (toolBar)
	{
		optionChanged(QLatin1String("AddressField/ShowBookmarkIcon"), SettingsManager::getValue(QLatin1String("AddressField/ShowBookmarkIcon")));
		optionChanged(QLatin1String("AddressField/ShowUrlIcon"), SettingsManager::getValue(QLatin1String("AddressField/ShowUrlIcon")));
		setPlaceholderText(tr("Enter address or search…"));
		setMouseTracking(true);

		connect(SettingsManager::getInstance(), SIGNAL(valueChanged(QString,QVariant)), this, SLOT(optionChanged(QString,QVariant)));
		connect(toolBar, SIGNAL(windowChanged(Window*)), this, SLOT(setWindow(Window*)));
	}
	else
	{
开发者ID:neonKow,项目名称:otter-browser,代码行数:32,代码来源:AddressWidget.cpp

示例8: Base

JSDOMWindowShell::JSDOMWindowShell(PassRefPtr<DOMWindow> window, DOMWrapperWorld* world)
    : Base(*world->globalData(), JSDOMWindowShell::createStructure(*world->globalData(), jsNull()))
    , m_world(world)
{
    ASSERT(inherits(&s_info));
    setWindow(window);
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:7,代码来源:JSDOMWindowShell.cpp

示例9: main

int main() {
	auto window = sf::RenderWindow(sf::VideoMode(800,600), "Mouse Cursor Input Test");
	//event manager requires a target window to operate correctly
	auto eventManager = EventManager::getInstance();

	//we set the target window to our render window
	eventManager->setWindow(&window);

	auto eventSystem = std::shared_ptr<EventSystem> (new EventSystem());
	eventSystem->registerClosed_Callback([&] (int ID, int eventIndex) {
		window.close();
		return 0;
	});

	//populate the system manager
	auto systemManager = SystemManager::getInstance();
	systemManager->addSystem(std::shared_ptr<systemType> (new SpriteSystem(window)));
	systemManager->addSystem(std::shared_ptr<systemType> (new InputSystem()));
	systemManager->addSystem(std::shared_ptr<systemType> (std::static_pointer_cast<systemType> (eventSystem)));

	//populate our entity manager
	auto entityManager = EntityManager::getInstance();
	entityManager->addEntity(createCursorEntity("MouseCursor"));

	while(window.isOpen()) {
		window.clear();
		eventManager->pollEvents();
		systemManager->processSystemList();
		window.display();
	}
	return 0;
}
开发者ID:benzap,项目名称:armyengine,代码行数:32,代码来源:Test_InputSystem.cpp

示例10: onWindowReshape

void onWindowReshape(int x, int y)
{
    windowWidth = x;
	windowHeight = y;
	setWindow();
	setViewport(0, windowWidth, 0, windowHeight);
}
开发者ID:lahagemann,项目名称:digdug,代码行数:7,代码来源:main.cpp

示例11: mainInit

void mainInit()
{
    glClearColor(1.0,1.0,1.0,0.0);
	glColor3f(0.0f,0.0f,0.0f);
	setWindow();
	setViewport(0, windowWidth, 0, windowHeight);

	// habilita o z-buffer
	glEnable(GL_DEPTH_TEST);
    initTexture("Models\\Sea.bmp\0", &texture, &type);

    // inicializa todos os modelos 3D que serão multiplicados
    diglettModel = (GLMmodel*)malloc(sizeof(GLMmodel));
    scytherModel = (GLMmodel*)malloc(sizeof(GLMmodel));
    sharpedoModel = (GLMmodel*)malloc(sizeof(GLMmodel));
    snorlaxModel = (GLMmodel*)malloc(sizeof(GLMmodel));
    cube = (GLMmodel*)malloc(sizeof(GLMmodel));
    cube_hole = (GLMmodel*)malloc(sizeof(GLMmodel));
    cube_crack = (GLMmodel*)malloc(sizeof(GLMmodel));

    load_new_model("Models/Diglett.obj", &diglettModel);
    load_new_model("Models/Scyther.obj", &scytherModel);
    load_new_model("Models/Sharpedo.obj", &sharpedoModel);
    load_new_model("Models/Snorlax.obj", &snorlaxModel);
    load_new_model("Models/cube.obj", &cube);
    load_new_model("Models/cube_hole.obj", &cube_hole);
    load_new_model("Models/cube_crack.obj", &cube_crack);
}
开发者ID:lahagemann,项目名称:digdug,代码行数:28,代码来源:main.cpp

示例12: setWindow

Level::Level() {
	setWindow();
	setRenderer();
	setRunning();
	initObjects();
	setObjects();
}
开发者ID:muhdmirzamz,项目名称:Creque,代码行数:7,代码来源:Level.cpp

示例13: ASSERT

void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
{
    // Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
    // so we'd better never try to.
    ASSERT(!window() || domWindow.get() != &window()->impl());
    // Explicitly protect the global object's prototype so it isn't collected
    // when we allocate the global object. (Once the global object is fully
    // constructed, it can mark its own prototype.)

    //VMOLAB
    //printf("JSDOMWindowShell::setWindow Called\n");
    
    VM& vm = JSDOMWindow::commonVM();
    Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(vm, 0, jsNull());
    Strong<JSDOMWindowPrototype> prototype(vm, JSDOMWindowPrototype::create(vm, 0, prototypeStructure));

    Structure* structure = JSDOMWindow::createStructure(vm, 0, prototype.get());
    JSDOMWindow* jsDOMWindow = JSDOMWindow::create(vm, structure, domWindow, this);
    prototype->structure()->setGlobalObject(vm, jsDOMWindow);
    setWindow(vm, jsDOMWindow);
    ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
    ASSERT(prototype->globalObject() == jsDOMWindow);
#if ENABLE(VMOLAB)
    vm.setInParallelParseLoad(true);
#endif
}
开发者ID:highweb-project,项目名称:highweb-parallelwebkit,代码行数:26,代码来源:JSDOMWindowShell.cpp

示例14: setWindow

IntroScene::IntroScene() {
	setWindow();
	setRenderer();
	setRunning();
	initObjects();
	setObjects();
}
开发者ID:muhdmirzamz,项目名称:Creque,代码行数:7,代码来源:IntroScene.cpp

示例15: switch

LRESULT AppImplMswScreenSaver::eventHandler( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
{
	switch( message ) {
		case WM_TIMER:
			setWindow( mWindows.front()->getWindow() );
			mApp->privateUpdate__();
			for( auto winIt = mWindows.begin(); winIt != mWindows.end(); ++winIt ) {
				(*winIt)->draw();
			}
			return 0;
		break;
		case WM_DESTROY:
			for( auto winIt = mWindows.begin(); winIt != mWindows.end(); ++winIt )
				(*winIt)->getWindow()->emitClose();
			mApp->emitCleanup();
/*			mApp->getRenderer()->kill();
			::KillTimer( mWnd, TIMER_ID );
			::ReleaseDC( mWnd, mDC );*/
			return 0;
		break;
		case WM_MOUSEMOVE:
		case WM_KEYDOWN:
		case WM_ACTIVATE:
		case WM_ACTIVATEAPP:
		case WM_NCACTIVATE:
			if( mDebugMode ) // in debug mode we capture these events so that they don't close the screensaver
				return 0;
			else
				return ::DefScreenSaverProc( hWnd, message, wParam, lParam );
		break;
		default:
			return ::DefScreenSaverProc( hWnd, message, wParam, lParam );
	}
}
开发者ID:Ahbee,项目名称:Cinder,代码行数:34,代码来源:AppImplMswScreenSaver.cpp


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