MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / main

Function main

diags/tcbench.cpp:154–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152
153
154int main(int argc, char **argv)
155{
156 int i; fbx_wh wh;
157 double benchTime = DEFBENCHTIME, elapsed; Timer timer;
158 int sampleRate = DEFSAMPLERATE, x = -1, y = -1;
159 #ifdef _WIN32
160 INPUT inputs[4];
161 RECT winRect;
162 DWORD downFlags = 0, upFlags = 0;
163 #else
164 unsigned int button = 0;
165 int rootx, rooty;
166 #endif
167 int moveX = 0, moveY = 0, incX = -1, incY = -1, currentX = 0, currentY = 0;
168
169 program_name = argv[0];
170 memset(&wh, 0, sizeof(wh));
171
172 if(argc > 1) for(i = 1; i < argc; i++)
173 {
174 if(!stricmp(argv[i], "-h") || !strcmp(argv[i], "-?")) usage();
175 else if(!stricmp(argv[i], "-t") && i < argc - 1)
176 {
177 if((benchTime = atof(argv[++i])) <= 0.0) usage();
178 }
179 else if(!stricmp(argv[i], "-s") && i < argc - 1)
180 {
181 if((sampleRate = atoi(argv[++i])) < 1) usage();
182 }
183 else if(!stricmp(argv[i], "-x") && i < argc - 1)
184 {
185 if((x = atoi(argv[++i])) < 0) usage();
186 }
187 else if(!stricmp(argv[i], "-y") && i < argc - 1)
188 {
189 if((y = atoi(argv[++i])) < 0) usage();
190 }
191 else if(!stricmp(argv[i], "-wh") && i < argc - 1)
192 {
193 #ifdef _WIN32
194 size_t temp = 0;
195 if(sscanf(argv[++i], "%zx", &temp) < 1 || temp <= 0) usage();
196 wh = (fbx_wh)temp;
197 #else
198 unsigned int temp = 0;
199 if(sscanf(argv[++i], "%x", &temp) < 1 || temp <= 0) usage();
200 wh.d = (Drawable)temp;
201 #endif
202 }
203 else if(!stricmp(argv[i], "-mx") && i < argc - 1)
204 {
205 if(sscanf(argv[++i], "%d", &moveX) < 1 || moveX <= 0) usage();
206 }
207 else if(!stricmp(argv[i], "-my") && i < argc - 1)
208 {
209 if(sscanf(argv[++i], "%d", &moveY) < 1 || moveY <= 0) usage();
210 }
211 else if(!stricmp(argv[i], "-lb"))

Callers

nothing calls this directly

Calls 7

XOpenDisplayFunction · 0.85
Select_WindowFunction · 0.85
fbx_termFunction · 0.85
fbx_readFunction · 0.85
elapsedMethod · 0.80
usageFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected