cr_server.h revision 9ca6b5869be6c269085ef2294ac0863be7749346
/* Copyright (c) 2001, Stanford University
* All rights reserved.
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#ifndef INCLUDE_CR_SERVER_H
#define INCLUDE_CR_SERVER_H
#include "cr_spu.h"
#include "cr_net.h"
#include "cr_hash.h"
#include "cr_protocol.h"
#include "cr_glstate.h"
#include "spu_dispatch_table.h"
#include "state/cr_currentpointers.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SHCROGL_SSM_VERSION 26
#define CR_MAX_WINDOWS 100
#define CR_MAX_CLIENTS 64
/*@todo must match MaxGuestMonitors from SchemaDefs.h*/
#define CR_MAX_GUEST_MONITORS 8
typedef DECLCALLBACKPTR(void, PFNCRSERVERPRESENTFBO) (void *data, int32_t screenId, int32_t x, int32_t y, uint32_t w, uint32_t h);
/* Callbacks for output of the rendered frames.
*
* This allows to pass rendered frames to an external component rather than draw them on screen.
*
* An external component registers the redirection callbacks using crVBoxServerOutputRedirectSet.
*
* The list of formats supported by the caller is obtained using CRORContextProperty.
* The actual format choosed by the service is passed as a CRORBegin parameter.
*/
typedef struct {
const void *pvContext; /* Supplied by crVBoxServerOutputRedirectSet. */
const char *pszFormat));
typedef struct {
} CRExtent;
struct BucketingInfo;
/**
* Mural info
*/
typedef struct {
int spuWindow; /*the SPU's corresponding window ID */
int screenId;
void *pvOutputRedirectInstance;
} CRMuralInfo;
/**
* A client is basically an upstream Cr Node (connected via mothership)
*/
typedef struct _crclient {
int spu_id; /**< id of the last SPU in the client's SPU chain */
int number; /**< a unique number for each client */
#ifdef VBOXCR_LOGFPS
#endif
} CRClient;
typedef struct _crclientnode {
} CRClientNode;
typedef struct CRPoly_t {
int npoints;
double *points;
} CRPoly;
/**
* There's one of these run queue entries per client
* The run queue is a circular, doubly-linked list of these objects.
*/
typedef struct RunQueue_t {
int blocked;
struct RunQueue_t *next;
struct RunQueue_t *prev;
} RunQueue;
typedef struct {
typedef struct {
int32_t x, y;
uint32_t w, h;
} CRScreenInfo;
typedef struct {
unsigned short tcpip_port;
int screenCount;
int numClients;
int client_spu_id;
int mtu;
int buffer_size;
char protocol[1024];
int SpuContext; /**< Rendering context for the head SPU */
int SpuContextVisBits; /**< Context's visual attributes */
char *SpuContextDpyName; /**< Context's dpyName */
/** configuration options */
/*@{*/
int useL2;
int ignore_papi;
unsigned int maxBarrierCount;
unsigned int clearCount;
int optimizeBucket;
int only_swap_once;
int debug_barriers;
int sharedDisplayLists;
int sharedTextureObjects;
int sharedPrograms;
int sharedWindows;
int uniqueWindows;
int localTileSpec;
int useDMX;
int overlapBlending;
const char *vpProjectionMatrixVariable;
int stereoView;
int vncMode; /* cmd line option */
/*@}*/
/** view_matrix config */
/*@{*/
/*@}*/
/** projection_matrix config */
/*@{*/
int currentEye;
/*@}*/
/** for warped tiles */
/*@{*/
/*@}*/
/*@{*/
float *overlap_intens;
int num_overlap_intens;
int num_overlap_levels;
/*@}*/
*using callback above to update vbox framebuffers*/
} CRServer;
extern DECLEXPORT(void) crServerServiceClients(void);
extern DECLEXPORT(void) crServerAddNewClient(void);
extern DECLEXPORT(void) crVBoxServerTearDown(void);
extern DECLEXPORT(int32_t) crVBoxServerClientWrite(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t cbBuffer);
extern DECLEXPORT(int32_t) crVBoxServerClientRead(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t *pcbBuffer);
extern DECLEXPORT(int32_t) crVBoxServerClientSetVersion(uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor);
extern DECLEXPORT(int32_t) crVBoxServerMapScreen(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h, uint64_t winID);
#ifdef __cplusplus
}
#endif
#endif