本文整理汇总了C++中setWindow函数的典型用法代码示例。如果您正苦于以下问题:C++ setWindow函数的具体用法?C++ setWindow怎么用?C++ setWindow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setWindow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Polygon_paint
void Polygon_paint (Polygon me, Graphics g, Graphics_Colour colour, double xmin, double xmax, double ymin, double ymax) {
Graphics_setInner (g);
setWindow (me, g, xmin, xmax, ymin, ymax);
Graphics_setColour (g, colour);
Graphics_fillArea (g, my numberOfPoints, & my x [1], & my y [1]);
Graphics_unsetInner (g);
}
开发者ID:psibre,项目名称:praat,代码行数:7,代码来源:Polygon.cpp
示例17: kernel
void kernel() {
struct BootData* bd = (struct BootData*)0x1000;
unsigned* hdrs = bd->headers;
unsigned* mmap = bd->mmap;
unsigned i;
setWindow(2, 22, 0, 45); // kernel on left hand side
cls();
printf("Protected kernel has booted!\n");
printf("Headers:\n");
for (i=0; i<hdrs[0]; i++) {
printf(" header[%d]: [%x-%x], entry %x\n",
i, hdrs[3*i+1], hdrs[3*i+2], hdrs[3*i+3]);
}
printf("Memory map:\n");
for (i=0; i<mmap[0]; i++) {
printf(" mmap[%d]: [%x-%x]\n",
i, mmap[2*i+1], mmap[2*i+2]);
}
printf("Strings:\n");
printf(" cmdline: %s [%x]\n", bd->cmdline, bd->cmdline);
printf(" imgline: %s [%x]\n", bd->imgline, bd->imgline);
printf("user code is at 0x%x\n", hdrs[9]);
initContext(&user, hdrs[9], 0);
printf("user is at %x\n", (unsigned)(&user));
switchToUser(&user);
printf("This message shouldn't appear!\n");
}
开发者ID:josue804,项目名称:baremetal-exercises,代码行数:31,代码来源:kernel.c
示例18: setWindow
void TFT_ILI9325::fill(int x, int y, int w, int h, uint16_t color) {
uint32_t i, size;
uint8_t *blk;
// alloc memory
blk = new uint8_t[TFT_BLK_SIZE + 1];
size = (LCD_WIDTH * LCD_HEIGHT) * 2;
// fill color
blk[0] = SSP_START | SSP_WR | SSP_DATA;
for (i = 0; i < TFT_BLK_SIZE && i < size; i += 2) {
blk[i + 1] = color >> 8;
blk[i + 2] = color & 0xFF;
}
CThread::suspendAll();
// write to tft-lcd
setWindow(x, y, w, h);
wr_cmd(0x22);
do {
spi.readwrite(blk, NULL, TFT_BLK_SIZE + 1);
size -= TFT_BLK_SIZE;
} while (size > 0);
CThread::resumeAll();
delete blk;
}
开发者ID:brucetsao,项目名称:nano1768,代码行数:29,代码来源:tft_ili9325.cpp
示例19: myReshape
extern void myReshape(int width, int height) {
glClearColor(0.0, 0.0, 0.0, 0.0);
setWindow(-4,-4,8*width/height,8);
GLPoint xy = calViewportXYWantScreenCentre(-4,-4,8*width/height,8,width,height,width,height);
glViewport(xy.x, xy.y, width, height);
};
开发者ID:jypeitao,项目名称:opengl_learn,代码行数:7,代码来源:drawCircle.c
示例20: setZRange
void CloudAtlasControlWindow::initWindow(osgWidget::WindowManager* wm, TemperatureProbeLayer* tLayer, WindowThemeSettings wts)
{
setZRange(1.0f);
_obWM = wm;
getBackground()->setColor(osgWidget::Color(0, 0, 0, 0));
getBackground()->setEventMask(osgWidget::EVENT_NONE);
_wts = wts;
osgWidget::Table* centerTable = new osgWidget::Table("CenterTable", 2, 1);
centerTable->getBackground()->setColor(osgWidget::Color(0, 0, 0, 0));
_centerWidget = new CenterWidget("CloudAtlasCenterWidget", _windowWidth);
float centerHeight = _centerWidget->buildCenterWidget(tLayer);
osgWidget::point_type cw = wts._left;
osgWidget::point_type ch = wts._bottom;
osgWidget::point_type w = _windowWidth - cw - wts._right;
osgWidget::point_type h = centerHeight + wts._topTitleHeight;
osgWidget::Window::EmbeddedWindow* centerEW = new osgWidget::Window::EmbeddedWindow("CenterTableEmbedded", _windowWidth, h);
centerEW->setCanFill(true);
centerEW->setLayer(osgWidget::Widget::LAYER_MIDDLE);
centerEW->setEventMask(osgWidget::EVENT_ALL);
centerEW->setColor(1, 1, 1, 1);
centerEW->setImage(wts._bgImage, true);
addWidget(centerEW, 1, 1);
osgWidget::Window::EmbeddedWindow* centerWidget = _centerWidget->embed("CenterEmbeddedWindow");
centerWidget->setEventMask(osgWidget::EVENT_ALL);
centerWidget->setColor(0, 0, 0, 0);
centerTable->addWidget(centerWidget, 0, 0);
_topTitleWidget = new VirtualDataSceneWidget::TopTitleWidget("TopTitle", _windowWidth, wts._topTitleHeight, wts._topTitleImage, wts._topCloseButtonImage);
osgWidget::Window::EmbeddedWindow* topBorderWidget = _topTitleWidget->embed("TopTitleEmbedded");
topBorderWidget->setColor(0, 0, 0, 0);
topBorderWidget->setEventMask(osgWidget::EVENT_ALL);
centerTable->addWidget(topBorderWidget, 1, 0);
centerTable->resize(_windowWidth, h);
setWindow(centerTable);
//init left bottom right border and corner
addWidget(new osgWidget::Frame::Corner(osgWidget::Frame::CORNER_LOWER_LEFT, cw, ch), 0, 0);
addWidget(new osgWidget::Frame::Border(osgWidget::Frame::BORDER_BOTTOM, w, ch), 0, 1);
addWidget(new osgWidget::Frame::Corner(osgWidget::Frame::CORNER_LOWER_RIGHT, cw, ch), 0, 2);
addWidget(new osgWidget::Frame::Border(osgWidget::Frame::BORDER_LEFT, cw, h), 1, 0);
addWidget(new osgWidget::Frame::Border(osgWidget::Frame::BORDER_RIGHT, cw, wts._right), 1, 2);
addWidget(new osgWidget::Frame::Corner(osgWidget::Frame::CORNER_UPPER_LEFT, cw, wts._top), 2, 0);
addWidget(new osgWidget::Frame::Border(osgWidget::Frame::BORDER_TOP, w, wts._top), 2, 1);
addWidget(new osgWidget::Frame::Corner(osgWidget::Frame::CORNER_UPPER_RIGHT, cw, wts._top), 2, 2);
getCorner(CORNER_UPPER_LEFT)->setImage(wts._leftTopImage, true);
getBorder(BORDER_TOP)->setImage(wts._topImage, true);
getCorner(CORNER_UPPER_RIGHT)->setImage(wts._rightTopImage, true);
getBorder(BORDER_LEFT)->setImage(wts._leftImage, true);
getBorder(BORDER_RIGHT)->setImage(wts._rightImage, true);
getCorner(CORNER_LOWER_LEFT)->setImage(wts._leftBottomImage, true);
getBorder(BORDER_BOTTOM)->setImage(wts._bottomImage, true);
getCorner(CORNER_LOWER_RIGHT)->setImage(wts._rightBottomImage, true);
_topTitleWidget->setCloseButtonClickCallback(&CloudAtlasControlWindow::closeButtonClicked, this);
_topTitleWidget->setDragCallback(&CloudAtlasControlWindow::dragEventCallback, this);
osgWidget::point_type allHeight = h + ch + wts._top;
resize(_windowWidth, allHeight);
}
开发者ID:FreeDegree,项目名称:Zhang,代码行数:59,代码来源:CloudAtlasControlWindow.cpp
注:本文中的setWindow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论