Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 3 files). Show all
Unified · Split
| @@ -699,7 +699,9 @@ void GeometryCache::renderQuad(const glm::vec2& topLeft, const glm::vec2& bottom · 698 unmodified lines | ||
| 699 | 699 | glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices * NUM_BYTES_PER_INDEX, indexData, GL_STATIC_DRAW); |
| 700 | 700 | delete[] indexData; |
| 701 | 701 | |
| 702 | − qDebug() << "new quad VBO made -- _quad2DVBOs.size():" << _quad2DVBOs.size(); | |
| 702 | + #ifdef WANT_DEBUG | |
| 703 | + qDebug() << "new quad VBO made -- _quad2DVBOs.size():" << _quad2DVBOs.size(); | |
| 704 | + #endif | |
| 703 | 705 | |
| 704 | 706 | } else { |
| 705 | 707 | glBindBuffer(GL_ARRAY_BUFFER, vbo.first); |
| @@ -767,7 +769,9 @@ void GeometryCache::renderQuad(const glm::vec2& topLeft, const glm::vec2& bottom · 61 unmodified lines | ||
| 767 | 769 | glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices * NUM_BYTES_PER_INDEX, indexData, GL_STATIC_DRAW); |
| 768 | 770 | delete[] indexData; |
| 769 | 771 | |
| 770 | − qDebug() << "new quad + texture VBO made -- _quad2DTextureVBOs.size():" << _quad2DTextureVBOs.size(); | |
| 772 | + #ifdef WANT_DEBUG | |
| 773 | + qDebug() << "new quad + texture VBO made -- _quad2DTextureVBOs.size():" << _quad2DTextureVBOs.size(); | |
| 774 | + #endif | |
| 771 | 775 | } else { |
| 772 | 776 | glBindBuffer(GL_ARRAY_BUFFER, vbo.first); |
| 773 | 777 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo.second); |
| @@ -833,7 +837,9 @@ void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottom · 59 unmodified lines | ||
| 833 | 837 | glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices * NUM_BYTES_PER_INDEX, indexData, GL_STATIC_DRAW); |
| 834 | 838 | delete[] indexData; |
| 835 | 839 | |
| 836 | − qDebug() << "new quad VBO made -- _quad3DVBOs.size():" << _quad3DVBOs.size(); | |
| 840 | + #ifdef WANT_DEBUG | |
| 841 | + qDebug() << "new quad VBO made -- _quad3DVBOs.size():" << _quad3DVBOs.size(); | |
| 842 | + #endif | |
| 837 | 843 | |
| 838 | 844 | } else { |
| 839 | 845 | glBindBuffer(GL_ARRAY_BUFFER, vbo.first); |
| @@ -849,8 +855,20 @@ void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottom · 9 unmodified lines | ||
| 849 | 855 | } |
| 850 | 856 | |
| 851 | 857 | |
| 852 | −void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottomRight, | |
| 853 | − const glm::vec2& texCoordTopLeft, const glm::vec2& texCoordBottomRight) { | |
| 858 | +void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottomLeft, | |
| 859 | + const glm::vec3& bottomRight, const glm::vec3& topRight, | |
| 860 | + const glm::vec2& texCoordTopLeft, const glm::vec2& texCoordBottomLeft, | |
| 861 | + const glm::vec2& texCoordBottomRight, const glm::vec2& texCoordTopRight) { | |
| 862 | + | |
| 863 | + #ifdef WANT_DEBUG | |
| 864 | + qDebug() << "renderQuad() vec3 + texture VBO..."; | |
| 865 | + qDebug() << " topLeft:" << topLeft; | |
| 866 | + qDebug() << " bottomLeft:" << bottomLeft; | |
| 867 | + qDebug() << " bottomRight:" << bottomRight; | |
| 868 | + qDebug() << " topRight:" << topRight; | |
| 869 | + qDebug() << " texCoordTopLeft:" << texCoordTopLeft; | |
| 870 | + qDebug() << " texCoordBottomRight:" << texCoordBottomRight; | |
| 871 | + #endif //def WANT_DEBUG | |
| 854 | 872 | |
| 855 | 873 | Vec3PairVec2Pair key(Vec3Pair(topLeft, bottomRight), Vec2Pair(texCoordTopLeft, texCoordBottomRight)); |
| 856 | 874 | |
| @@ -872,11 +890,11 @@ void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottom · 15 unmodified lines | ||
| 872 | 890 | vertex[v++] = texCoordTopLeft.x; |
| 873 | 891 | vertex[v++] = texCoordTopLeft.y; |
| 874 | 892 | |
| 875 | − vertex[v++] = bottomRight.x; | |
| 876 | − vertex[v++] = topLeft.y; | |
| 877 | − vertex[v++] = topLeft.z; | |
| 878 | − vertex[v++] = texCoordBottomRight.x; | |
| 879 | − vertex[v++] = texCoordTopLeft.y; | |
| 893 | + vertex[v++] = bottomLeft.x; | |
| 894 | + vertex[v++] = bottomLeft.y; | |
| 895 | + vertex[v++] = bottomLeft.z; | |
| 896 | + vertex[v++] = texCoordBottomLeft.x; | |
| 897 | + vertex[v++] = texCoordBottomLeft.y; | |
| 880 | 898 | |
| 881 | 899 | vertex[v++] = bottomRight.x; |
| 882 | 900 | vertex[v++] = bottomRight.y; |
| @@ -884,11 +902,11 @@ void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottom · 1 unmodified line | ||
| 884 | 902 | vertex[v++] = texCoordBottomRight.x; |
| 885 | 903 | vertex[v++] = texCoordBottomRight.y; |
| 886 | 904 | |
| 887 | − vertex[v++] = topLeft.x; | |
| 888 | − vertex[v++] = bottomRight.y; | |
| 889 | − vertex[v++] = bottomRight.z; | |
| 890 | − vertex[v++] = texCoordTopLeft.x; | |
| 891 | − vertex[v++] = texCoordBottomRight.y; | |
| 905 | + vertex[v++] = topRight.x; | |
| 906 | + vertex[v++] = topRight.y; | |
| 907 | + vertex[v++] = topRight.z; | |
| 908 | + vertex[v++] = texCoordTopRight.x; | |
| 909 | + vertex[v++] = texCoordTopRight.y; | |
| 892 | 910 | |
| 893 | 911 | glGenBuffers(1, &vbo.first); |
| 894 | 912 | glBindBuffer(GL_ARRAY_BUFFER, vbo.first); |
| @@ -905,8 +923,10 @@ void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottom · 10 unmodified lines | ||
| 905 | 923 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo.second); |
| 906 | 924 | glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices * NUM_BYTES_PER_INDEX, indexData, GL_STATIC_DRAW); |
| 907 | 925 | delete[] indexData; |
| 908 | − | |
| 909 | − qDebug() << "new quad + texture VBO made -- _quad3DTextureVBOs.size():" << _quad3DTextureVBOs.size(); | |
| 926 | + | |
| 927 | + #ifdef WANT_DEBUG | |
| 928 | + qDebug() << " _quad3DTextureVBOs.size():" << _quad3DTextureVBOs.size(); | |
| 929 | + #endif | |
| 910 | 930 | } else { |
| 911 | 931 | glBindBuffer(GL_ARRAY_BUFFER, vbo.first); |
| 912 | 932 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo.second); |
| @@ -914,7 +934,7 @@ void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottom · 1 unmodified line | ||
| 914 | 934 | |
| 915 | 935 | glEnableClientState(GL_VERTEX_ARRAY); |
| 916 | 936 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); |
| 917 | − glVertexPointer(2, GL_FLOAT, NUM_BYTES_PER_VERTEX, 0); | |
| 937 | + glVertexPointer(3, GL_FLOAT, NUM_BYTES_PER_VERTEX, 0); | |
| 918 | 938 | glTexCoordPointer(2, GL_FLOAT, NUM_BYTES_PER_VERTEX, (const void *)(3 * sizeof(float))); |
| 919 | 939 | |
| 920 | 940 | glDrawRangeElementsEXT(GL_QUADS, 0, vertices - 1, indices, GL_UNSIGNED_SHORT, 0); |