Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /examples/iso2d-demo/main.c
ViewVC logotype

Diff of /examples/iso2d-demo/main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1920, Fri Jun 8 12:11:49 2012 UTC revision 1921, Fri Jun 8 13:22:03 2012 UTC
# Line 50  Line 50 
50  unsigned int    Width;          // view window width  unsigned int    Width;          // view window width
51  unsigned int    Height;         // view window height  unsigned int    Height;         // view window height
52  GLuint          ImageTexture;   // Texture ID of background image  GLuint          ImageTexture;   // Texture ID of background image
53    float           WrldOrigin[2];
54    float           WrldDim[2];
55    
56  typedef struct {  typedef struct {
57      TwBar       *ctls;      TwBar       *ctls;
# Line 74  Line 76 
76      glBegin (GL_QUADS);      glBegin (GL_QUADS);
77          glColor3f (0.1, 0.1, 0.1);          glColor3f (0.1, 0.1, 0.1);
78          glTexCoord2f (0.0, 0.0);          glTexCoord2f (0.0, 0.0);
79          glVertex2f (WRLD_MIN_X, WRLD_MIN_Y);          glVertex2f (WrldOrigin[0], WrldOrigin[1]);
80          glTexCoord2f (1.0, 0.0);          glTexCoord2f (1.0, 0.0);
81          glVertex2f (WRLD_MAX_X, WRLD_MIN_Y);          glVertex2f (WrldOrigin[0]+WrldDim[0], WrldOrigin[1]);
82          glTexCoord2f (1.0, 1.0);          glTexCoord2f (1.0, 1.0);
83          glVertex2f (WRLD_MAX_X, WRLD_MAX_Y);          glVertex2f (WrldOrigin[0]+WrldDim[0], WrldOrigin[1]+WrldDim[1]);
84          glTexCoord2f (0.0, 1.0);          glTexCoord2f (0.0, 1.0);
85          glVertex2f (WRLD_MIN_X, WRLD_MAX_Y);          glVertex2f (WrldOrigin[0], WrldOrigin[1]+WrldDim[1]);
86      glEnd();      glEnd();
87      glDisable (GL_TEXTURE_2D);      glDisable (GL_TEXTURE_2D);
88      CheckError ();      CheckError ();
# Line 240  Line 242 
242    // load Diderot image for background texture    // load Diderot image for background texture
243      InitTexture ();      InitTexture ();
244    
245      // setup the world coords.
246      // FIXME: we should get these from the nrrd file, but for now I'm hard coding them
247        WrldOrigin[0] = -0.0184375;
248        WrldOrigin[1] = -0.0184375;
249        WrldDim[0] = 0.013125 * 80.0;
250        WrldDim[1] = 0.013125 * 80.0;
251    
252    // initialize the Diderot program    // initialize the Diderot program
253      ISO_World_t *wrld = ISO_Init ();      ISO_World_t *wrld = ISO_Init ();
254      ISO_Initially (wrld);      ISO_Initially (wrld);

Legend:
Removed from v.1920  
changed lines
  Added in v.1921

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0