diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-24 11:26:22 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-24 11:48:46 +0200 |
commit | 1a9759855639b9e2b3cdc0687d3381dcbf6c9815 (patch) | |
tree | b2da51f6eddddb83c2d97cdcfac24d38d2e67a4e /examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc | |
parent | 8217ec1b888f3ff93f004801b018c5f85362c484 (diff) | |
parent | e1fc2793aef53b84a3f1e19b6d6bdf1141340074 (diff) |
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into wip/v4
Conflicts:
src/imports/qtquick2/plugins.qmltypes
src/qml/debugger/qv8debugservice.cpp
src/qml/qml/qml.pri
src/qml/qml/qqmlcompiler.cpp
src/qml/qml/qqmlcomponent.cpp
src/qml/qml/qqmlcontext.cpp
src/qml/qml/qqmldata_p.h
src/qml/qml/qqmlengine_p.h
src/qml/qml/qqmljavascriptexpression.cpp
src/qml/qml/qqmlxmlhttprequest.cpp
src/qml/qml/v4/qv4bindings.cpp
src/qml/qml/v4/qv4irbuilder.cpp
src/qml/qml/v4/qv4jsonobject_p.h
src/qml/qml/v8/qqmlbuiltinfunctions.cpp
src/qml/qml/v8/qv8bindings.cpp
src/qml/qml/v8/qv8contextwrapper.cpp
src/qml/qml/v8/qv8listwrapper.cpp
src/qml/qml/v8/qv8qobjectwrapper.cpp
src/qml/qml/v8/qv8qobjectwrapper_p.h
src/qml/qml/v8/qv8sequencewrapper_p_p.h
src/qml/qml/v8/qv8typewrapper.cpp
src/qml/qml/v8/qv8valuetypewrapper.cpp
src/qml/types/qqmldelegatemodel.cpp
src/quick/items/context2d/qquickcanvasitem.cpp
src/quick/items/context2d/qquickcontext2d.cpp
sync.profile
tests/auto/qml/qjsengine/tst_qjsengine.cpp
tests/benchmarks/qml/animation/animation.pro
tools/qmlprofiler/qmlprofiler.pro
Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
Diffstat (limited to 'examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc')
-rw-r--r-- | examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc b/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc index 1529649798..5d83b9fa5f 100644 --- a/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc +++ b/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc @@ -47,7 +47,7 @@ material state is what we assign to each individual node, in this case to give them different colors. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 1 + \snippet scenegraph/simplematerial/simplematerial.cpp 1 The first thing we do when creating custom materials with the simplified scheme is to create a state class. In this case the @@ -55,7 +55,7 @@ compare function which the scene graph can use to reorder the node rendering. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 2 + \snippet scenegraph/simplematerial/simplematerial.cpp 2 Next we define the material shader, by subclassing a template instantiation of \l QSGSimpleMaterialShader with our \c State. @@ -74,21 +74,21 @@ classes. Using the same \c State class in multiple shaders will will lead to undefined behavior. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 3 + \snippet scenegraph/simplematerial/simplematerial.cpp 3 Next comes the declaration of the shader source code, where we define a vertex and fragment shader. The simple material assumes the presence of \c qt_Matrix in the vertex shader and \c qt_Opacity in the fragment shader. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 4 + \snippet scenegraph/simplematerial/simplematerial.cpp 4 We reimplement the \c attributes function to return the name of the \c aVertex and \c aTexCoord attribute names. These attributes will be mapped to attribute indices 0 and 1 in the node's geometry. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 6 + \snippet scenegraph/simplematerial/simplematerial.cpp 6 Uniforms can be accessed either by name or by index, where index is faster than name, so we reimplement the \c resolveUniforms() @@ -96,7 +96,7 @@ to worry about resolving \c qt_Opacity or \c qt_Matrix as these are handled by the baseclass. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 5 + \snippet scenegraph/simplematerial/simplematerial.cpp 5 The \c updateState() function is called once for every unique state and we use it to update the shader program with the current @@ -105,7 +105,7 @@ usecase, where all the colors are different, the updateState will be called once for every node. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 7 + \snippet scenegraph/simplematerial/simplematerial.cpp 7 The \c ColorNode class is supposed to draw something, so it needs to be a subclass of \l QSGGeometryNode. @@ -129,12 +129,12 @@ Finally, we tell the node to take ownership of the material, so we do not have to explicitly memorymanage it. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 8 + \snippet scenegraph/simplematerial/simplematerial.cpp 8 Since the Item is providing its own graphics to the scene graph, we set the flag \l QQuickItem::ItemHasContents. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 9 + \snippet scenegraph/simplematerial/simplematerial.cpp 9 Whenever the Item has changed graphically, the \l QQuickItem::updatePaintNode() function is called. @@ -157,23 +157,23 @@ state. Finally, we notify the scene graph that the node has undergone changes to its geometry and material. - \snippet quick/scenegraph/simplematerial/simplematerial.cpp 11 + \snippet scenegraph/simplematerial/simplematerial.cpp 11 The \c main() function of the application adds the custom QML type using \l qmlRegisterType() and opens up a \l QQuickView with our QML file. - \snippet quick/scenegraph/simplematerial/main.qml 1 + \snippet scenegraph/simplematerial/main.qml 1 In the QML file, we import our custom type so we can instantiate it. - \snippet quick/scenegraph/simplematerial/main.qml 2 + \snippet scenegraph/simplematerial/main.qml 2 Then we create a column of three instances of our custom item, each with a different color. - \snippet quick/scenegraph/simplematerial/main.qml 3 + \snippet scenegraph/simplematerial/main.qml 3 And finally we overlay a short descriptive text. |