Equalizer  1.2.1
client/windowPackets.h
00001 
00002 /* Copyright (c) 2005-2011, Stefan Eilemann <eile@equalizergraphics.com>
00003  *                    2010, Cedric Stalder  <cedric.stalder@gmail.com>
00004  *
00005  * This library is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Lesser General Public License version 2.1 as published
00007  * by the Free Software Foundation.
00008  *  
00009  * This library is distributed in the hope that it will be useful, but WITHOUT
00010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00012  * details.
00013  * 
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this library; if not, write to the Free Software Foundation, Inc.,
00016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00017  */
00018 
00019 #ifndef EQ_WINDOWPACKETS_H
00020 #define EQ_WINDOWPACKETS_H
00021 
00022 #include <eq/client/packets.h> // base structs
00023 
00025 namespace eq
00026 {
00027     struct WindowConfigInitPacket : public WindowPacket
00028     {
00029         WindowConfigInitPacket()
00030             {
00031                 command = fabric::CMD_WINDOW_CONFIG_INIT;
00032                 size    = sizeof( WindowConfigInitPacket );
00033             }
00034 
00035         uint128_t       initID;
00036     };
00037 
00038     struct WindowConfigInitReplyPacket : public WindowPacket
00039     {
00040         WindowConfigInitReplyPacket()
00041             {
00042                 command   = fabric::CMD_WINDOW_CONFIG_INIT_REPLY;
00043                 size      = sizeof( WindowConfigInitReplyPacket );
00044             }
00045 
00046         bool           result;
00047     };
00048 
00049     struct WindowConfigExitPacket : public WindowPacket
00050     {
00051         WindowConfigExitPacket()
00052             {
00053                 command = fabric::CMD_WINDOW_CONFIG_EXIT;
00054                 size    = sizeof( WindowConfigExitPacket );
00055             }
00056     };
00057 
00058     struct WindowConfigExitReplyPacket : public WindowPacket
00059     {
00060         WindowConfigExitReplyPacket( const co::base::UUID& windowID, const bool res )
00061                 : result( res )
00062             {
00063                 command   = fabric::CMD_WINDOW_CONFIG_EXIT_REPLY;
00064                 size      = sizeof( WindowConfigExitReplyPacket );
00065                 objectID  = windowID;
00066             }
00067 
00068         const bool result;
00069     };
00070 
00071     struct WindowCreateChannelPacket : public WindowPacket
00072     {
00073         WindowCreateChannelPacket( const UUID& id )
00074                 : channelID( id )
00075             {
00076                 command = fabric::CMD_WINDOW_CREATE_CHANNEL;
00077                 size    = sizeof( WindowCreateChannelPacket );
00078             }
00079 
00080         const UUID channelID;
00081     };
00082 
00083     struct WindowDestroyChannelPacket : public WindowPacket
00084     {
00085         WindowDestroyChannelPacket( const co::base::UUID& channelID_ )
00086                 : channelID( channelID_ )
00087             {
00088                 command = fabric::CMD_WINDOW_DESTROY_CHANNEL;
00089                 size    = sizeof( WindowDestroyChannelPacket );
00090             }
00091 
00092         const co::base::UUID channelID;
00093     };
00094 
00095     struct WindowFinishPacket : public WindowPacket
00096     {
00097         WindowFinishPacket()
00098             {
00099                 command = fabric::CMD_WINDOW_FINISH;
00100                 size    = sizeof( WindowFinishPacket );
00101             }
00102     };
00103 
00104     struct WindowThrottleFramerate : public WindowPacket
00105     {
00106         WindowThrottleFramerate()
00107         {
00108             command = fabric::CMD_WINDOW_THROTTLE_FRAMERATE;
00109             size    = sizeof( WindowThrottleFramerate );
00110         }
00111         float    minFrameTime; // in ms
00112     };
00113     
00114     struct WindowBarrierPacket : public WindowPacket
00115     {
00116         WindowBarrierPacket()
00117             {
00118                 command = fabric::CMD_WINDOW_BARRIER;
00119                 size    = sizeof( WindowBarrierPacket );
00120             }
00121         co::ObjectVersion barrier;
00122     };
00123     
00124     struct WindowNVBarrierPacket : public WindowPacket
00125     {
00126         WindowNVBarrierPacket()
00127             {
00128                 command = fabric::CMD_WINDOW_NV_BARRIER;
00129                 size    = sizeof( WindowNVBarrierPacket );
00130             }
00131 
00132         co::ObjectVersion netBarrier;
00133         uint32_t group;
00134         uint32_t barrier;
00135     };
00136 
00137     struct WindowSwapPacket : public WindowPacket
00138     {
00139         WindowSwapPacket()
00140             {
00141                 command = fabric::CMD_WINDOW_SWAP;
00142                 size    = sizeof( WindowSwapPacket );
00143             }
00144     };
00145 
00146     struct WindowFrameStartPacket : public WindowPacket
00147     {
00148         WindowFrameStartPacket()
00149             {
00150                 command        = fabric::CMD_WINDOW_FRAME_START;
00151                 size           = sizeof( WindowFrameStartPacket );
00152             }
00153 
00154         uint128_t version;
00155         uint128_t frameID;
00156         uint32_t frameNumber;
00157     };
00158 
00159     struct WindowFrameFinishPacket : public WindowPacket
00160     {
00161         WindowFrameFinishPacket()
00162             {
00163                 command        = fabric::CMD_WINDOW_FRAME_FINISH;
00164                 size           = sizeof( WindowFrameFinishPacket );
00165             }
00166 
00167         uint128_t frameID;
00168         uint32_t frameNumber;
00169     };
00170         
00171     struct WindowFrameDrawFinishPacket : public WindowPacket
00172     {
00173         WindowFrameDrawFinishPacket()
00174             {
00175                 command       = fabric::CMD_WINDOW_FRAME_DRAW_FINISH;
00176                 size          = sizeof( WindowFrameDrawFinishPacket );
00177             }
00178         uint128_t frameID;
00179         uint32_t frameNumber;
00180     };
00181 
00182     inline std::ostream& operator << ( std::ostream& os, 
00183                                        const WindowCreateChannelPacket* packet )
00184     {
00185         os << (co::ObjectPacket*)packet << " id " << packet->channelID;
00186         return os;
00187     }
00188     inline std::ostream& operator << ( std::ostream& os, 
00189                                       const WindowDestroyChannelPacket* packet )
00190     {
00191         os << (co::ObjectPacket*)packet << " id " << packet->channelID;
00192         return os;
00193     }
00194     inline std::ostream& operator << ( std::ostream& os, 
00195                                        const WindowFrameStartPacket* packet )
00196     {
00197         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00198            << " id " << packet->frameID;
00199         return os;
00200     }
00201     inline std::ostream& operator << ( std::ostream& os, 
00202                                      const WindowFrameDrawFinishPacket* packet )
00203     {
00204         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00205            << " id " << packet->frameID;
00206         return os;
00207     }
00208     inline std::ostream& operator << ( std::ostream& os, 
00209                                        const WindowBarrierPacket* packet )
00210     {
00211         os << (co::ObjectPacket*)packet << " barrier " << packet->barrier;
00212         return os;
00213     }
00214 }
00216 #endif //EQ_WINDOWPACKETS_H
Generated on Fri Jun 8 2012 15:44:33 for Equalizer 1.2.1 by  doxygen 1.8.0