diff options
author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2019-04-23 14:32:55 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2019-04-24 08:53:51 +0000 |
commit | 05ae61cba5f943eb58343b44f8d474bc88bf0ce4 (patch) | |
tree | 1e4d1cafcae292a2960275621f3595d8b01c3f9b /sources/pyside2/PySide2/glue | |
parent | 5cec7b8926fd12daa3bdca72cd2dfaadf5eda4b1 (diff) |
Add explicit methods for QOpenGLShaderProgramm.setUniformValue (i/f)
Selecting which overload to use is in hands of the shader program
code that defines the type, then it is better to explicitly call
signatures that are overloaded using number types, specially for
OpenGL.
This change will help with PYSIDE-989, because it will allow to
call `setUniformValue1f` without having the problem of using
the generic `setUniformValue` that will end in calling the
wrong method (the integer one).
Since the primitive type conversion is a separate global issue,
another task has been opened PYSIDE-1000.
Task-number: PYSIDE-989
Change-Id: I77e5616e081e570bee880a1a403faf3cf6c55099
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/glue')
-rw-r--r-- | sources/pyside2/PySide2/glue/qtgui.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/glue/qtgui.cpp b/sources/pyside2/PySide2/glue/qtgui.cpp index 4ae3eef75..aef9e4b59 100644 --- a/sources/pyside2/PySide2/glue/qtgui.cpp +++ b/sources/pyside2/PySide2/glue/qtgui.cpp @@ -115,6 +115,16 @@ if (doc) { } // @snippet qtextblock-userdata +// @snippet qopenglshaderprogram_setuniformvalue_float +float value = %2; +%CPPSELF.setUniformValue(%1, value); +// @snippet qopenglshaderprogram_setuniformvalue_float + +// @snippet qopenglshaderprogram_setuniformvalue_int +int value = %2; +%CPPSELF.setUniformValue(%1, value); +// @snippet qopenglshaderprogram_setuniformvalue_int + // @snippet qpolygon-reduce PyObject *points = PyList_New(%CPPSELF.count()); for (int i = 0, i_max = %CPPSELF.count(); i < i_max; ++i){ |