server_window.c revision eb48592701d478f2e43d65a9f4f7e21c40917530
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "server.h"
#include "server_dispatch.h"
#include "cr_mem.h"
#include "cr_rand.h"
#include "cr_string.h"
{
}
{
if (cr_server.sharedWindows) {
int pos, j;
/* find empty position in my (curclient) windowList */
break;
}
}
if (pos == CR_MAX_WINDOWS) {
crWarning("Too many windows in crserver!");
return -1;
}
/* Look if any other client has a window for this slot */
for (j = 0; j < cr_server.numClients; j++) {
/* use that client's window */
crDebug("CRServer: client %p sharing window %d",
return windowID;
}
}
}
/*
* Have first SPU make a new window.
*/
if (spuWindow < 0) {
return spuWindow;
}
/* get initial window size */
cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, spuWindow, GL_INT, 2, dims);
/*
* Create a new mural for the new window.
*/
if (mural) {
mural->cVisibleRects = 0;
else
}
crDebug("CRServer: client %p created new window %d (SPU window %d)",
int pos;
break;
}
}
}
return windowID;
}
{
int pos;
{
{
return true;
}
}
return false;
}
{
int found=false;
if (!window)
{
crWarning("Unexpected attempt to delete default mural, ignored!");
return;
}
if (!mural) {
return;
}
{
}
{
}
{
{
}
/*Same as with contexts, some apps destroy it not in a thread where it was created*/
if (!found)
{
{
continue;
if (found) break;
}
}
if (!found)
{
{
}
}
}
/*Make sure this window isn't active in other clients*/
{
{
}
}
while (pNode)
{
{
}
}
if (mural->pVisibleRects)
{
}
}
{
/* crDebug("CRServer: Window %d size %d x %d", window, width, height);*/
if (!mural) {
#if EXTRA_WARN
#endif
return;
}
{
}
/* Work-around Intel driver bug */
{
}
}
{
/* crDebug("CRServer: Window %d pos %d, %d", window, x, y);*/
if (!mural) {
#if EXTRA_WARN
#endif
return;
}
}
{
if (!mural) {
#if EXTRA_WARN
#endif
return;
}
if (mural->pVisibleRects)
{
}
if (cRects)
{
if (!mural->pVisibleRects)
{
crError("Out of memory in crServerDispatchWindowVisibleRegion");
}
}
{
/* @todo the code assumes that RTRECT == four GLInts. */
}
}
{
if (!mural) {
#if EXTRA_WARN
#endif
return;
}
{
}
}
{
if (!mural) {
#if EXTRA_WARN
crWarning("CRServer: invalid window %d passed to crServerSPUWindowID()",
#endif
return -1;
}
}