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