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

    PaintWidget w;
    w.show();

    return a.exec();
}
Ejemplo n.º 3
0
Archivo: webgl.C Proyecto: 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);
}
Ejemplo n.º 4
0
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"));
}