Ticket #9248: libmythui-ogl-w32.diff
File libmythui-ogl-w32.diff, 3.9 KB (added by , 13 years ago) |
---|
-
libs/libmythui/mythrender_opengl_defs.h
220 220 typedef void ( * MYTH_GLDISABLEVERTEXATTRIBARRAY) 221 221 (GLuint index); 222 222 typedef void ( * MYTH_GLBINDATTRIBLOCATION) 223 (GLuint program, GLuint index, const GLchar ARB*name);223 (GLuint program, GLuint index, const GLchar *name); 224 224 typedef void ( * MYTH_GLVERTEXATTRIB4F) 225 225 (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); 226 226 -
libs/libmythui/mythrender_opengl.h
9 9 10 10 #ifdef _WIN32 11 11 #include <GL/glext.h> 12 typedef char GLchar; 12 13 #endif 13 14 14 15 #ifdef Q_WS_MACX -
libs/libmythui/mythrender_opengl.cpp
1130 1130 1131 1131 EnableTextures(tex); 1132 1132 glBindTexture(m_textures[tex].m_type, tex); 1133 1133 #ifdef GL_ARRAY_BUFFER 1134 1134 m_glBindBufferARB(GL_ARRAY_BUFFER, m_textures[tex].m_vbo); 1135 #endif 1135 1136 UpdateTextureVertices(tex, src, dst); 1137 #ifdef GL_ARRAY_BUFFER 1136 1138 m_glBufferDataARB(GL_ARRAY_BUFFER, kVertexSize, NULL, GL_STREAM_DRAW); 1137 1139 void* target = m_glMapBufferARB(GL_ARRAY_BUFFER, GL_WRITE_ONLY); 1138 1140 if (target) 1139 1141 memcpy(target, m_textures[tex].m_vertex_data, kVertexSize); 1140 1142 m_glUnmapBufferARB(GL_ARRAY_BUFFER); 1143 #endif 1141 1144 1142 1145 m_glEnableVertexAttribArray(VERTEX_INDEX); 1143 1146 m_glEnableVertexAttribArray(TEXTURE_INDEX); … … 1154 1157 1155 1158 m_glDisableVertexAttribArray(TEXTURE_INDEX); 1156 1159 m_glDisableVertexAttribArray(VERTEX_INDEX); 1160 #ifdef GL_ARRAY_BUFFER 1157 1161 m_glBindBufferARB(GL_ARRAY_BUFFER, 0); 1162 #endif 1158 1163 } 1159 1164 1160 1165 void MythRenderOpenGL::DrawBitmapLegacy(uint *textures, uint texture_count, … … 1269 1274 VERTEX_SIZE * sizeof(GLfloat), 1270 1275 (const void *) kVertexOffset); 1271 1276 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 1277 #ifdef GL_ARRAY_BUFFER 1272 1278 m_glBindBufferARB(GL_ARRAY_BUFFER, 0); 1279 #endif 1273 1280 } 1274 1281 1275 1282 if (drawLine) … … 1285 1292 VERTEX_SIZE * sizeof(GLfloat), 1286 1293 (const void *) kVertexOffset); 1287 1294 glDrawArrays(GL_LINE_LOOP, 0, 4); 1295 #ifdef GL_ARRAY_BUFFER 1288 1296 m_glBindBufferARB(GL_ARRAY_BUFFER, 0); 1297 #endif 1289 1298 } 1290 1299 1291 1300 m_glDisableVertexAttribArray(VERTEX_INDEX); … … 1777 1786 const char* tmp[1] = { src.constData() }; 1778 1787 m_glShaderSource(result, 1, tmp, NULL); 1779 1788 m_glCompileShader(result); 1780 GLint compiled; 1789 GLint compiled = 0; 1790 #ifdef GL_COMPILE_STATUS 1781 1791 m_glGetShader(result, GL_COMPILE_STATUS, &compiled); 1792 #endif 1782 1793 if (!compiled) 1783 1794 { 1795 #ifdef GL_INFO_LOG_LENGTH 1784 1796 GLint length = 0; 1785 1797 m_glGetShader(result, GL_INFO_LOG_LENGTH, &length); 1786 1798 if (length > 1) … … 1791 1803 VERBOSE(VB_IMPORTANT, log); 1792 1804 free(log); 1793 1805 } 1806 #endif 1794 1807 m_glDeleteShader(result); 1795 1808 result = 0; 1796 1809 } … … 1993 2006 m_cachedVBOS.insert(ref, vbo); 1994 2007 m_vboExpiry.append(ref); 1995 2008 2009 #ifdef GL_ARRAY_BUFFER 1996 2010 m_glBindBufferARB(GL_ARRAY_BUFFER, vbo); 1997 2011 m_glBufferDataARB(GL_ARRAY_BUFFER, kTextureOffset, NULL, GL_STREAM_DRAW); 1998 2012 void* target = m_glMapBufferARB(GL_ARRAY_BUFFER, GL_WRITE_ONLY); 1999 2013 if (target) 2000 2014 memcpy(target, vertices, kTextureOffset); 2001 2015 m_glUnmapBufferARB(GL_ARRAY_BUFFER); 2002 2016 #endif 2003 2017 ExpireVBOS(MAX_VERTEX_CACHE); 2004 2018 return; 2005 2019 } 2006 2020 2021 #ifdef GL_ARRAY_BUFFER 2007 2022 m_glBindBufferARB(GL_ARRAY_BUFFER, m_cachedVBOS.value(ref)); 2023 #endif 2008 2024 } 2009 2025 2010 2026 void MythRenderOpenGL::ExpireVBOS(uint max)