00001 // Filename: savedFrameBuffer.h 00002 // Created by: drose (06Oct99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef SAVEDFRAMEBUFFER_H 00020 #define SAVEDFRAMEBUFFER_H 00021 00022 #include <pandabase.h> 00023 00024 #include "renderBuffer.h" 00025 #include "displayRegion.h" 00026 00027 #include <typedReferenceCount.h> 00028 #include <pointerTo.h> 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Class : SavedFrameBuffer 00032 // Description : Occasionally we need to save the contents of the 00033 // frame buffer for restoring later, particularly when 00034 // we are doing multipass effects. The precise form in 00035 // which the frame buffer is optimally saved may vary 00036 // from one platform to another; hence, we have the 00037 // SavedFrameBuffer class, which is a placeholder 00038 // structure to store the frame buffer in whichever way 00039 // a particular GSG would prefer to do it. 00040 // 00041 // Each specific GSG will also derive a new kind of 00042 // SavedFrameBuffer object that it will use to store its 00043 // frame buffer contents meaningfully. 00044 // 00045 // This class is not meant to be used directly; it is 00046 // used within the FrameBufferStack class to support 00047 // GraphicsStateGuardian::push_frame_buffer() and 00048 // pop_frame_buffer(). 00049 //////////////////////////////////////////////////////////////////// 00050 class EXPCL_PANDA SavedFrameBuffer : public TypedReferenceCount { 00051 public: 00052 INLINE SavedFrameBuffer(const RenderBuffer &buffer, 00053 CPT(DisplayRegion) dr); 00054 00055 RenderBuffer _buffer; 00056 CPT(DisplayRegion) _display_region; 00057 00058 00059 public: 00060 static TypeHandle get_class_type() { 00061 return _type_handle; 00062 } 00063 static void init_type() { 00064 TypedReferenceCount::init_type(); 00065 register_type(_type_handle, "SavedFrameBuffer", 00066 TypedReferenceCount::get_class_type()); 00067 } 00068 virtual TypeHandle get_type() const { 00069 return get_class_type(); 00070 } 00071 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00072 00073 private: 00074 static TypeHandle _type_handle; 00075 }; 00076 00077 #include "savedFrameBuffer.I" 00078 00079 #endif 00080