int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    PaintWidget window;
    window.show();
    return app.exec();
}
示例#2
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    PaintWidget w;
    w.show();

    return a.exec();
}
示例#3
0
文件: webgl.C 项目: 913862627/wt
WebGLDemo::WebGLDemo(const WEnvironment& env)
  : WApplication(env)
{
  setTitle("WebGL Demo");

  root()->addWidget(new WText("This is a preliminary WebGL demo. It will "
    "become more spectacular in time. This technology preview has only "
    "been tested on Chrome Canary builds. No 3D because I did "
    "not yet invest in 3D projection matrices."));
  root()->addWidget(new WBreak());

  PaintWidget *gl = new PaintWidget(root());
  gl->resize(640, 640);
}
示例#4
0
文件: teapot.C 项目: 913862627/wt
void WebGLDemo::updateShaders()
{
  // check if binary buffers are enabled
  // i.e. if your application url is "webgl" on localhost:8080, use this to enable binary buffers:
  // localhost:8080/webgl?binaryBuffers
  // query given URL arguments...
  Http::ParameterValues pv = wApp->environment().getParameterValues("binaryBuffers");
  bool useBinaryBuffers = false;
  if (!pv.empty())
  {
      useBinaryBuffers = true;
  }

  delete paintWidget_;
  paintWidget_ = new PaintWidget(glContainer_, useBinaryBuffers);
  paintWidget_->resize(500, 500);
  paintWidget_->setShaders(vertexShaderText_->text().toUTF8(),
    fragmentShaderText_->text().toUTF8());
  paintWidget_->setAlternativeContent(new WImage("nowebgl.png"));
}