1 |
|
---|
2 | #include "server_dispatch.h"
|
---|
3 | #include "server.h"
|
---|
4 |
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * All glWindowPos commands go through here.
|
---|
8 | * The (x,y,z) coordinate is in mural-space window coords.
|
---|
9 | * We need to bias by the current tile's position.
|
---|
10 | * Remember that the state differencer (used in the tilesort SPU) uses
|
---|
11 | * glWindowPos to update the raster position on the servers, so that takes
|
---|
12 | * care of proper position for tilesorting.
|
---|
13 | * Also, this helps with sort-last rendering: if images are being sent to a
|
---|
14 | * server that has tiles, the images will be correctly positioned too.
|
---|
15 | * This also solves Eric Mueller's "tilesort-->readback trouble" issue.
|
---|
16 | *
|
---|
17 | * glRasterPos commands will go through unmodified; they're transformed
|
---|
18 | * by the modelview/projection matrix which is already modified per-tile.
|
---|
19 | */
|
---|
20 | static void crServerWindowPos( GLfloat x, GLfloat y, GLfloat z )
|
---|
21 | {
|
---|
22 | CRMuralInfo *mural = cr_server.curClient->currentMural;
|
---|
23 | x -= (float) mural->extents[mural->curExtent].imagewindow.x1;
|
---|
24 | y -= (float) mural->extents[mural->curExtent].imagewindow.y1;
|
---|
25 | crStateWindowPos3fARB(x, y, z);
|
---|
26 | cr_server.head_spu->dispatch_table.WindowPos3fARB(x, y, z);
|
---|
27 | }
|
---|
28 |
|
---|
29 |
|
---|
30 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2dARB( GLdouble x, GLdouble y )
|
---|
31 | {
|
---|
32 | crServerWindowPos((GLfloat) x, (GLfloat) y, 0.0F);
|
---|
33 | }
|
---|
34 |
|
---|
35 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2dvARB( const GLdouble * v )
|
---|
36 | {
|
---|
37 | crServerWindowPos((GLfloat) v[0], (GLfloat) v[1], 0.0F);
|
---|
38 | }
|
---|
39 |
|
---|
40 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2fARB( GLfloat x, GLfloat y )
|
---|
41 | {
|
---|
42 | crServerWindowPos(x, y, 0.0F);
|
---|
43 | }
|
---|
44 |
|
---|
45 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2fvARB( const GLfloat * v )
|
---|
46 | {
|
---|
47 | crServerWindowPos(v[0], v[1], 0.0F);
|
---|
48 | }
|
---|
49 |
|
---|
50 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2iARB( GLint x, GLint y )
|
---|
51 | {
|
---|
52 | crServerWindowPos((GLfloat)x, (GLfloat)y, 0.0F);
|
---|
53 | }
|
---|
54 |
|
---|
55 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2ivARB( const GLint * v )
|
---|
56 | {
|
---|
57 | crServerWindowPos((GLfloat)v[0], (GLfloat)v[1], 0.0F);
|
---|
58 | }
|
---|
59 |
|
---|
60 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2sARB( GLshort x, GLshort y )
|
---|
61 | {
|
---|
62 | crServerWindowPos(x, y, 0.0F);
|
---|
63 | }
|
---|
64 |
|
---|
65 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2svARB( const GLshort * v )
|
---|
66 | {
|
---|
67 | crServerWindowPos(v[0], v[1], 0.0F);
|
---|
68 | }
|
---|
69 |
|
---|
70 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3dARB( GLdouble x, GLdouble y, GLdouble z )
|
---|
71 | {
|
---|
72 | crServerWindowPos((GLfloat) x, (GLfloat) y, (GLfloat) z);
|
---|
73 | }
|
---|
74 |
|
---|
75 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3dvARB( const GLdouble * v )
|
---|
76 | {
|
---|
77 | crServerWindowPos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
|
---|
78 | }
|
---|
79 |
|
---|
80 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3fARB( GLfloat x, GLfloat y, GLfloat z )
|
---|
81 | {
|
---|
82 | crServerWindowPos(x, y, z);
|
---|
83 | }
|
---|
84 |
|
---|
85 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3fvARB( const GLfloat * v )
|
---|
86 | {
|
---|
87 | crServerWindowPos(v[0], v[1], v[2]);
|
---|
88 | }
|
---|
89 |
|
---|
90 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3iARB( GLint x, GLint y, GLint z )
|
---|
91 | {
|
---|
92 | crServerWindowPos((GLfloat)x,(GLfloat)y, (GLfloat)z);
|
---|
93 | }
|
---|
94 |
|
---|
95 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3ivARB( const GLint * v )
|
---|
96 | {
|
---|
97 | crServerWindowPos((GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]);
|
---|
98 | }
|
---|
99 |
|
---|
100 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3sARB( GLshort x, GLshort y, GLshort z )
|
---|
101 | {
|
---|
102 | crServerWindowPos(x, y, z);
|
---|
103 | }
|
---|
104 |
|
---|
105 | void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3svARB( const GLshort * v )
|
---|
106 | {
|
---|
107 | crServerWindowPos(v[0], v[1], v[2]);
|
---|
108 | }
|
---|
109 |
|
---|