Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/display/frameBufferProperties.h

Go to the documentation of this file.
00001 // Filename: frameBufferProperties.h
00002 // Created by:  drose (27Jan03)
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 FRAMEBUFFERPROPERTIES_H
00020 #define FRAMEBUFFERPROPERTIES_H
00021 
00022 #include "pandabase.h"
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : FrameBufferProperties
00026 // Description : A container for the various kinds of properties we
00027 //               might ask to have on a graphics frameBuffer before we
00028 //               create a GSG.
00029 ////////////////////////////////////////////////////////////////////
00030 class EXPCL_PANDA FrameBufferProperties {
00031 PUBLISHED:
00032   FrameBufferProperties();
00033   INLINE FrameBufferProperties(const FrameBufferProperties &copy);
00034   void operator = (const FrameBufferProperties &copy);
00035   INLINE ~FrameBufferProperties();
00036 
00037   bool operator == (const FrameBufferProperties &other) const;
00038   INLINE bool operator != (const FrameBufferProperties &other) const;
00039 
00040   enum FrameBufferMode {
00041     FM_rgba =          0x0000,
00042     FM_rgb =           0x0000,
00043     FM_index =         0x0001,
00044     FM_single_buffer = 0x0000,
00045     FM_double_buffer = 0x0002,
00046     FM_triple_buffer = 0x0004,
00047     FM_accum =         0x0008,
00048     FM_alpha =         0x0010,
00049     FM_depth =         0x0020,
00050     FM_stencil =       0x0040,
00051     FM_multisample =   0x0080,
00052     FM_stereo =        0x0100,
00053     FM_luminance =     0x0200,
00054   };
00055 
00056   void clear();
00057   INLINE bool is_any_specified() const;
00058 
00059   INLINE void set_frame_buffer_mode(int frameBuffer_mode);
00060   INLINE int get_frame_buffer_mode() const;
00061   INLINE bool has_frame_buffer_mode() const;
00062   INLINE void clear_frame_buffer_mode();
00063 
00064   INLINE void set_depth_bits(int depth_bits);
00065   INLINE int get_depth_bits() const;
00066   INLINE bool has_depth_bits() const;
00067   INLINE void clear_depth_bits();
00068 
00069   INLINE void set_color_bits(int color_bits);
00070   INLINE int get_color_bits() const;
00071   INLINE bool has_color_bits() const;
00072   INLINE void clear_color_bits();
00073 
00074   void add_properties(const FrameBufferProperties &other);
00075 
00076   void output(ostream &out) const;
00077   
00078 private:
00079   // This bitmask indicates which of the parameters in the properties
00080   // structure have been filled in by the user, and which remain
00081   // unspecified.
00082   enum Specified {
00083     S_frame_buffer_mode = 0x0200,
00084     S_depth_bits        = 0x0400,
00085     S_color_bits        = 0x0800,
00086   };
00087 
00088   // This bitmask represents the true/false settings for various
00089   // boolean flags (assuming the corresponding S_* bit has been set,
00090   // above).
00091   /*
00092   enum Flags {
00093   };
00094   */
00095 
00096   int _specified;
00097   int _flags;
00098   int _frame_buffer_mode;
00099   int _depth_bits;
00100   int _color_bits;
00101 };
00102 
00103 INLINE ostream &operator << (ostream &out, const FrameBufferProperties &properties);
00104 
00105 #include "frameBufferProperties.I"
00106 
00107 #endif

Generated on Fri May 2 00:36:22 2003 for Panda by doxygen1.3