Equalizer
1.4.1
|
00001 00002 /* Copyright (c) 2005-2012, 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 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 UUID& channelID_ ) 00086 : channelID( channelID_ ) 00087 { 00088 command = fabric::CMD_WINDOW_DESTROY_CHANNEL; 00089 size = sizeof( WindowDestroyChannelPacket ); 00090 } 00091 00092 const UUID channelID; 00093 }; 00094 00095 struct WindowFlushPacket : public WindowPacket 00096 { 00097 WindowFlushPacket() 00098 { 00099 command = fabric::CMD_WINDOW_FLUSH; 00100 size = sizeof( WindowFlushPacket ); 00101 } 00102 }; 00103 00104 struct WindowFinishPacket : public WindowPacket 00105 { 00106 WindowFinishPacket() 00107 { 00108 command = fabric::CMD_WINDOW_FINISH; 00109 size = sizeof( WindowFinishPacket ); 00110 } 00111 }; 00112 00113 struct WindowThrottleFramerate : public WindowPacket 00114 { 00115 WindowThrottleFramerate() 00116 { 00117 command = fabric::CMD_WINDOW_THROTTLE_FRAMERATE; 00118 size = sizeof( WindowThrottleFramerate ); 00119 } 00120 float minFrameTime; // in ms 00121 }; 00122 00123 struct WindowBarrierPacket : public WindowPacket 00124 { 00125 WindowBarrierPacket() 00126 { 00127 command = fabric::CMD_WINDOW_BARRIER; 00128 size = sizeof( WindowBarrierPacket ); 00129 } 00130 co::ObjectVersion barrier; 00131 }; 00132 00133 struct WindowNVBarrierPacket : public WindowPacket 00134 { 00135 WindowNVBarrierPacket() 00136 { 00137 command = fabric::CMD_WINDOW_NV_BARRIER; 00138 size = sizeof( WindowNVBarrierPacket ); 00139 } 00140 00141 co::ObjectVersion netBarrier; 00142 uint32_t group; 00143 uint32_t barrier; 00144 }; 00145 00146 struct WindowSwapPacket : public WindowPacket 00147 { 00148 WindowSwapPacket() 00149 { 00150 command = fabric::CMD_WINDOW_SWAP; 00151 size = sizeof( WindowSwapPacket ); 00152 } 00153 }; 00154 00155 struct WindowFrameStartPacket : public WindowPacket 00156 { 00157 WindowFrameStartPacket() 00158 { 00159 command = fabric::CMD_WINDOW_FRAME_START; 00160 size = sizeof( WindowFrameStartPacket ); 00161 } 00162 00163 uint128_t version; 00164 uint128_t frameID; 00165 uint32_t frameNumber; 00166 }; 00167 00168 struct WindowFrameFinishPacket : public WindowPacket 00169 { 00170 WindowFrameFinishPacket() 00171 { 00172 command = fabric::CMD_WINDOW_FRAME_FINISH; 00173 size = sizeof( WindowFrameFinishPacket ); 00174 } 00175 00176 uint128_t frameID; 00177 uint32_t frameNumber; 00178 }; 00179 00180 struct WindowFrameDrawFinishPacket : public WindowPacket 00181 { 00182 WindowFrameDrawFinishPacket() 00183 { 00184 command = fabric::CMD_WINDOW_FRAME_DRAW_FINISH; 00185 size = sizeof( WindowFrameDrawFinishPacket ); 00186 } 00187 uint128_t frameID; 00188 uint32_t frameNumber; 00189 }; 00190 00191 inline std::ostream& operator << ( std::ostream& os, 00192 const WindowCreateChannelPacket* packet ) 00193 { 00194 os << (co::ObjectPacket*)packet << " id " << packet->channelID; 00195 return os; 00196 } 00197 inline std::ostream& operator << ( std::ostream& os, 00198 const WindowDestroyChannelPacket* packet ) 00199 { 00200 os << (co::ObjectPacket*)packet << " id " << packet->channelID; 00201 return os; 00202 } 00203 inline std::ostream& operator << ( std::ostream& os, 00204 const WindowFrameStartPacket* packet ) 00205 { 00206 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber 00207 << " id " << packet->frameID; 00208 return os; 00209 } 00210 inline std::ostream& operator << ( std::ostream& os, 00211 const WindowFrameDrawFinishPacket* packet ) 00212 { 00213 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber 00214 << " id " << packet->frameID; 00215 return os; 00216 } 00217 inline std::ostream& operator << ( std::ostream& os, 00218 const WindowBarrierPacket* packet ) 00219 { 00220 os << (co::ObjectPacket*)packet << " barrier " << packet->barrier; 00221 return os; 00222 } 00223 } 00225 #endif //EQ_WINDOWPACKETS_H