Basic Image AlgorithmS Library 2.8.0

ContextPBuffer.cpp

00001 #include <GLviewer/ContextPBuffer.hh>
00002 
00003 #include <OpenGLFramework/Base/glfException.hh>
00004 
00005 using namespace std;
00006 using namespace BIAS;
00007 using namespace BIAS;
00008 
00009 
00010 int ContextPBuffer::
00011 Init(unsigned int width, unsigned int height, 
00012      unsigned int RBits, unsigned int GBits, unsigned int BBits,
00013      unsigned int ABits, unsigned int DepthBits, unsigned int StencilBits)
00014 {
00015   glfRenderingContextConfig cfg;
00016   cfg.width         = width;                  
00017   cfg.height        = height;
00018   cfg.doubleBuffer  = 0;
00019   cfg.redSize       = RBits;
00020   cfg.greenSize     = GBits;
00021   cfg.blueSize      = BBits;
00022   cfg.alphaSize     = ABits;
00023   cfg.depthSize     = DepthBits;
00024   cfg.stencilSize   = StencilBits;
00025 
00026   try {
00027     glfPBuffer::Init(cfg);
00028   } catch (glfException& e) {
00029     std::cout << "Error: " << e.GetMessageString() << std::endl;
00030     return -1;
00031   } 
00032   return 0;
00033 }
00034 
00035 
00036 int ContextPBuffer::
00037 Render() {
00038   MakeCurrent();
00039   int res =RenderContextBase::Render();
00040   glFinish(); 
00041   return res;
00042 }
00043 
00044 
00045 int ContextPBuffer::
00046 GetImage(BIAS::Image<unsigned char>& Image) 
00047 {
00048   MakeCurrent();
00049   RenderContextBase::GetImage(Image);
00050   glFinish();
00051   return 0;
00052 }
00053 
00054 int ContextPBuffer::
00055 GetDepthMap(BIAS::Image<float>& Image, const float invalid)
00056 {
00057   MakeCurrent();
00058   int res = RenderContextBase::GetDepthMap(Image, invalid);
00059   glFinish();
00060   return res;
00061 }
00062 
00063 int ContextPBuffer::
00064 GetMetricZMap(BIAS::Image<float>& Image, const float invalid)
00065 {
00066   MakeCurrent();
00067   int res = RenderContextBase::GetMetricZMap(Image, invalid);
00068   glFinish();
00069   return res;
00070 }
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends