client/packets.h

00001 
00002 /* Copyright (c) 2005-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQ_PACKETS_H
00019 #define EQ_PACKETS_H
00020 
00021 #include <eq/client/channel.h>       // Channel::IATTR_ALL enum
00022 #include <eq/client/commands.h>
00023 #include <eq/client/node.h>          // Node::IATTR_ALL enum
00024 #include <eq/client/renderContext.h> // member
00025 #include <eq/client/types.h>         // member
00026 #include <eq/client/viewport.h>      // member
00027 #include <eq/client/window.h>        // Window::IATTR_ALL enum
00028 
00029 #include <eq/net/packets.h>
00030 
00031 namespace eq
00032 {
00033     class Pipe;
00034     class Window;
00035 
00037     enum DataType
00038     {
00039         DATATYPE_EQ_CLIENT = net::DATATYPE_EQNET_CUSTOM, // 128
00040         DATATYPE_EQ_SERVER,
00041         DATATYPE_EQ_CUSTOM = 1<<8 // 256
00042     };
00043 
00044     //------------------------------------------------------------
00045     // Client
00046     //------------------------------------------------------------
00047     struct ClientPacket : public net::Packet
00048     {
00049         ClientPacket(){ datatype = DATATYPE_EQ_CLIENT; }
00050     };
00051 
00052     struct ClientExitPacket : public ClientPacket
00053     {
00054         ClientExitPacket()
00055             {
00056                 command = CMD_CLIENT_EXIT;
00057                 size    = sizeof( ClientExitPacket );
00058             }
00059     };
00060 
00061     //------------------------------------------------------------
00062     // Server
00063     //------------------------------------------------------------
00064     struct ServerPacket : public net::Packet
00065     {
00066         ServerPacket(){ datatype = DATATYPE_EQ_SERVER; }
00067     };
00068 
00069     struct ServerChooseConfigPacket : public ServerPacket
00070     {
00071         ServerChooseConfigPacket()
00072             {
00073                 command = CMD_SERVER_CHOOSE_CONFIG;
00074                 size    = sizeof( ServerChooseConfigPacket );
00075                 rendererInfo[0] = '\0';
00076             }
00077 
00078         uint32_t requestID;
00079         EQ_ALIGN8( char rendererInfo[8] );
00080     };
00081 
00082     struct ServerUseConfigPacket : public ServerPacket
00083     {
00084         ServerUseConfigPacket()
00085             {
00086                 command = CMD_SERVER_USE_CONFIG;
00087                 size    = sizeof( ServerChooseConfigPacket );
00088                 configInfo[0] = '\0';
00089             }
00090 
00091         uint32_t requestID;
00092         EQ_ALIGN8( char configInfo[8] );
00093     };
00094 
00095     struct ServerCreateConfigPacket : public ServerPacket
00096     {
00097         ServerCreateConfigPacket()
00098             {
00099                 command   = CMD_SERVER_CREATE_CONFIG;
00100                 size      = sizeof( ServerCreateConfigPacket );
00101                 requestID = EQ_ID_INVALID;
00102                 objectID  = EQ_ID_INVALID;                
00103                 name[0]   = '\0';
00104             }
00105 
00106         uint32_t    configID;
00107         uint32_t    requestID;
00108         uint32_t    objectID;
00109         net::NodeID appNodeID;
00110         EQ_ALIGN8( char name[8] );
00111     };
00112 
00113     struct ServerDestroyConfigPacket : public ServerPacket
00114     {
00115         ServerDestroyConfigPacket()
00116             {
00117                 command = CMD_SERVER_DESTROY_CONFIG;
00118                 size    = sizeof( ServerDestroyConfigPacket );
00119             }
00120 
00121         uint32_t      configID;
00122     };
00123 
00124     struct ServerChooseConfigReplyPacket : public ServerPacket
00125     {
00126         ServerChooseConfigReplyPacket( const ServerChooseConfigPacket*
00127                                        requestPacket )
00128             {
00129                 command   = CMD_SERVER_CHOOSE_CONFIG_REPLY;
00130                 size      = sizeof( ServerChooseConfigReplyPacket );
00131                 requestID = requestPacket->requestID;
00132             }
00133         ServerChooseConfigReplyPacket( const ServerUseConfigPacket*
00134                                        requestPacket )
00135             {
00136                 command   = CMD_SERVER_CHOOSE_CONFIG_REPLY;
00137                 size      = sizeof( ServerChooseConfigReplyPacket );
00138                 requestID = requestPacket->requestID;
00139             }
00140 
00141         uint32_t requestID;
00142         uint32_t configID;
00143     };
00144 
00145     struct ServerReleaseConfigPacket : public ServerPacket
00146     {
00147         ServerReleaseConfigPacket()
00148             {
00149                 command = CMD_SERVER_RELEASE_CONFIG;
00150                 size    = sizeof( ServerReleaseConfigPacket );
00151             }
00152 
00153         uint32_t configID;
00154         uint32_t requestID;
00155     };
00156 
00157     struct ServerReleaseConfigReplyPacket : public ServerPacket
00158     {
00159         ServerReleaseConfigReplyPacket( const ServerReleaseConfigPacket*
00160                                         requestPacket )
00161             {
00162                 command   = CMD_SERVER_RELEASE_CONFIG_REPLY;
00163                 size      = sizeof( ServerReleaseConfigReplyPacket );
00164                 requestID = requestPacket->requestID;
00165             }
00166 
00167         uint32_t requestID;
00168     };
00169 
00170     struct ServerShutdownPacket : public ServerPacket
00171     {
00172         ServerShutdownPacket()
00173             {
00174                 command = CMD_SERVER_SHUTDOWN;
00175                 size    = sizeof( ServerShutdownPacket );
00176             }
00177 
00178         uint32_t requestID;
00179     };
00180 
00181     struct ServerShutdownReplyPacket : public ServerPacket
00182     {
00183         ServerShutdownReplyPacket( const ServerShutdownPacket* requestPacket )
00184             {
00185                 command   = CMD_SERVER_SHUTDOWN_REPLY;
00186                 size      = sizeof( ServerShutdownReplyPacket );
00187                 requestID = requestPacket->requestID;
00188             }
00189 
00190         uint32_t requestID;
00191         bool     result;
00192     };
00193 
00194     //------------------------------------------------------------
00195     // Config
00196     //------------------------------------------------------------
00197     typedef net::SessionPacket ConfigPacket;
00198 
00199     struct ConfigCreateReplyPacket : public ConfigPacket
00200     {
00201         ConfigCreateReplyPacket( const ServerCreateConfigPacket* request )
00202         {
00203             command   = CMD_CONFIG_CREATE_REPLY;
00204             size      = sizeof( ConfigCreateReplyPacket );
00205             sessionID = request->configID;
00206             requestID = request->requestID;
00207         }
00208 
00209         uint32_t requestID;
00210     };
00211 
00212     struct ConfigCreateNodePacket : public ConfigPacket
00213     {
00214         ConfigCreateNodePacket()
00215             {
00216                 command = CMD_CONFIG_CREATE_NODE;
00217                 size    = sizeof( ConfigCreateNodePacket );
00218             }
00219 
00220         uint32_t nodeID;
00221     };
00222 
00223     struct ConfigDestroyNodePacket : public ConfigPacket
00224     {
00225         ConfigDestroyNodePacket()
00226             {
00227                 command = CMD_CONFIG_DESTROY_NODE;
00228                 size    = sizeof( ConfigDestroyNodePacket );
00229             }
00230 
00231         uint32_t nodeID;
00232     };
00233 
00234     struct ConfigInitPacket : public ConfigPacket
00235     {
00236         ConfigInitPacket()
00237             {
00238                 command   = CMD_CONFIG_INIT;
00239                 size      = sizeof( ConfigInitPacket );
00240             }
00241 
00242         uint32_t requestID;
00243         uint32_t initID;
00244     };
00245 
00246     struct ConfigInitReplyPacket : public ConfigPacket
00247     {
00248         ConfigInitReplyPacket( const ConfigInitPacket* requestPacket )
00249             {
00250                 command   = CMD_CONFIG_INIT_REPLY;
00251                 size      = sizeof( ConfigInitReplyPacket );
00252                 requestID = requestPacket->requestID;
00253                 sessionID = requestPacket->sessionID;
00254                 error[0]  = '\0';
00255             }
00256 
00257         uint32_t requestID;
00258         uint32_t configID;
00259         bool     result;
00260         EQ_ALIGN8( char error[8] );
00261     };
00262 
00263     struct ConfigExitPacket : public ConfigPacket
00264     {
00265         ConfigExitPacket()
00266             {
00267                 command   = CMD_CONFIG_EXIT;
00268                 size      = sizeof( ConfigExitPacket );
00269             }
00270         uint32_t requestID;
00271     };
00272 
00273     struct ConfigExitReplyPacket : public ConfigPacket
00274     {
00275         ConfigExitReplyPacket( const ConfigExitPacket* requestPacket )
00276             {
00277                 command   = CMD_CONFIG_EXIT_REPLY;
00278                 size      = sizeof( ConfigExitReplyPacket );
00279                 requestID = requestPacket->requestID;
00280             }
00281         uint32_t requestID;
00282         bool     result;
00283     };
00284 
00285     struct ConfigStartFramePacket : public ConfigPacket
00286     {
00287         ConfigStartFramePacket()
00288             {
00289                 command   = CMD_CONFIG_START_FRAME;
00290                 size      = sizeof( ConfigStartFramePacket );
00291             }
00292         uint32_t frameID;
00293         uint32_t nChanges;
00294         EQ_ALIGN8( net::ObjectVersion changes[1] );
00295     };
00296 
00297     struct ConfigReleaseFrameLocalPacket : public ConfigPacket
00298     {
00299         ConfigReleaseFrameLocalPacket()
00300             {
00301                 command       = CMD_CONFIG_RELEASE_FRAME_LOCAL;
00302                 size          = sizeof( ConfigReleaseFrameLocalPacket );
00303             }
00304         uint32_t frameNumber;
00305     };
00306 
00307     struct ConfigFrameFinishPacket : public ConfigPacket
00308     {
00309         ConfigFrameFinishPacket()
00310             {
00311                 command     = CMD_CONFIG_FRAME_FINISH;
00312                 size        = sizeof( ConfigFrameFinishPacket );
00313             }
00314         uint32_t frameNumber;
00315     };
00316 
00317     struct ConfigFinishAllFramesPacket : public ConfigPacket
00318     {
00319         ConfigFinishAllFramesPacket()
00320             {
00321                 command   = CMD_CONFIG_FINISH_ALL_FRAMES;
00322                 size      = sizeof( ConfigFinishAllFramesPacket );
00323             }
00324     };
00325 
00326     struct ConfigFreezeLoadBalancingPacket : public ConfigPacket
00327     {
00328         ConfigFreezeLoadBalancingPacket()
00329             {
00330                 command = CMD_CONFIG_FREEZE_LOAD_BALANCING;
00331                 size    = sizeof( ConfigFreezeLoadBalancingPacket );
00332             }
00333         bool freeze;
00334     };
00335 
00336     struct ConfigSyncClockPacket : public ConfigPacket
00337     {
00338         ConfigSyncClockPacket()
00339             {
00340                 command       = CMD_CONFIG_SYNC_CLOCK;
00341                 size          = sizeof( ConfigSyncClockPacket );
00342             }
00343 
00344         int64_t time;
00345     };
00346 
00347     struct ConfigUnmapPacket : public ConfigPacket
00348     {
00349         ConfigUnmapPacket()
00350             {
00351                 command       = CMD_CONFIG_UNMAP;
00352                 size          = sizeof( ConfigUnmapPacket );
00353             }
00354 
00355         uint32_t requestID;
00356     };
00357 
00358     struct ConfigUnmapReplyPacket : public ConfigPacket
00359     {
00360         ConfigUnmapReplyPacket( const ConfigUnmapPacket* request )
00361             {
00362                 command       = CMD_CONFIG_UNMAP_REPLY;
00363                 size          = sizeof( ConfigUnmapReplyPacket );
00364                 requestID     = request->requestID;
00365             }
00366 
00367         uint32_t requestID;
00368     };
00369 
00370     //------------------------------------------------------------
00371     // Node
00372     //------------------------------------------------------------
00373     struct NodeConfigInitPacket : public net::ObjectPacket
00374     {
00375         NodeConfigInitPacket()
00376             {
00377                 command        = CMD_NODE_CONFIG_INIT;
00378                 size           = sizeof( NodeConfigInitPacket );
00379                 name[0]        = '\0';
00380             }
00381 
00382         uint32_t initID;
00383         uint32_t frameNumber;
00384         int32_t  iAttributes[ eq::Node::IATTR_ALL ];
00385         int32_t  tasks;
00386         EQ_ALIGN8( char name[8] );
00387     };
00388 
00389     struct NodeConfigInitReplyPacket : public net::ObjectPacket
00390     {
00391         NodeConfigInitReplyPacket()
00392             {
00393                 command   = CMD_NODE_CONFIG_INIT_REPLY;
00394                 size      = sizeof( NodeConfigInitReplyPacket );
00395                 error[0]  = '\0';
00396             }
00397 
00398         int32_t  iAttributes[ eq::Node::IATTR_ALL ];
00399         bool     result;
00400         EQ_ALIGN8( char error[8] );
00401     };
00402 
00403     struct NodeConfigExitPacket : public net::ObjectPacket
00404     {
00405         NodeConfigExitPacket()
00406             {
00407                 command = CMD_NODE_CONFIG_EXIT;
00408                 size    = sizeof( NodeConfigExitPacket );
00409             }
00410     };
00411 
00412     struct NodeConfigExitReplyPacket : public net::ObjectPacket
00413     {
00414         NodeConfigExitReplyPacket()
00415             {
00416                 command   = CMD_NODE_CONFIG_EXIT_REPLY;
00417                 size      = sizeof( NodeConfigExitReplyPacket );
00418             }
00419 
00420         bool     result;
00421     };
00422 
00423     struct NodeCreatePipePacket : public net::ObjectPacket
00424     {
00425         NodeCreatePipePacket()
00426             {
00427                 command = CMD_NODE_CREATE_PIPE;
00428                 size    = sizeof( NodeCreatePipePacket );
00429             }
00430 
00431         uint32_t pipeID;
00432         bool     threaded;
00433     };
00434 
00435     struct NodeDestroyPipePacket : public net::ObjectPacket
00436     {
00437         NodeDestroyPipePacket()
00438             {
00439                 command = CMD_NODE_DESTROY_PIPE;
00440                 size    = sizeof( NodeDestroyPipePacket );
00441             }
00442 
00443         uint32_t pipeID;
00444     };
00445     
00446     struct NodeFrameStartPacket : public net::ObjectPacket
00447     {
00448         NodeFrameStartPacket()
00449             {
00450                 command        = CMD_NODE_FRAME_START;
00451                 size           = sizeof( NodeFrameStartPacket );
00452             }
00453 
00454         uint32_t frameID;
00455         uint32_t frameNumber;
00456     };
00457 
00458     struct NodeFrameFinishPacket : public net::ObjectPacket
00459     {
00460         NodeFrameFinishPacket()
00461             {
00462                 command          = CMD_NODE_FRAME_FINISH;
00463                 size             = sizeof( NodeFrameFinishPacket );
00464             }
00465 
00466         uint32_t frameID;
00467         uint32_t frameNumber;
00468     };
00469 
00470     struct NodeFrameFinishReplyPacket : public net::ObjectPacket
00471     {
00472         NodeFrameFinishReplyPacket()
00473             {
00474                 command        = CMD_NODE_FRAME_FINISH_REPLY;
00475                 size           = sizeof( NodeFrameFinishReplyPacket );
00476             }
00477 
00478         uint32_t frameNumber;
00479     };
00480         
00481     struct NodeFrameDrawFinishPacket : public net::ObjectPacket
00482     {
00483         NodeFrameDrawFinishPacket()
00484             {
00485                 command       = CMD_NODE_FRAME_DRAW_FINISH;
00486                 size          = sizeof( NodeFrameDrawFinishPacket );
00487             }
00488         uint32_t frameID;
00489         uint32_t frameNumber;
00490     };
00491 
00492     struct NodeFrameTasksFinishPacket : public net::ObjectPacket
00493     {
00494         NodeFrameTasksFinishPacket()
00495             {
00496                 command     = CMD_NODE_FRAME_TASKS_FINISH;
00497                 size        = sizeof( NodeFrameTasksFinishPacket );
00498             }
00499 
00500         uint32_t frameID;
00501         uint32_t frameNumber;
00502     };
00503 
00504     //------------------------------------------------------------
00505     // Pipe
00506     //------------------------------------------------------------
00507     struct PipeCreateWindowPacket : public net::ObjectPacket
00508     {
00509         PipeCreateWindowPacket()
00510             {
00511                 command = CMD_PIPE_CREATE_WINDOW;
00512                 size    = sizeof( PipeCreateWindowPacket );
00513             }
00514 
00515         uint32_t windowID;
00516     };
00517 
00518     struct PipeDestroyWindowPacket : public net::ObjectPacket
00519     {
00520         PipeDestroyWindowPacket()
00521             {
00522                 command = CMD_PIPE_DESTROY_WINDOW;
00523                 size    = sizeof( PipeDestroyWindowPacket );
00524             }
00525 
00526         uint32_t windowID;
00527     };
00528 
00529     struct PipeConfigInitPacket : public net::ObjectPacket
00530     {
00531         PipeConfigInitPacket()
00532             {
00533                 command = CMD_PIPE_CONFIG_INIT;
00534                 size    = sizeof( PipeConfigInitPacket );
00535                 name[0] = '\0';
00536             }
00537 
00538         uint32_t      initID;
00539         uint32_t      port;
00540         uint32_t      device;
00541         uint32_t      frameNumber;
00542         int32_t       tasks;
00543         PixelViewport pvp;
00544         EQ_ALIGN8( char name[8] );
00545     };
00546 
00547     struct PipeConfigInitReplyPacket : public net::ObjectPacket
00548     {
00549         PipeConfigInitReplyPacket()
00550             {
00551                 command   = CMD_PIPE_CONFIG_INIT_REPLY;
00552                 size      = sizeof( PipeConfigInitReplyPacket );
00553                 error[0]  = '\0';
00554             }
00555 
00556         bool          result;
00557         PixelViewport pvp;
00558         EQ_ALIGN8( char error[8] );
00559     };
00560 
00561     struct PipeConfigExitPacket : public net::ObjectPacket
00562     {
00563         PipeConfigExitPacket()
00564             {
00565                 command = CMD_PIPE_CONFIG_EXIT;
00566                 size    = sizeof( PipeConfigExitPacket );
00567             }
00568         bool exitThread;
00569     };
00570 
00571     struct PipeConfigExitReplyPacket : public net::ObjectPacket
00572     {
00573         PipeConfigExitReplyPacket()
00574             {
00575                 command   = CMD_PIPE_CONFIG_EXIT_REPLY;
00576                 size      = sizeof( PipeConfigExitReplyPacket );
00577             }
00578 
00579         bool     result;
00580     };
00581 
00582     struct PipeFrameStartClockPacket : public net::ObjectPacket
00583     {
00584         PipeFrameStartClockPacket()
00585             {
00586                 command       = CMD_PIPE_FRAME_START_CLOCK;
00587                 size          = sizeof( PipeFrameStartClockPacket );
00588             }
00589     };
00590 
00591     struct PipeFrameStartPacket : public net::ObjectPacket
00592     {
00593         PipeFrameStartPacket()
00594             {
00595                 command        = CMD_PIPE_FRAME_START;
00596                 size           = sizeof( PipeFrameStartPacket );
00597             }
00598 
00599         uint32_t frameID;
00600         uint32_t frameNumber;
00601     };
00602 
00603     struct PipeFrameFinishPacket : public net::ObjectPacket
00604     {
00605         PipeFrameFinishPacket()
00606             {
00607                 command        = CMD_PIPE_FRAME_FINISH;
00608                 size           = sizeof( PipeFrameFinishPacket );
00609             }
00610 
00611         uint32_t frameID;
00612         uint32_t frameNumber;
00613     };
00614 
00615     struct PipeFrameDrawFinishPacket : public net::ObjectPacket
00616     {
00617         PipeFrameDrawFinishPacket()
00618             {
00619                 command       = CMD_PIPE_FRAME_DRAW_FINISH;
00620                 size          = sizeof( PipeFrameDrawFinishPacket );
00621             }
00622         uint32_t frameID;
00623         uint32_t frameNumber;
00624     };
00625 
00626     //------------------------------------------------------------
00627     // Window
00628     //------------------------------------------------------------
00629     struct WindowConfigInitPacket : public net::ObjectPacket
00630     {
00631         WindowConfigInitPacket()
00632             {
00633                 command = CMD_WINDOW_CONFIG_INIT;
00634                 size    = sizeof( WindowConfigInitPacket );
00635                 name[0] = '\0';
00636             }
00637 
00638         uint32_t       initID;
00639         int32_t        iAttributes[ eq::Window::IATTR_ALL ];
00640         int32_t        tasks;
00641         PixelViewport  pvp;
00642         Viewport       vp;
00643         EQ_ALIGN8( char name[8] );
00644     };
00645 
00646     struct WindowConfigInitReplyPacket : public net::ObjectPacket
00647     {
00648         WindowConfigInitReplyPacket()
00649             {
00650                 command   = CMD_WINDOW_CONFIG_INIT_REPLY;
00651                 size      = sizeof( WindowConfigInitReplyPacket );
00652                 error[0]  = '\0';
00653             }
00654 
00655         PixelViewport           pvp;
00656         Window::DrawableConfig  drawableConfig;
00657         bool                    result;
00658         EQ_ALIGN8( char error[8] );
00659     };
00660 
00661     struct WindowConfigExitPacket : public net::ObjectPacket
00662     {
00663         WindowConfigExitPacket()
00664             {
00665                 command = CMD_WINDOW_CONFIG_EXIT;
00666                 size    = sizeof( WindowConfigExitPacket );
00667             }
00668     };
00669 
00670     struct WindowConfigExitReplyPacket : public net::ObjectPacket
00671     {
00672         WindowConfigExitReplyPacket()
00673             {
00674                 command   = CMD_WINDOW_CONFIG_EXIT_REPLY;
00675                 size      = sizeof( WindowConfigExitReplyPacket );
00676             }
00677 
00678         bool     result;
00679     };
00680 
00681     struct WindowCreateChannelPacket : public net::ObjectPacket
00682     {
00683         WindowCreateChannelPacket()
00684             {
00685                 command = CMD_WINDOW_CREATE_CHANNEL;
00686                 size    = sizeof( WindowCreateChannelPacket );
00687             }
00688 
00689         uint32_t channelID;
00690     };
00691 
00692     struct WindowDestroyChannelPacket : public net::ObjectPacket
00693     {
00694         WindowDestroyChannelPacket()
00695             {
00696                 command = CMD_WINDOW_DESTROY_CHANNEL;
00697                 size    = sizeof( WindowDestroyChannelPacket );
00698             }
00699 
00700         uint32_t channelID;
00701     };
00702 
00703     struct WindowSetPVPPacket : public net::ObjectPacket
00704     {
00705         WindowSetPVPPacket()
00706             {
00707                 command = CMD_WINDOW_SET_PVP;
00708                 size    = sizeof( WindowSetPVPPacket );
00709             }
00710 
00711         PixelViewport pvp;
00712     };
00713 
00714     struct WindowFinishPacket : public net::ObjectPacket
00715     {
00716         WindowFinishPacket()
00717             {
00718                 command = CMD_WINDOW_FINISH;
00719                 size    = sizeof( WindowFinishPacket );
00720             }
00721     };
00722 
00723     struct WindowThrottleFramerate : public net::ObjectPacket
00724     {
00725         WindowThrottleFramerate()
00726         {
00727             command = CMD_WINDOW_THROTTLE_FRAMERATE;
00728             size    = sizeof( WindowThrottleFramerate );
00729         }
00730         float    minFrameTime; // in ms
00731     };
00732     
00733     struct WindowBarrierPacket : public net::ObjectPacket
00734     {
00735         WindowBarrierPacket()
00736             {
00737                 command = CMD_WINDOW_BARRIER;
00738                 size    = sizeof( WindowBarrierPacket );
00739             }
00740         net::ObjectVersion barrier;
00741     };
00742     
00743     struct WindowNVBarrierPacket : public net::ObjectPacket
00744     {
00745         WindowNVBarrierPacket()
00746             {
00747                 command = CMD_WINDOW_NV_BARRIER;
00748                 size    = sizeof( WindowNVBarrierPacket );
00749             }
00750 
00751         uint32_t group;
00752         uint32_t barrier;
00753         net::ObjectVersion netBarrier;
00754     };
00755 
00756     struct WindowSwapPacket : public net::ObjectPacket
00757     {
00758         WindowSwapPacket()
00759             {
00760                 command = CMD_WINDOW_SWAP;
00761                 size    = sizeof( WindowSwapPacket );
00762             }
00763     };
00764 
00765     struct WindowFrameStartPacket : public net::ObjectPacket
00766     {
00767         WindowFrameStartPacket()
00768             {
00769                 command        = CMD_WINDOW_FRAME_START;
00770                 size           = sizeof( WindowFrameStartPacket );
00771             }
00772 
00773         uint32_t frameID;
00774         uint32_t frameNumber;
00775     };
00776 
00777     struct WindowFrameFinishPacket : public net::ObjectPacket
00778     {
00779         WindowFrameFinishPacket()
00780             {
00781                 command        = CMD_WINDOW_FRAME_FINISH;
00782                 size           = sizeof( WindowFrameFinishPacket );
00783             }
00784 
00785         uint32_t frameID;
00786         uint32_t frameNumber;
00787     };
00788         
00789     struct WindowFrameDrawFinishPacket : public net::ObjectPacket
00790     {
00791         WindowFrameDrawFinishPacket()
00792             {
00793                 command       = CMD_WINDOW_FRAME_DRAW_FINISH;
00794                 size          = sizeof( WindowFrameDrawFinishPacket );
00795             }
00796         uint32_t frameID;
00797         uint32_t frameNumber;
00798     };
00799 
00800     //------------------------------------------------------------
00801     // Channel
00802     //------------------------------------------------------------
00803     struct ChannelConfigInitPacket : public net::ObjectPacket
00804     {
00805         ChannelConfigInitPacket()
00806             {
00807                 command = CMD_CHANNEL_CONFIG_INIT;
00808                 size    = sizeof( ChannelConfigInitPacket );
00809                 name[0] = '\0';
00810             }
00811 
00812         uint32_t        initID;
00813         uint32_t        drawable;
00814         int32_t         iAttributes[ eq::Channel::IATTR_ALL ];
00815         int32_t         tasks;
00816         PixelViewport   pvp;
00817         Viewport        vp;
00818         Vector3ub color;
00819         net::ObjectVersion view;
00820         EQ_ALIGN8( char name[8] );
00821     };
00822 
00823     struct ChannelConfigInitReplyPacket : public net::ObjectPacket
00824     {
00825         ChannelConfigInitReplyPacket()
00826             {
00827                 command   = CMD_CHANNEL_CONFIG_INIT_REPLY;
00828                 size      = sizeof( ChannelConfigInitReplyPacket );
00829                 error[0]  = '\0';
00830             }
00831 
00832         Vector2i maxSize;
00833         float    nearPlane;
00834         float    farPlane;
00835         bool     result;
00836         EQ_ALIGN8( char error[8] );
00837     };
00838 
00839     struct ChannelConfigExitPacket : public net::ObjectPacket
00840     {
00841         ChannelConfigExitPacket()
00842             {
00843                 command = CMD_CHANNEL_CONFIG_EXIT;
00844                 size    = sizeof( ChannelConfigExitPacket );
00845             }
00846     };
00847 
00848     struct ChannelConfigExitReplyPacket : public net::ObjectPacket
00849     {
00850         ChannelConfigExitReplyPacket()
00851             {
00852                 command   = CMD_CHANNEL_CONFIG_EXIT_REPLY;
00853                 size      = sizeof( ChannelConfigExitReplyPacket );
00854             }
00855 
00856         bool     result;
00857     };
00858 
00859     struct ChannelSetNearFarPacket : public net::ObjectPacket
00860     {
00861         ChannelSetNearFarPacket()
00862             {
00863                 command   = CMD_CHANNEL_SET_NEARFAR;
00864                 size      = sizeof( ChannelSetNearFarPacket );
00865             }
00866 
00867         float    nearPlane;
00868         float    farPlane;
00869     };
00870 
00871     struct ChannelTaskPacket : public net::ObjectPacket
00872     {
00873         RenderContext context;
00874     };
00875 
00876     struct ChannelFrameStartPacket : public ChannelTaskPacket
00877     {
00878         ChannelFrameStartPacket()
00879             {
00880                 command        = CMD_CHANNEL_FRAME_START;
00881                 size           = sizeof( ChannelFrameStartPacket );
00882             }
00883 
00884         uint32_t frameNumber;
00885     };
00886 
00887     struct ChannelFrameFinishPacket : public ChannelTaskPacket
00888     {
00889         ChannelFrameFinishPacket()
00890             {
00891                 command        = CMD_CHANNEL_FRAME_FINISH;
00892                 size           = sizeof( ChannelFrameFinishPacket );
00893             }
00894 
00895         uint32_t frameNumber;
00896     };
00897 
00898     struct ChannelFrameFinishReplyPacket : public net::ObjectPacket
00899     {
00900         ChannelFrameFinishReplyPacket( const ChannelFrameFinishPacket* request )
00901             {
00902                 command     = CMD_CHANNEL_FRAME_FINISH_REPLY;
00903                 size        = sizeof( ChannelFrameFinishReplyPacket );
00904                 sessionID   = request->sessionID;
00905                 objectID    = request->objectID;
00906                 frameNumber = request->frameNumber;
00907             }
00908 
00909         uint32_t frameNumber;
00910         uint32_t nStatistics;
00911         EQ_ALIGN8( Statistic statistics[1] );
00912     };
00913         
00914 
00915     struct ChannelFrameDrawFinishPacket : public net::ObjectPacket
00916     {
00917         ChannelFrameDrawFinishPacket()
00918             {
00919                 command       = CMD_CHANNEL_FRAME_DRAW_FINISH;
00920                 size          = sizeof( ChannelFrameDrawFinishPacket );
00921             }
00922 
00923         uint32_t frameID;
00924         uint32_t frameNumber;
00925     };
00926         
00927     struct ChannelFrameClearPacket : public ChannelTaskPacket
00928     {
00929         ChannelFrameClearPacket()
00930             {
00931                 command       = CMD_CHANNEL_FRAME_CLEAR;
00932                 size          = sizeof( ChannelFrameClearPacket );
00933             }
00934     };
00935         
00936     struct ChannelFrameDrawPacket : public ChannelTaskPacket
00937     {
00938         ChannelFrameDrawPacket()
00939             {
00940                 command       = CMD_CHANNEL_FRAME_DRAW;
00941                 size          = sizeof( ChannelFrameDrawPacket );
00942             }
00943     };
00944         
00945     struct ChannelFrameAssemblePacket : public ChannelTaskPacket
00946     {
00947         ChannelFrameAssemblePacket()
00948             {
00949                 command       = CMD_CHANNEL_FRAME_ASSEMBLE;
00950                 size          = sizeof( ChannelFrameAssemblePacket );
00951             }
00952 
00953         uint32_t             nFrames;
00954         EQ_ALIGN8( net::ObjectVersion frames[1] );
00955     };
00956         
00957     struct ChannelFrameReadbackPacket : public ChannelTaskPacket
00958     {
00959         ChannelFrameReadbackPacket()
00960             {
00961                 command       = CMD_CHANNEL_FRAME_READBACK;
00962                 size          = sizeof( ChannelFrameReadbackPacket );
00963             }
00964 
00965         uint32_t             nFrames;
00966         EQ_ALIGN8( net::ObjectVersion frames[1] );
00967     };
00968         
00969     struct ChannelFrameTransmitPacket : public ChannelTaskPacket
00970     {
00971         ChannelFrameTransmitPacket()
00972             {
00973                 command       = CMD_CHANNEL_FRAME_TRANSMIT;
00974                 size          = sizeof( ChannelFrameTransmitPacket );
00975             }
00976 
00977         
00978         net::ObjectVersion frame;
00979         uint32_t           nNodes;
00980         EQ_ALIGN8( net::NodeID        nodes[1] );
00981     };
00982 
00983     struct ChannelFrameViewStartPacket : public ChannelTaskPacket
00984     {
00985         ChannelFrameViewStartPacket()
00986             {
00987                 command       = CMD_CHANNEL_FRAME_VIEW_START;
00988                 size          = sizeof( ChannelFrameViewStartPacket );
00989             }
00990     };
00991         
00992     struct ChannelFrameViewFinishPacket : public ChannelTaskPacket
00993     {
00994         ChannelFrameViewFinishPacket()
00995             {
00996                 command       = CMD_CHANNEL_FRAME_VIEW_FINISH;
00997                 size          = sizeof( ChannelFrameViewFinishPacket );
00998             }
00999     };
01000         
01001     //------------------------------------------------------------
01002     // Frame Data
01003     //------------------------------------------------------------
01004     struct FrameDataTransmitPacket : public net::ObjectPacket
01005     {
01006         FrameDataTransmitPacket()
01007             {
01008                 command = CMD_FRAMEDATA_TRANSMIT;
01009                 size    = sizeof( FrameDataTransmitPacket );
01010             }
01011 
01012         uint32_t      version;
01013         uint32_t      buffers;
01014         uint32_t      frameNumber;
01015         PixelViewport pvp;
01016         bool          ignoreAlpha;
01017 
01018         EQ_ALIGN8( uint8_t data[8] );
01019     };
01020 
01021     struct FrameDataReadyPacket : public net::ObjectPacket
01022     {
01023         FrameDataReadyPacket()
01024             {
01025                 command = CMD_FRAMEDATA_READY;
01026                 size    = sizeof( FrameDataReadyPacket );
01027             }
01028         uint32_t version;
01029     };
01030 
01031     struct FrameDataUpdatePacket : public net::ObjectPacket
01032     {
01033         FrameDataUpdatePacket()
01034             {
01035                 command = CMD_FRAMEDATA_UPDATE;
01036                 size    = sizeof( FrameDataUpdatePacket );
01037             }
01038         uint32_t version;
01039     };
01040 
01041     //------------------------------------------------------------
01042     inline std::ostream& operator << ( std::ostream& os, 
01043                                        const ServerChooseConfigPacket* packet )
01044     {
01045         os << (ServerPacket*)packet << " req " << packet->requestID
01046            << " renderer " << packet->rendererInfo;
01047         return os;
01048     }
01049     inline std::ostream& operator << ( std::ostream& os, 
01050                                        const ServerUseConfigPacket* packet )
01051     {
01052         os << (ServerPacket*)packet << " req " << packet->requestID
01053            << " params " << packet->configInfo;
01054         return os;
01055     }
01056     inline std::ostream& operator << ( std::ostream& os, 
01057                                   const ServerChooseConfigReplyPacket* packet )
01058     {
01059         os << (ServerPacket*)packet << " req " << packet->requestID << " id " 
01060            << packet->configID;
01061         return os;
01062     }
01063     inline std::ostream& operator << ( std::ostream& os, 
01064         const ServerReleaseConfigPacket* packet )
01065     {
01066         os << (ServerPacket*)packet << " config " << packet->configID;
01067         return os;
01068     }
01069     inline std::ostream& operator << ( std::ostream& os, 
01070                                        const ServerCreateConfigPacket* packet )
01071     {
01072         os << (ServerPacket*)packet << " config " << packet->configID 
01073             << " request " << packet->requestID;
01074         return os;
01075     }
01076 
01077     inline std::ostream& operator << ( std::ostream& os, 
01078                                        const ConfigFrameFinishPacket* packet )
01079     {
01080         os << (ConfigPacket*)packet << " frame " << packet->frameNumber;
01081         return os;
01082     }
01083 
01084     inline std::ostream& operator << ( std::ostream& os, 
01085                                        const NodeCreatePipePacket* packet )
01086     {
01087         os << (net::ObjectPacket*)packet << " id " << packet->pipeID;
01088         return os;
01089     }
01090     inline std::ostream& operator << ( std::ostream& os, 
01091                                        const NodeFrameStartPacket* packet )
01092     {
01093         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber
01094            << " id " << packet->frameID;
01095         return os;
01096     }
01097     inline std::ostream& operator << ( std::ostream& os, 
01098                                        const NodeFrameDrawFinishPacket* packet )
01099     {
01100         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber
01101            << " id " << packet->frameID;
01102         return os;
01103     }
01104     inline std::ostream& operator << ( std::ostream& os, 
01105                                        const NodeFrameFinishPacket* packet )
01106     {
01107         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber
01108            << " id " << packet->frameID;
01109         return os;
01110     }
01111 
01112     inline std::ostream& operator << ( std::ostream& os, 
01113                                        const PipeCreateWindowPacket* packet )
01114     {
01115         os << (net::ObjectPacket*)packet << " id " << packet->windowID;
01116         return os;
01117     }
01118     inline std::ostream& operator << ( std::ostream& os, 
01119                                        const PipeConfigInitPacket* packet )
01120     {
01121         os << (net::ObjectPacket*)packet << " init id " << packet->initID
01122            << " port " << packet->port << " device " << packet->device
01123            << " tasks " << packet->tasks << " frame " << packet->frameNumber;
01124         return os;
01125     }
01126     inline std::ostream& operator << ( std::ostream& os, 
01127                                        const PipeConfigInitReplyPacket* packet )
01128     {
01129         os << (net::ObjectPacket*)packet << " result " << packet->result;
01130         return os;
01131     }
01132     inline std::ostream& operator << ( std::ostream& os, 
01133                                        const PipeFrameStartPacket* packet )
01134     {
01135         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber
01136            << " id " << packet->frameID;
01137         return os;
01138     }
01139     inline std::ostream& operator << ( std::ostream& os, 
01140                                        const PipeFrameDrawFinishPacket* packet )
01141     {
01142         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber
01143            << " id " << packet->frameID;
01144         return os;
01145     }
01146     inline std::ostream& operator << ( std::ostream& os, 
01147                                        const PipeFrameFinishPacket* packet )
01148     {
01149         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber
01150            << " id " << packet->frameID;
01151         return os;
01152     }
01153 
01154     inline std::ostream& operator << ( std::ostream& os, 
01155                                        const WindowCreateChannelPacket* packet )
01156     {
01157         os << (net::ObjectPacket*)packet << " id " << packet->channelID;
01158         return os;
01159     }
01160     inline std::ostream& operator << ( std::ostream& os, 
01161                                       const WindowDestroyChannelPacket* packet )
01162     {
01163         os << (net::ObjectPacket*)packet << " id " << packet->channelID;
01164         return os;
01165     }
01166     inline std::ostream& operator << ( std::ostream& os, 
01167                                      const WindowConfigInitReplyPacket* packet )
01168     {
01169         os << (net::ObjectPacket*)packet << " result " << packet->result
01170            << " pvp " << packet->pvp;
01171         return os;
01172     }
01173     inline std::ostream& operator << ( std::ostream& os, 
01174                                        const WindowFrameStartPacket* packet )
01175     {
01176         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber
01177            << " id " << packet->frameID;
01178         return os;
01179     }
01180     inline std::ostream& operator << ( std::ostream& os, 
01181                                      const WindowFrameDrawFinishPacket* packet )
01182     {
01183         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber
01184            << " id " << packet->frameID;
01185         return os;
01186     }
01187     inline std::ostream& operator << ( std::ostream& os, 
01188                                        const WindowBarrierPacket* packet )
01189     {
01190         os << (net::ObjectPacket*)packet << " barrier " << packet->barrier;
01191         return os;
01192     }
01193 
01194     inline std::ostream& operator << ( std::ostream& os, 
01195                                     const ChannelConfigInitReplyPacket* packet )
01196     {
01197         os << (net::ObjectPacket*)packet << " result " << packet->result;
01198         return os;
01199     }
01200     inline std::ostream& operator << ( std::ostream& os, 
01201                                        const ChannelTaskPacket* packet )
01202     {
01203         os << (net::ObjectPacket*)packet << " " << packet->context;
01204         return os;
01205     }
01206     inline std::ostream& operator << ( std::ostream& os, 
01207                                        const ChannelFrameStartPacket* packet )
01208     {
01209         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber;
01210         return os;
01211     }
01212     inline std::ostream& operator << ( std::ostream& os, 
01213                                     const ChannelFrameDrawFinishPacket* packet )
01214     {
01215         os << (net::ObjectPacket*)packet << " frame " << packet->frameNumber
01216            << " id " << packet->frameID;
01217         return os;
01218     }
01219     inline std::ostream& operator << ( std::ostream& os, 
01220                                       const ChannelFrameReadbackPacket* packet )
01221     {
01222         os << (ChannelTaskPacket*)packet << " nFrames " << packet->nFrames;
01223         return os;
01224     }
01225     inline std::ostream& operator << ( std::ostream& os, 
01226                                       const ChannelFrameTransmitPacket* packet )
01227     {
01228         os << (net::ObjectPacket*)packet << " frame " << packet->frame
01229            << " nNodes " << packet->nNodes;
01230         return os;
01231     }
01232     inline std::ostream& operator << ( std::ostream& os, 
01233                                       const ChannelFrameAssemblePacket* packet )
01234     {
01235         os << (ChannelTaskPacket*)packet << " nFrames " << packet->nFrames;
01236         return os;
01237     }
01239 }
01240 
01241 #endif // EQ_PACKETS_H
01242 
Generated on Mon Aug 10 18:58:40 2009 for Equalizer 0.9 by  doxygen 1.5.8