Changeset 25423 in vbox
- Timestamp:
- Dec 16, 2009 10:21:40 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGL2D.h
r25385 r25423 159 159 typedef GLboolean (APIENTRY *PFNVBOXVHWA_UNMAP_BUFFER)(GLenum target); 160 160 161 /* GL_EXT_framebuffer_object */ 162 #ifndef GL_FRAMEBUFFER 163 # define GL_FRAMEBUFFER 0x8D40 164 #endif 165 #ifndef GL_COLOR_ATTACHMENT0 166 # define GL_COLOR_ATTACHMENT0 0x8CE0 167 #endif 168 169 typedef GLboolean (APIENTRY *PFNVBOXVHWA_IS_FRAMEBUFFER)(GLuint framebuffer); 170 typedef GLvoid (APIENTRY *PFNVBOXVHWA_BIND_FRAMEBUFFER)(GLenum target, GLuint framebuffer); 171 typedef GLvoid (APIENTRY *PFNVBOXVHWA_DELETE_FRAMEBUFFERS)(GLsizei n, const GLuint *framebuffers); 172 typedef GLvoid (APIENTRY *PFNVBOXVHWA_GEN_FRAMEBUFFERS)(GLsizei n, GLuint *framebuffers); 173 typedef GLenum (APIENTRY *PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS)(GLenum target); 174 typedef GLvoid (APIENTRY *PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); 175 typedef GLvoid (APIENTRY *PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); 176 typedef GLvoid (APIENTRY *PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); 177 typedef GLvoid (APIENTRY *PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV)(GLenum target, GLenum attachment, GLenum pname, GLint *params); 178 161 179 162 180 /*****************/ … … 209 227 extern PFNVBOXVHWA_MAP_BUFFER vboxglMapBuffer; 210 228 extern PFNVBOXVHWA_UNMAP_BUFFER vboxglUnmapBuffer; 229 230 extern PFNVBOXVHWA_IS_FRAMEBUFFER vboxglIsFramebuffer; 231 extern PFNVBOXVHWA_BIND_FRAMEBUFFER vboxglBindFramebuffer; 232 extern PFNVBOXVHWA_DELETE_FRAMEBUFFERS vboxglDeleteFramebuffers; 233 extern PFNVBOXVHWA_GEN_FRAMEBUFFERS vboxglGenFramebuffers; 234 extern PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS vboxglCheckFramebufferStatus; 235 extern PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D vboxglFramebufferTexture1D; 236 extern PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D vboxglFramebufferTexture2D; 237 extern PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D vboxglFramebufferTexture3D; 238 extern PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV vboxglGetFramebufferAttachmentParameteriv; 239 211 240 212 241 class VBoxGLInfo … … 219 248 mTextureNP2Supported(false), 220 249 mPBOSupported(false), 250 mFBOSupported(false), 221 251 mMultiTexNumSupported(1), /* 1 would mean it is not supported */ 222 252 m_GL_ARB_multitexture(false), … … 228 258 m_GL_NV_texture_rectangle(false), 229 259 m_GL_ARB_texture_non_power_of_two(false), 260 m_GL_EXT_framebuffer_object(false), 230 261 mInitialized(false) 231 262 {} … … 240 271 bool isTextureNP2Supported() const { return mTextureNP2Supported; } 241 272 bool isPBOSupported() const { return mPBOSupported; } 273 bool isFBOSupported() const { return mFBOSupported; } 242 274 /* 1 would mean it is not supported */ 243 275 int getMultiTexNumSupported() const { return mMultiTexNumSupported; } … … 252 284 bool mTextureNP2Supported; 253 285 bool mPBOSupported; 286 bool mFBOSupported; 254 287 int mMultiTexNumSupported; /* 1 would mean it is not supported */ 255 288 … … 262 295 bool m_GL_NV_texture_rectangle; 263 296 bool m_GL_ARB_texture_non_power_of_two; 297 bool m_GL_EXT_framebuffer_object; 264 298 265 299 bool mInitialized; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r25385 r25423 29 29 //#define VBOXVHWADBG_RENDERCHECK 30 30 31 //#define VBOXVHWA_NEW_PBO 32 31 33 #include "COMDefs.h" 32 34 #include <QGLWidget> … … 653 655 uchar* mAddress; 654 656 }; 655 #if 0 657 656 658 class VBoxVHWAFBO 657 659 { … … 665 667 if(mFBO) 666 668 { 667 vboxglDeleteFramebuffers(1, mFBO);669 vboxglDeleteFramebuffers(1, &mFBO); 668 670 } 669 671 } … … 688 690 GLuint mFBO; 689 691 }; 690 #endif691 692 692 693 class VBoxVHWAHandleTable -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGLSupportInfo.cpp
r24788 r25423 86 86 PFNVBOXVHWA_UNMAP_BUFFER vboxglUnmapBuffer = NULL; 87 87 88 #if 0 89 #if defined Q_WS_WIN 90 #define VBOXVHWA_GETPROCADDRESS(_t, _n) (_t)wglGetProcAddress(_n) 91 #elif defined Q_WS_X11 92 #include <GL/glx.h> 93 #define VBOXVHWA_GETPROCADDRESS(_t, _n) (_t)glXGetProcAddress((const GLubyte *)(_n)) 94 #else 95 #error "Port me!!!" 96 #endif 97 #endif 88 PFNVBOXVHWA_IS_FRAMEBUFFER vboxglIsFramebuffer = NULL; 89 PFNVBOXVHWA_BIND_FRAMEBUFFER vboxglBindFramebuffer = NULL; 90 PFNVBOXVHWA_DELETE_FRAMEBUFFERS vboxglDeleteFramebuffers = NULL; 91 PFNVBOXVHWA_GEN_FRAMEBUFFERS vboxglGenFramebuffers = NULL; 92 PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS vboxglCheckFramebufferStatus = NULL; 93 PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D vboxglFramebufferTexture1D = NULL; 94 PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D vboxglFramebufferTexture2D = NULL; 95 PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D vboxglFramebufferTexture3D = NULL; 96 PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV vboxglGetFramebufferAttachmentParameteriv = NULL; 98 97 99 98 #define VBOXVHWA_GETPROCADDRESS(_c, _t, _n) ((_t)(uintptr_t)(_c).getProcAddress(QString(_n))) … … 103 102 if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v)) == NULL) \ 104 103 { \ 105 VBOXQGLLOG (("ERROR: '%s' function not found\n", "gl"#_v));\104 VBOXQGLLOGREL(("ERROR: '%s' function not found\n", "gl"#_v));\ 106 105 AssertBreakpoint(); \ 107 106 if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"ARB")) == NULL) \ 108 107 { \ 109 VBOXQGLLOG (("ERROR: '%s' function not found\n", "gl"#_v"ARB"));\108 VBOXQGLLOGREL(("ERROR: '%s' function not found\n", "gl"#_v"ARB"));\ 110 109 AssertBreakpoint(); \ 111 110 if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"EXT")) == NULL) \ 112 111 { \ 113 VBOXQGLLOG (("ERROR: '%s' function not found\n", "gl"#_v"EXT"));\112 VBOXQGLLOGREL(("ERROR: '%s' function not found\n", "gl"#_v"EXT"));\ 114 113 AssertBreakpoint(); \ 115 114 (_rc)++; \ … … 123 122 if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_f)) == NULL) \ 124 123 { \ 125 VBOXQGLLOG (("ERROR: '%s' function is not found\n", "gl"#_f));\124 VBOXQGLLOGREL(("ERROR: '%s' function is not found\n", "gl"#_f));\ 126 125 AssertBreakpoint(); \ 127 126 (_rc)++; \ … … 129 128 }while(0) 130 129 131 //#define VBOXVHWA_PFNINIT_OBJECT_ARB(_t, _v, _rc) VBOXVHWA_PFNINIT(_t, _v, #_v"ObjectARB" ,_rc)132 130 #define VBOXVHWA_PFNINIT_OBJECT_ARB(_c, _t, _v, _rc) \ 133 131 do { \ 134 132 if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"ObjectARB")) == NULL) \ 135 133 { \ 136 VBOXQGLLOG (("ERROR: '%s' function is not found\n", "gl"#_v"ObjectARB"));\134 VBOXQGLLOGREL(("ERROR: '%s' function is not found\n", "gl"#_v"ObjectARB"));\ 137 135 AssertBreakpoint(); \ 138 136 (_rc)++; \ … … 140 138 }while(0) 141 139 142 //#define VBOXVHWA_PFNINIT_ARB(_t, _v, _rc) VBOXVHWA_PFNINIT(_t, _v, #_v"ARB" ,_rc)143 140 #define VBOXVHWA_PFNINIT_ARB(_c, _t, _v, _rc) \ 144 141 do { \ 145 142 if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"ARB")) == NULL) \ 146 143 { \ 147 VBOXQGLLOG(("ERROR: '%s' function is not found\n", "gl"#_v"ARB"));\ 144 VBOXQGLLOGREL(("ERROR: '%s' function is not found\n", "gl"#_v"ARB"));\ 145 AssertBreakpoint(); \ 146 (_rc)++; \ 147 } \ 148 }while(0) 149 150 #define VBOXVHWA_PFNINIT_EXT(_c, _t, _v, _rc) \ 151 do { \ 152 if((vboxgl##_v = VBOXVHWA_GETPROCADDRESS(_c, _t, "gl"#_v"EXT")) == NULL) \ 153 { \ 154 VBOXQGLLOGREL(("ERROR: '%s' function is not found\n", "gl"#_v"EXT"));\ 148 155 AssertBreakpoint(); \ 149 156 (_rc)++; \ … … 311 318 VBOXQGLLOGREL (("GL_ARB_texture_non_power_of_two: %d\n", m_GL_ARB_texture_non_power_of_two)); 312 319 320 pos = strstr((const char *)str, "GL_EXT_framebuffer_object"); 321 m_GL_EXT_framebuffer_object = pos != NULL; 322 VBOXQGLLOGREL (("GL_EXT_framebuffer_object: %d\n", m_GL_EXT_framebuffer_object)); 323 324 313 325 initExtSupport(*pContext); 314 326 } … … 474 486 475 487 mFragmentShaderSupported = true; 488 } while(0); 489 490 do 491 { 492 rc = 0; 493 mFBOSupported = false; 494 495 if(m_GL_EXT_framebuffer_object) 496 { 497 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_IS_FRAMEBUFFER, IsFramebuffer, rc); 498 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_BIND_FRAMEBUFFER, BindFramebuffer, rc); 499 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_DELETE_FRAMEBUFFERS, DeleteFramebuffers, rc); 500 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_GEN_FRAMEBUFFERS, GenFramebuffers, rc); 501 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS, CheckFramebufferStatus, rc); 502 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D, FramebufferTexture1D, rc); 503 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D, FramebufferTexture2D, rc); 504 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D, FramebufferTexture3D, rc); 505 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV, GetFramebufferAttachmentParameteriv, rc); 506 } 507 else 508 { 509 break; 510 } 511 512 if(RT_FAILURE(rc)) 513 break; 514 515 mFBOSupported = true; 476 516 } while(0); 477 517
Note:
See TracChangeset
for help on using the changeset viewer.