Ignore:
Timestamp:
May 2, 2008, 2:19:54 PM (17 years ago)
Author:
jack
Message:

AnugaVis?: Something's drawing. Starting work on event handling to get motion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/anugavis/src/events.c

    r5261 r5271  
    88#  include <OpenGL/gl.h>
    99#endif
     10#ifdef HAVE_GL_GLU_H
     11#  include <GL/glu.h>
     12#elif HAVE_OPENGL_GLU_H
     13#  include <OpenGL/glu.h>
     14#endif
    1015#include <SDL.h>
    1116#include "events.h"
    1217#include "globals.h"
     18#include "height_quantity.h"
    1319
    1420int AnugaVis_Step(void){
    1521  SDL_Event event;
    1622  int more = 1;
     23  struct height_quantity_simple *height;
    1724
    1825  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     26  glMatrixMode(GL_MODELVIEW);
     27  glLoadIdentity();
     28  gluLookAt(anugavis.eye[0], anugavis.eye[1], anugavis.eye[2],
     29            anugavis.focus[0], anugavis.focus[1], anugavis.focus[2],
     30            0, 0, 1);
     31  for(height = anugavis.heights ; height != NULL ; height = height->next)
     32    AnugaVis_DrawHeightQuantity(height);
    1933  SDL_GL_SwapBuffers();
    2034
     
    2236    switch(event.type){
    2337    case SDL_KEYDOWN:
    24       if(event.key.keysym.sym == SDLK_ESCAPE) more = 0;
     38      switch(event.key.keysym.sym){
     39      case SDLK_ESCAPE:
     40        more = 0;
     41        break;
     42      default:
     43        break;
     44      }
     45      break;
     46    case SDL_KEYUP:
     47      switch(event.key.keysym.sym){
     48      default:
     49        break;
     50      }
    2551      break;
    2652    }
Note: See TracChangeset for help on using the changeset viewer.