本文整理汇总了C++中GLWindow::setWindowLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ GLWindow::setWindowLocation方法的具体用法?C++ GLWindow::setWindowLocation怎么用?C++ GLWindow::setWindowLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLWindow
的用法示例。
在下文中一共展示了GLWindow::setWindowLocation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
try
{
char* testname_args1[] = {"program.exe","antialias_amount=8 width=1280 height=720 window_name", " =multisampled is_antialiased=true"};
char* testname_args2[] = {"program.exe","width=1280 height=720", ""};
GLWindow glWindow = GLWindow(GLWindow::Settings(3, testname_args1));
GLWindow glWindow2 = GLWindow(GLWindow::Settings(3, testname_args2));
PCInputBinding b;
PCInputBinding b2;
b2.bindButtonDown('a', print);
b.bindButtonDown('a', playBeep);
b.bindButtonDown(PCInputBinding::MOUSE_BUTTON_4, button4);
b.bindButtonDown(PCInputBinding::MOUSE_BUTTON_5, button5);
std::function< void () > quit = std::bind(&GLWindow::close, &glWindow);
b.bindWindowClose( quit);
b.bindButtonDown(PCInputBinding::ESCAPE, quit);
//b.bindPowerStatusChange(powerTest);
b2.bindPowerStatusChange(powerTest);
quit = std::bind(&GLWindow::close, &glWindow2);
b2.bindButtonDown(PCInputBinding::ESCAPE, quit);
glWindow.use_binding(b);
glWindow2.use_binding(b2);
glWindow.bindContext();
glClearColor(1.0,0.0,0.0,1.0);
float dt=0.0;
bool once =false;
glWindow2.setTitle("Non-multisampled window test");
glWindow.setWindowLocation(100,100);
glWindow2.setWindowLocation(128,128);
while(glWindow.isValid() || glWindow2.isValid() )
{
dt += .001;
// std::cout<<dt<<std::endl;
std::stringstream sstr;
sstr<<"NON-MULTISAMPLED TEST:: BKGR COLOR INTERPOLATOR IS "<<(fabs(sin(dt)))<<std::endl;
std::string abc = sstr.str();
if(glWindow.bindContext()){
// glEnable(GL_MULTISAMPLE_ARB);
//the fact that we dont need the call to clear color here shows how the gl state is maintained separately between different rendering contexts
//glClearColor(1.0,0.0,0.0,1.0);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
//glClearColor(1.0,0.0,0.0,1.0);
//glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glVertex3f(-1.0,1.0,0.0);
glColor3f(0.0,1.0,0.0);
glVertex3f(-1.0,-1.0,0.0);
glColor3f(0.0,0.0,1.0);
glVertex3f(1.0,-1.0,0.0);
glEnd();
glWindow.update();
glWindow.flush();
}
if(glWindow2.bindContext()){
glWindow2.setTitle(abc.c_str());
glClearColor(fabs(sin(dt)),1.0,0.0,1.0);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
//glClearColor(1.0,0.0,0.0,1.0);
//glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glVertex3f(-1.0,1.0,0.0);
//.........这里部分代码省略.........