/usr/lib/Wt/examples/webgl/PaintWidget.h is in witty-examples 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | /*
* Copyright (C) 2010 Emweb bvba, Heverlee, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef PAINTWIDGET_H_
#define PAINTWIDGET_H_
#include <Wt/WGLWidget>
// You must inherit Wt::WGLWidget to draw a 3D scene
class PaintWidget: public Wt::WGLWidget
{
public:
PaintWidget(Wt::WContainerWidget *root, const bool & useBinaryBuffers);
// Specialization of WGLWidgeT::intializeGL()
void initializeGL();
// Specialization of WGLWidgeT::paintGL()
void paintGL();
// Specialization of WGLWidgeT::resizeGL()
void resizeGL(int width, int height);
// Sets the shader source. Must be set before the widget is first rendered.
void setShaders(const std::string &vertexShader,
const std::string &fragmentShader);
private:
// The shaders, in plain text format
std::string vertexShader_;
std::string fragmentShader_;
// Program and related variables
Program shaderProgram_;
AttribLocation vertexPositionAttribute_;
AttribLocation vertexNormalAttribute_;
UniformLocation pMatrixUniform_;
UniformLocation cMatrixUniform_;
UniformLocation mvMatrixUniform_;
UniformLocation nMatrixUniform_;
// A client-side JavaScript matrix variable
JavaScriptMatrix4x4 jsMatrix_;
// The so-called VBOs, Vertex Buffer Objects
// This one contains both vertex (xyz) and normal (xyz) data
Buffer objBuffer_;
bool useBinaryBuffers_;
};
#endif
|