Changeset 27708 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Timestamp:
- Mar 25, 2010 2:36:56 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59311
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_config.c
r15532 r27708 54 54 cr_server.idsPool.freeContextID = 1; 55 55 cr_server.idsPool.freeClientID = 1; 56 57 cr_server.screenCount = 0; 56 58 } 57 59 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r23094 r27708 15 15 #include "server_dispatch.h" 16 16 #include "state/cr_texture.h" 17 #include "render/renderspu.h" 17 18 #include <signal.h> 18 19 #include <stdlib.h> … … 1003 1004 } 1004 1005 1006 #define SCREEN(i) (cr_server.screen[i]) 1007 #define MAPPED(screen) ((screen).winID != 0) 1008 1009 static void crVBoxServerReparentMuralCB(unsigned long key, void *data1, void *data2) 1010 { 1011 CRMuralInfo *pMI = (CRMuralInfo*) data1; 1012 int *sIndex = (int*) data2; 1013 1014 if (pMI->screenId == *sIndex) 1015 { 1016 renderspuReparentWindow(pMI->spuWindow); 1017 } 1018 } 1019 1020 DECLEXPORT(int32_t) crVBoxServerSetScreenCount(int sCount) 1021 { 1022 int i; 1023 1024 if (sCount>CR_MAX_GUEST_MONITORS) 1025 return VERR_INVALID_PARAMETER; 1026 1027 /*Shouldn't happen yet, but to be safe in future*/ 1028 for (i=0; i<cr_server.screenCount; ++i) 1029 { 1030 if (MAPPED(SCREEN(i))) 1031 crWarning("Screen count is changing, but screen[%i] is still mapped", i); 1032 return VERR_NOT_IMPLEMENTED; 1033 } 1034 1035 cr_server.screenCount = sCount; 1036 1037 for (i=0; i<sCount; ++i) 1038 { 1039 SCREEN(i).winID = 0; 1040 } 1041 1042 return VINF_SUCCESS; 1043 } 1044 1045 DECLEXPORT(int32_t) crVBoxServerUnmapScreen(int sIndex) 1046 { 1047 if (sIndex<0 || sIndex>=cr_server.screenCount) 1048 return VERR_INVALID_PARAMETER; 1049 1050 if (MAPPED(SCREEN(sIndex))) 1051 { 1052 SCREEN(sIndex).winID = 0; 1053 renderspuSetWindowId(0); 1054 1055 crHashtableWalk(cr_server.muralTable, crVBoxServerReparentMuralCB, &sIndex); 1056 } 1057 1058 renderspuSetWindowId(SCREEN(0).winID); 1059 return VINF_SUCCESS; 1060 } 1061 1062 DECLEXPORT(int32_t) crVBoxServerMapScreen(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h, uint64_t winID) 1063 { 1064 if (sIndex<0 || sIndex>=cr_server.screenCount) 1065 return VERR_INVALID_PARAMETER; 1066 1067 if (winID==0) 1068 return VERR_INVALID_PARAMETER; 1069 1070 if (MAPPED(SCREEN(sIndex))) 1071 { 1072 crWarning("Mapped screen[%i] is being remapped.", sIndex); 1073 } 1074 1075 SCREEN(sIndex).winID = winID; 1076 SCREEN(sIndex).x = x; 1077 SCREEN(sIndex).y = y; 1078 SCREEN(sIndex).w = w; 1079 SCREEN(sIndex).h = h; 1080 1081 renderspuSetWindowId(SCREEN(sIndex).winID); 1082 1083 crHashtableWalk(cr_server.muralTable, crVBoxServerReparentMuralCB, &sIndex); 1084 1085 renderspuSetWindowId(SCREEN(0).winID); 1086 return VINF_SUCCESS; 1087 } 1088 1089 DECLEXPORT(int32_t) crVBoxServerSetRootVisibleRegion(GLint cRects, GLint *pRects) 1090 { 1091 renderspuSetRootVisibleRegion(cRects, pRects); 1092 1093 return VINF_SUCCESS; 1094 }
Note:
See TracChangeset
for help on using the changeset viewer.