aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtOpenGL
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-07-28 17:38:00 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:40 -0300
commit035265df107918c4e091bd55246d93df1d9092a1 (patch)
treebb1a1c5f6e43aa939d51b4e57153951ad5f58f33 /PySide/QtOpenGL
parent7a5d2e693bdfde21c58b252e6c0c35def1a64e53 (diff)
Fixes the support for QGLShaderProgram's array functions.
Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'PySide/QtOpenGL')
-rw-r--r--PySide/QtOpenGL/typesystem_opengl.xml220
1 files changed, 134 insertions, 86 deletions
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index 58c6c122d..0a1579cfa 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -95,41 +95,21 @@
<template name="callArrayFunction">
int _size = PySequence_Size(%PYARG_2);
if (_size) {
- %ATTR_TYPE *_list = new %ATTR_TYPE[_size];
+ $ATTR_TYPE *_list = new $ATTR_TYPE[_size];
if (_size) {
Shiboken::AutoDecRef fast(PySequence_Fast(%PYARG_2, "Failed to parse sequence with type %VECTOR_TYPE."));
for(int i=0; i &lt; _size; i++) {
PyObject* pv = PySequence_Fast_GET_ITEM(fast.object(), i);
- _list[i] = %CONVERTTOCPP[ %ATTR_TYPE ](pv);
+ _list[i] = %CONVERTTOCPP[$ATTR_TYPE](pv);
}
}
- %CPPSELF.%FUNCTION_NAME(%1, _list, %3);
+ %CPPSELF.%FUNCTION_NAME(%1, _list, $ARG0);
delete[] _list;
} else {
- %CPPSELF.%FUNCTION_NAME(%1, NULL, %3);
+ %CPPSELF.%FUNCTION_NAME(%1, ($ATTR_TYPE*)NULL, $ARG1);
}
-
</template>
- <template name="callArrayFunctionWithCount">
- int _size = PySequence_Size(%PYARG_2);
- if (size) {
- %ATTR_TYPE *_list = new %ATTR_TYPE[_size];
- if (_size) {
- Shiboken::AutoDecRef fast(PySequence_Fast(%PYARG_2, "Failed to parse sequence with type %VECTOR_TYPE."));
- for(int i=0; i &lt; _size; i++) {
- PyObject* pv = PySequence_Fast_GET_ITEM(fast.object(), i);
- _list[i] = %CONVERTTOCPP[ %ATTR_TYPE ](pv);
- }
- }
- %CPPSELF.%FUNCTION_NAME(%1, _list, _size);
- delete[] _list;
- } else {
- %CPPSELF.%FUNCTION_NAME(%1, NULL, 0);
- }
- </template>
-
-
<object-type name="QGLShaderProgram" since="4.6">
<!-- setAttributeArray -->
<modify-function signature="setAttributeArray(int, const QVector2D*, int)" rename="setAttributeArray2D">
@@ -138,7 +118,9 @@
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="%ATTR_TYPE" to="QVector2D"/>
+ <replace from="$ARG0" to="%3" />
+ <replace from="$ARG1" to="%3" />
+ <replace from="$ATTR_TYPE" to="QVector2D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -149,7 +131,9 @@
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="%ATTR_TYPE" to="QVector3D"/>
+ <replace from="$ARG0" to="%3" />
+ <replace from="$ARG1" to="%3" />
+ <replace from="$ATTR_TYPE" to="QVector3D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -160,7 +144,9 @@
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="%ATTR_TYPE" to="QVector4D"/>
+ <replace from="$ARG0" to="%3" />
+ <replace from="$ARG1" to="%3" />
+ <replace from="$ATTR_TYPE" to="QVector4D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -171,7 +157,9 @@
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="%ATTR_TYPE" to="QVector2D"/>
+ <replace from="$ARG0" to="%3" />
+ <replace from="$ARG1" to="%3" />
+ <replace from="$ATTR_TYPE" to="QVector2D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -182,7 +170,9 @@
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="%ATTR_TYPE" to="QVector3D"/>
+ <replace from="$ARG0" to="%3" />
+ <replace from="$ARG1" to="%3" />
+ <replace from="$ATTR_TYPE" to="QVector3D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -193,7 +183,9 @@
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="%ATTR_TYPE" to="QVector4D"/>
+ <replace from="$ARG0" to="%3" />
+ <replace from="$ARG1" to="%3" />
+ <replace from="$ATTR_TYPE" to="QVector4D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -208,8 +200,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="GLint"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="GLint"/>
</insert-template>
</inject-code>
</modify-function>
@@ -222,8 +216,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="GLuint"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="GLuint"/>
</insert-template>
</inject-code>
</modify-function>
@@ -236,8 +232,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QVector2D"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QVector2D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -250,8 +248,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QVector3D"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QVector3D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -264,8 +264,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QVector4D"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QVector4D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -278,8 +280,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix2x2"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix2x2"/>
</insert-template>
</inject-code>
</modify-function>
@@ -292,8 +296,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix2x3"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix2x3"/>
</insert-template>
</inject-code>
</modify-function>
@@ -306,8 +312,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix2x4"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix2x4"/>
</insert-template>
</inject-code>
</modify-function>
@@ -320,8 +328,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix3x2"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix3x2"/>
</insert-template>
</inject-code>
</modify-function>
@@ -334,8 +344,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix3x3"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix3x3"/>
</insert-template>
</inject-code>
</modify-function>
@@ -348,8 +360,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix3x4"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix3x4"/>
</insert-template>
</inject-code>
</modify-function>
@@ -362,8 +376,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix4x2"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix4x2"/>
</insert-template>
</inject-code>
</modify-function>
@@ -376,8 +392,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix4x3"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix4x3"/>
</insert-template>
</inject-code>
</modify-function>
@@ -390,8 +408,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix4x4"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix4x4"/>
</insert-template>
</inject-code>
</modify-function>
@@ -404,8 +424,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="GLint"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="GLint"/>
</insert-template>
</inject-code>
</modify-function>
@@ -418,8 +440,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="GLuint"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="GLuint"/>
</insert-template>
</inject-code>
</modify-function>
@@ -432,8 +456,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QVector2D"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QVector2D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -446,8 +472,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QVector3D"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QVector3D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -460,8 +488,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QVector4D"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QVector4D"/>
</insert-template>
</inject-code>
</modify-function>
@@ -474,8 +504,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix2x2"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix2x2"/>
</insert-template>
</inject-code>
</modify-function>
@@ -488,8 +520,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix2x3"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix2x3"/>
</insert-template>
</inject-code>
</modify-function>
@@ -502,8 +536,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix2x4"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix2x4"/>
</insert-template>
</inject-code>
</modify-function>
@@ -516,8 +552,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix3x2"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix3x2"/>
</insert-template>
</inject-code>
</modify-function>
@@ -530,8 +568,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix3x3"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix3x3"/>
</insert-template>
</inject-code>
</modify-function>
@@ -544,8 +584,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix3x4"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix3x4"/>
</insert-template>
</inject-code>
</modify-function>
@@ -558,8 +600,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix4x2"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix4x2"/>
</insert-template>
</inject-code>
</modify-function>
@@ -572,8 +616,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix4x3"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix4x3"/>
</insert-template>
</inject-code>
</modify-function>
@@ -586,8 +632,10 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="callArrayFunctionWithCount">
- <replace from="%ATTR_TYPE" to="QMatrix4x4"/>
+ <insert-template name="callArrayFunction">
+ <replace from="$ARG0" to="_size" />
+ <replace from="$ARG1" to="0" />
+ <replace from="$ATTR_TYPE" to="QMatrix4x4"/>
</insert-template>
</inject-code>
</modify-function>