xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #227: opengl-win32.patch

File opengl-win32.patch, 3.2 KB (added by Antoine Martin, 8 years ago)

with this patch, win32 works ok, for x264/vpx at least, but linux crashes..

  • xpra/gl/gl_window_backing.py

     
    2121    GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_NEAREST, \
    2222    GL_UNSIGNED_BYTE, GL_LUMINANCE, GL_LINEAR, \
    2323    GL_TEXTURE0, GL_TEXTURE1, GL_TEXTURE2, GL_QUADS, \
     24    GL_TEXTURE0_ARB, GL_TEXTURE1_ARB, GL_TEXTURE2_ARB, \
    2425    glActiveTexture, glTexSubImage2D, glTexCoord2i, \
    2526    glGetString, glViewport, glMatrixMode, glLoadIdentity, glOrtho, \
    2627    glEnableClientState, glGenTextures, glDisable, \
    2728    glBindTexture, glPixelStorei, glEnable, glBegin, glFlush, \
    2829    glTexParameteri, \
    2930    glTexImage2D, \
    30     glMultiTexCoord2i, \
    3131    glVertex2i, glEnd
    3232from OpenGL.GL.ARB.texture_rectangle import GL_TEXTURE_RECTANGLE_ARB
     33from OpenGL.GL.ARB.multitexture import glActiveTextureARB, glMultiTexCoord2iARB
    3334from OpenGL.GL.ARB.vertex_program import glGenProgramsARB, glDeleteProgramsARB, \
    3435    glBindProgramARB, glProgramStringARB, GL_PROGRAM_ERROR_STRING_ARB, GL_PROGRAM_FORMAT_ASCII_ARB
    3536from OpenGL.GL.ARB.fragment_program import GL_FRAGMENT_PROGRAM_ARB
     
    7879            glMatrixMode(GL_MODELVIEW)
    7980            glEnableClientState(GL_VERTEX_ARRAY)
    8081            glEnableClientState(GL_TEXTURE_COORD_ARRAY)
    81             glDisable(GL_FRAGMENT_PROGRAM_ARB)
    8282            if self.textures is None:
    8383                self.textures = glGenTextures(3)
    8484        return drawable
     
    210210            divs = self.get_subsampling_divs(pixel_format)
    211211            log("GL creating new YUV textures for pixel format %s using divs=%s", pixel_format, divs)
    212212            # Create textures of the same size as the window's
    213             glEnable(GL_TEXTURE_RECTANGLE_ARB)
    214213
    215             for texture, index in ((GL_TEXTURE0, 0), (GL_TEXTURE1, 1), (GL_TEXTURE2, 2)):
     214            for texture, index in ((GL_TEXTURE0_ARB, 0), (GL_TEXTURE1_ARB, 1), (GL_TEXTURE2_ARB, 2)):
    216215                div = divs[index]
    217                 glActiveTexture(texture)
     216                glActiveTextureARB(texture)
     217                glEnable(GL_TEXTURE_RECTANGLE_ARB)
    218218                glBindTexture(GL_TEXTURE_RECTANGLE_ARB, self.textures[index])
    219                 glEnable(GL_TEXTURE_RECTANGLE_ARB)
    220219                mag_filter = GL_NEAREST
    221220                if div>1:
    222221                    mag_filter = GL_LINEAR
     
    242241            height = window_height - y
    243242
    244243        divs = self.get_subsampling_divs(pixel_format)
    245         for texture, index in ((GL_TEXTURE0, 0), (GL_TEXTURE1, 1), (GL_TEXTURE2, 2)):
     244        for texture, index in ((GL_TEXTURE0_ARB, 0), (GL_TEXTURE1_ARB, 1), (GL_TEXTURE2_ARB, 2)):
    246245            div = divs[index]
    247246            glActiveTexture(texture)
    248247            glBindTexture(GL_TEXTURE_RECTANGLE_ARB, self.textures[index])
     
    261260        for x,y in ((rx, ry), (rx, ry+rh), (rx+rw, ry+rh), (rx+rw, ry)):
    262261            for texture, index in ((GL_TEXTURE0, 0), (GL_TEXTURE1, 1), (GL_TEXTURE2, 2)):
    263262                div = divs[index]
    264                 glMultiTexCoord2i(texture, x/div, y/div)
     263                glMultiTexCoord2iARB(texture, x/div, y/div)
    265264            glVertex2i(x, y)
    266265        glEnd()
    267266        glFlush()