diff options
Diffstat (limited to 'examples/quick/scenegraph/graph')
-rw-r--r-- | examples/quick/scenegraph/graph/noisynode.cpp | 3 | ||||
-rw-r--r-- | examples/quick/scenegraph/graph/shaders/line.fsh | 2 | ||||
-rw-r--r-- | examples/quick/scenegraph/graph/shaders/noisy.fsh | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/examples/quick/scenegraph/graph/noisynode.cpp b/examples/quick/scenegraph/graph/noisynode.cpp index 762a47ec1f..6e79bb247f 100644 --- a/examples/quick/scenegraph/graph/noisynode.cpp +++ b/examples/quick/scenegraph/graph/noisynode.cpp @@ -50,6 +50,7 @@ #include "noisynode.h" +#include <QtCore/QRandomGenerator> #include <QtQuick/QSGSimpleMaterialShader> #include <QtQuick/QSGTexture> #include <QtQuick/QQuickWindow> @@ -113,7 +114,7 @@ NoisyNode::NoisyNode(QQuickWindow *window) QImage image(NOISE_SIZE, NOISE_SIZE, QImage::Format_RGB32); uint *data = (uint *) image.bits(); for (int i=0; i<NOISE_SIZE * NOISE_SIZE; ++i) { - uint g = rand() & 0xff; + uint g = QRandomGenerator::global()->bounded(0xff); data[i] = 0xff000000 | (g << 16) | (g << 8) | g; } diff --git a/examples/quick/scenegraph/graph/shaders/line.fsh b/examples/quick/scenegraph/graph/shaders/line.fsh index 378cc1084f..77e05a2d15 100644 --- a/examples/quick/scenegraph/graph/shaders/line.fsh +++ b/examples/quick/scenegraph/graph/shaders/line.fsh @@ -54,7 +54,7 @@ uniform lowp float spread; varying lowp float vT; -#define PI 3.14159265359 +#define PI 3.14159265358979323846 void main(void) { diff --git a/examples/quick/scenegraph/graph/shaders/noisy.fsh b/examples/quick/scenegraph/graph/shaders/noisy.fsh index 2796f24bd8..14ea675360 100644 --- a/examples/quick/scenegraph/graph/shaders/noisy.fsh +++ b/examples/quick/scenegraph/graph/shaders/noisy.fsh @@ -55,7 +55,7 @@ uniform lowp vec4 color; varying highp vec2 vTexCoord; varying lowp vec2 vShadeCoord; -#define PI 3.14159265359 +#define PI 3.14159265358979323846 void main() { |