00001 // This is core/vgui/internals/vgui_accelerate.h 00002 #ifndef vgui_accelerate_h_ 00003 #define vgui_accelerate_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \author David Capel, Robotics Research Group, University of Oxford 00010 // \date 1 April 2000 00011 // \brief (Potentially) Accelerated functions 00012 // 00013 // \verbatim 00014 // Modifications 00015 // 01-APR-2000 initial version 00016 // 10-JUL-2000 Marko Bacic, Oxford RRG - Speeded up rendering on Mesa by using GL_RGB instead of GL_RGBA 00017 // Feb.2002 - Peter Vanroose - brief doxygen comment placed on single line 00018 // July 2003 - Mark Johnson - set vgui_mvc_acceleration to false by default; conflicts with overlays 00019 // \endverbatim 00020 00021 #include <vgui/vgui_gl.h> 00022 00023 //: (Potentially) Accelerated functions for OpenGL. 00024 class vgui_accelerate 00025 { 00026 public: 00027 //: Set to true for no acceleration. 00028 static bool vgui_no_acceleration; 00029 00030 //: Set to true to use MFC acceleration. 00031 static bool vgui_mfc_acceleration; 00032 00033 //: Sometimes double buffering needs to be switched off on windows. 00034 static bool vgui_doublebuffer; 00035 00036 //: Singleton instance of this class. 00037 static vgui_accelerate* instance(); 00038 00039 //: Destructor. 00040 virtual ~vgui_accelerate() {} 00041 00042 //: OpenGL clearing. 00043 virtual bool vgui_glClear( GLbitfield mask ); 00044 00045 //: Set the OpenGL cache format. 00046 // If you pass stuff to vgui_glDrawPixels, and the format and type are what 00047 // you got from an earlier call to this baby, then it might go faster. 00048 virtual bool vgui_choose_cache_format( GLenum* format, GLenum* type); 00049 00050 //: Fast-as-we-can version of drawpixels. 00051 virtual bool vgui_glDrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); 00052 00053 //: For X11/Mesa - copy back buffer to auxiliary buffer. 00054 // This function is used in X11/Mesa to speed up overlay emulation. It 00055 // returns false to indicate to overlay_biscuit that a default emulation 00056 // must be used. 00057 virtual bool vgui_copy_back_to_aux(); 00058 00059 //: For X11/Mesa - copy auxiliary buffer to back buffer. 00060 // This function is used in X11/Mesa to speed up overlay emulation. It 00061 // returns false to indicate to overlay_biscuit that a default emulation 00062 // must be used. 00063 virtual bool vgui_copy_aux_to_back(); 00064 00065 //: If level is higher than current level, then change to given accelerator. 00066 static void register_accelerator (vgui_accelerate* p, int level); 00067 00068 protected: 00069 vgui_accelerate() {} 00070 }; 00071 00072 #endif // vgui_accelerate_h_