VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_winpos.c@ 16774

Last change on this file since 16774 was 15532, checked in by vboxsync, 16 years ago

crOpenGL: export to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
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 */
20static 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
30void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2dARB( GLdouble x, GLdouble y )
31{
32 crServerWindowPos((GLfloat) x, (GLfloat) y, 0.0F);
33}
34
35void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2dvARB( const GLdouble * v )
36{
37 crServerWindowPos((GLfloat) v[0], (GLfloat) v[1], 0.0F);
38}
39
40void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2fARB( GLfloat x, GLfloat y )
41{
42 crServerWindowPos(x, y, 0.0F);
43}
44
45void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2fvARB( const GLfloat * v )
46{
47 crServerWindowPos(v[0], v[1], 0.0F);
48}
49
50void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2iARB( GLint x, GLint y )
51{
52 crServerWindowPos((GLfloat)x, (GLfloat)y, 0.0F);
53}
54
55void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2ivARB( const GLint * v )
56{
57 crServerWindowPos((GLfloat)v[0], (GLfloat)v[1], 0.0F);
58}
59
60void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2sARB( GLshort x, GLshort y )
61{
62 crServerWindowPos(x, y, 0.0F);
63}
64
65void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos2svARB( const GLshort * v )
66{
67 crServerWindowPos(v[0], v[1], 0.0F);
68}
69
70void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3dARB( GLdouble x, GLdouble y, GLdouble z )
71{
72 crServerWindowPos((GLfloat) x, (GLfloat) y, (GLfloat) z);
73}
74
75void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3dvARB( const GLdouble * v )
76{
77 crServerWindowPos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
78}
79
80void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3fARB( GLfloat x, GLfloat y, GLfloat z )
81{
82 crServerWindowPos(x, y, z);
83}
84
85void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3fvARB( const GLfloat * v )
86{
87 crServerWindowPos(v[0], v[1], v[2]);
88}
89
90void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3iARB( GLint x, GLint y, GLint z )
91{
92 crServerWindowPos((GLfloat)x,(GLfloat)y, (GLfloat)z);
93}
94
95void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3ivARB( const GLint * v )
96{
97 crServerWindowPos((GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]);
98}
99
100void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3sARB( GLshort x, GLshort y, GLshort z )
101{
102 crServerWindowPos(x, y, z);
103}
104
105void SERVER_DISPATCH_APIENTRY crServerDispatchWindowPos3svARB( const GLshort * v )
106{
107 crServerWindowPos(v[0], v[1], v[2]);
108}
109
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette