ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/test.C
(Generate patch)

Comparing libgender/test.C (file contents):
Revision 1.66 by root, Sun Oct 17 18:25:37 2004 UTC vs.
Revision 1.69 by root, Sat Oct 23 02:27:51 2004 UTC

243 } 243 }
244 244
245 SDL_GL_SetAttribute (SDL_GL_RED_SIZE, rgb_size[0]); 245 SDL_GL_SetAttribute (SDL_GL_RED_SIZE, rgb_size[0]);
246 SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, rgb_size[1]); 246 SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, rgb_size[1]);
247 SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, rgb_size[2]); 247 SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, rgb_size[2]);
248 SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16); 248 SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 24);
249 SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); 249 SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
250 250
251 if (fsaa) 251 if (fsaa)
252 { 252 {
253 SDL_GL_SetAttribute (SDL_GL_MULTISAMPLEBUFFERS, 1); 253 SDL_GL_SetAttribute (SDL_GL_MULTISAMPLEBUFFERS, 1);
259 fprintf (stderr, "Couldn't set GL mode: %s\n", SDL_GetError ()); 259 fprintf (stderr, "Couldn't set GL mode: %s\n", SDL_GetError ());
260 SDL_Quit (); 260 SDL_Quit ();
261 exit (1); 261 exit (1);
262 } 262 }
263 263
264 printf ("Screen BPP: %d\n", SDL_GetVideoSurface ()->format->BitsPerPixel); 264 //printf ("Screen BPP: %d\n", SDL_GetVideoSurface ()->format->BitsPerPixel);
265 printf ("\n"); 265 //printf ("\n");
266 printf ("Vendor : %s\n", glGetString (GL_VENDOR)); 266 //printf ("Vendor : %s\n", glGetString (GL_VENDOR));
267 printf ("Renderer : %s\n", glGetString (GL_RENDERER)); 267 //printf ("Renderer : %s\n", glGetString (GL_RENDERER));
268 printf ("Version : %s\n", glGetString (GL_VERSION)); 268 //printf ("Version : %s\n", glGetString (GL_VERSION));
269 printf ("Extensions : %s\n", glGetString (GL_EXTENSIONS)); 269 //printf ("Extensions : %s\n", glGetString (GL_EXTENSIONS));
270 printf ("\n"); 270 printf ("\n");
271 271
272 SDL_GL_GetAttribute (SDL_GL_RED_SIZE, &value); 272 SDL_GL_GetAttribute (SDL_GL_RED_SIZE, &value);
273 printf ("SDL_GL_RED_SIZE: requested %d, got %d\n", rgb_size[0], value); 273 printf ("SDL_GL_RED_SIZE: requested %d, got %d\n", rgb_size[0], value);
274 SDL_GL_GetAttribute (SDL_GL_GREEN_SIZE, &value); 274 SDL_GL_GetAttribute (SDL_GL_GREEN_SIZE, &value);
297 SDL_SetGamma (gamma, gamma, gamma); 297 SDL_SetGamma (gamma, gamma, gamma);
298 298
299 entity *planet = new entity (new geometry_sphere (10)); 299 entity *planet = new entity (new geometry_sphere (10));
300 planet->move (vec3 (0, 0, -20)); 300 planet->move (vec3 (0, 0, -20));
301 planet->show (); 301 planet->show ();
302
303 shader::debdebdebdebug ();//D
302 304
303#if 1 305#if 1
304 for (int i = 0; i < 20; i++) 306 for (int i = 0; i < 20; i++)
305 { 307 {
306 // load a entity 308 // load a entity
319 e->move (vec3 (i*5, -3, -i*10)); 321 e->move (vec3 (i*5, -3, -i*10));
320 e->show (); 322 e->show ();
321 } 323 }
322 324
323 { 325 {
324 fisch (vec3 (0, 0, -2e9), 1e9, 10); 326 fisch (vec3 (0, 0, -2e9), 1e9, 8);
325 //entity *planet = new entity (new geometry_sphere (1e9)); 327 //entity *planet = new entity (new geometry_sphere (1e9));
326 //planet->move (vec3 (0, 0, -1.5e9)); 328 //planet->move (vec3 (0, 0, -1.5e9));
327 //planet->show (); 329 //planet->show ();
328 } 330 }
329 331
342 camera.orig.x = 0; camera.orig.y = 0; camera.orig.z = 0; 344 camera.orig.x = 0; camera.orig.y = 0; camera.orig.z = 0;
343 camera.p = point (0, 0, 10); 345 camera.p = point (0, 0, 10);
344 camera.d = vec3 (0, 0, -1); 346 camera.d = vec3 (0, 0, -1);
345 camera.u = vec3 (0, 1, 0); 347 camera.u = vec3 (0, 1, 0);
346 camera.w = w; camera.h = h; 348 camera.w = w; camera.h = h;
347 camera.fov = 35; 349 camera.fov = 40.;
348 camera.z_near = 1.;
349 350
350 glEnable (GL_CULL_FACE); 351 glEnable (GL_CULL_FACE);
351 glDisable (GL_ALPHA_TEST); 352 glDisable (GL_ALPHA_TEST);
352 glDisable (GL_BLEND); 353 glDisable (GL_BLEND);
353 354

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines