Changeset 84888 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 21, 2020 6:41:16 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r84800 r84888 171 171 172 172 /* The guest texture OpenGL target. */ 173 static GLenum const kTextureTarget = GL_TEXTURE_ RECTANGLE;173 static GLenum const kTextureTarget = GL_TEXTURE_2D; 174 174 175 175 /* The the guest screen source. */ … … 676 676 GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT, // Must support GLX pixmaps 677 677 GLX_BIND_TO_TEXTURE_RGBA_EXT, True, // Must support GLX_EXT_texture_from_pixmap 678 GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_ RECTANGLE_BIT_EXT, // Must support GL_TEXTURE_RECTANGLE for the frontend code678 GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT, // Must support GL_TEXTURE_2D because the device creates the pixmap as TEXTURE_2D 679 679 GLX_DOUBLEBUFFER, False, // No need for double buffering for a pixmap. 680 680 GLX_RED_SIZE, 8, // True color RGB with 8 bits per channel. … … 727 727 static int const aPixmapAttribList[] = 728 728 { 729 GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_ RECTANGLE_EXT /* GLX_TEXTURE_2D_EXT */,729 GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT, 730 730 GLX_TEXTURE_FORMAT_EXT, GLX_TEXTURE_FORMAT_RGBA_EXT, 731 731 None … … 811 811 812 812 /* Whether OpenGL is usable. 813 * OpenGL 2.0 and support for GL_TEXTURE_RECTANGLE isrequired.813 * OpenGL 2.0 required. 814 814 */ 815 815 /* static */ bool GLWidget::isSupported() … … 839 839 840 840 /* Check if GL_TEXTURE_RECTANGLE is supported: */ 841 bool const fTextureRectangle = contextGL.hasExtension("GL_ARB_texture_rectangle")842 || contextGL.hasExtension("GL_NV_texture_rectangle")843 || ver >= 31;841 //bool const fTextureRectangle = contextGL.hasExtension("GL_ARB_texture_rectangle") 842 // || contextGL.hasExtension("GL_NV_texture_rectangle") 843 // || ver >= 31; 844 844 845 845 /* Reset the current OpenGL context: */ … … 847 847 848 848 /* Decide if OpenGL support is good enough: */ 849 return ver >= 20 && fTextureRectangle;849 return ver >= 20 /* && fTextureRectangle */; 850 850 } 851 851 … … 986 986 987 987 /* The guest coordinates of the visible guest screen area: */ 988 int x1 = m_guestVisibleRect.x(); 989 int y1 = m_guestVisibleRect.y(); 990 int x2 = x1 + m_guestVisibleRect.width(); 991 int y2 = y1 + m_guestVisibleRect.height(); 988 float x1 = m_guestVisibleRect.x(); 989 float y1 = m_guestVisibleRect.y(); 990 float x2 = x1 + m_guestVisibleRect.width(); 991 float y2 = y1 + m_guestVisibleRect.height(); 992 993 x1 /= (float)m_guestSize.width(); 994 y1 /= (float)m_guestSize.height(); 995 x2 /= (float)m_guestSize.width(); 996 y2 /= (float)m_guestSize.height(); 992 997 993 998 glDisable(GL_DEPTH_TEST); GLCHECK(); … … 1004 1009 /* Draw the texture (upside down, because QImage and OpenGL store the bitmap differently): */ 1005 1010 glBegin(GL_QUADS); 1006 glTexCoord2 i(x1, y1); glVertex2i(0, h);1007 glTexCoord2 i(x1, y2); glVertex2i(0, 0);1008 glTexCoord2 i(x2, y2); glVertex2i(w, 0);1009 glTexCoord2 i(x2, y1); glVertex2i(w, h);1011 glTexCoord2f(x1, y1); glVertex2i(0, h); 1012 glTexCoord2f(x1, y2); glVertex2i(0, 0); 1013 glTexCoord2f(x2, y2); glVertex2i(w, 0); 1014 glTexCoord2f(x2, y1); glVertex2i(w, h); 1010 1015 glEnd(); GLCHECK(); 1011 1016 … … 1041 1046 /* Create a new guest texture, which must be the same size as the guest screen: */ 1042 1047 glGenTextures(1, &m_guestTexture); 1048 glEnable(kTextureTarget); GLCHECK(); 1043 1049 glBindTexture(kTextureTarget, m_guestTexture); 1044 1050 glTexParameteri(kTextureTarget, GL_TEXTURE_MAG_FILTER, filter); … … 1051 1057 glBindTexture(kTextureTarget, 0); 1052 1058 GLCHECK(); 1059 glDisable(kTextureTarget); GLCHECK(); 1053 1060 } 1054 1061
Note:
See TracChangeset
for help on using the changeset viewer.