server_config.c revision c2b56358364c4fe3b0760f61836f35b49d057089
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include <string.h>
#include "cr_mem.h"
#include "cr_environment.h"
#include "cr_string.h"
#include "cr_error.h"
#include "cr_glstate.h"
#include "server.h"
#ifdef WINDOWS
#endif
static void
setDefaults(void)
{
if (!cr_server.tcpip_port)
cr_server.maxBarrierCount = 0;
cr_server.ignore_papi = 0;
cr_server.only_swap_once = 0;
cr_server.overlapBlending = 0;
cr_server.debug_barriers = 0;
cr_server.sharedPrograms = 0;
cr_server.sharedWindows = 0;
cr_server.currentProgram = 0;
cr_server.overlap_intens = 0;
cr_server.uniqueWindows = 0;
cr_server.screenCount = 0;
}
/* Check if host reports minimal OpenGL capabilities.
* For example, on Windows host this may happen if host has no graphics
* card drivers installed or drivers were not properly signed or VBox
* is running via remote desktop session etc. Currently, we take care
* about Windows host only when specific RENDERER and VERSION strings
* returned in this case. Later this check should be expanded to the
* rest of hosts. */
static bool crServerHasInsufficientCaps()
{
const char *sRealRender;
const char *sRealVersion;
return true;
return true;
return false;
}
void crServerSetVBoxConfiguration()
{
char response[8096];
char **spuchain;
int num_spus;
int *spu_ids;
char **spu_names;
int i;
/* Quadrics defaults */
int my_rank = 0;
unsigned char key[16]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
char hostname[1024];
char **clientchain, **clientlist;
const char * env;
setDefaults();
/*
* Get my hostname
*/
{
crError("CRServer: Couldn't get my own hostname?");
}
/* response will describe the SPU chain.
* Example "2 5 wet 6 render"
*/
for (i = 0; i < num_spus; i++)
{
spu_names[i]);
}
crNetSetRank(0);
/*
* Load the SPUs
*/
{
if (bits <= CR_ALL_BITS)
else
}
else
{
}
else
{
;
}
if (crServerHasInsufficientCaps())
{
crDebug("Cfg: report minimal OpenGL capabilities");
}
crInfo("Cfg: u32Caps(%#x), fVisualBitsDefault(%#x)",
/* Need to do this as early as possible */
cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_POSITION_CR, 0, GL_INT, 2, &dims[0]);
cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, 0, GL_INT, 2, &dims[2]);
if (spu_dir)
/*
* Get a list of all the clients talking to me.
*/
/* we're inside a vnc viewer */
/*if (!crMothershipSendString( conn, response, "getvncclient %s", hostname ))
crError( "Bad Mothership response: %s", response );*/
}
else {
//crMothershipGetClients(conn, response);
}
/*
* 'response' will now contain a number indicating the number of clients
* pairs.
* Example: "3 tcpip 1,gm 2,via 10"
*/
if (cr_server.numClients == 0)
{
crError("I have no clients! What's a poor server to do?");
}
/*
* Connect to initial set of clients.
* Call crNetAcceptClient() for each client.
* Also, look for a client that's _not_ using the file: protocol.
*/
for (i = 0; i < cr_server.numClients; i++)
{
#ifdef VBOX
#else
#endif
}
/* set default client and mural */
if (cr_server.numClients > 0) {
}
/* Ask the mothership for the tile info */
//crServerGetTileInfoFromMothership(conn, defaultMural);
/* In vnc mode, we reset the mothership configuration so that it can be
* used by subsequent OpenGL apps without having to spawn a new mothership
* on a new port.
*/
crDebug("CRServer: Resetting mothership to initial state");
//crMothershipReset(conn);
}
//crMothershipDisconnect(conn);
}
{
int spu_ids[1] = {0};
int i;
const char * env;
//@todo should be moved to addclient so we have a chain for each client
setDefaults();
/* Load the SPUs */
return;
{
if (bits <= CR_ALL_BITS)
else
}
else
{
}
else
{
;
}
if (crServerHasInsufficientCaps())
{
crDebug("Cfg: report minimal OpenGL capabilities");
}
crInfo("Cfg: u32Caps(%#x), fVisualBitsDefault(%#x)",
cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_POSITION_CR, 0, GL_INT, 2, &dims[0]);
cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, 0, GL_INT, 2, &dims[2]);
cr_server.numClients = 0;
for (i = 0; i < cr_server.numClients; i++)
{
}
/* set default client and mural */
if (cr_server.numClients > 0) {
}
}