Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3358 in orxonox.OLD for orxonox/branches/parenting/src/world.cc


Ignore:
Timestamp:
Jan 6, 2005, 9:21:13 PM (21 years ago)
Author:
patrick
Message:

orxonox/branches/parenting: imageloader works. but not yet fully implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/world.cc

    r3356 r3358  
    2727#include "null_parent.h"
    2828#include "helper_parent.h"
    29 #include "importer/texture.h"
     29#include "glmenu_imagescreen.h"
    3030
    3131using namespace std;
     
    6868  this->nullParent->destroy ();
    6969
    70   //delete this->testCurve;
     70  //delete this->trackManager;
    7171
    7272  /*
     
    107107  //gluNurbsProperty (theNurb, GLU_NURBS_MODE, GLU_NURBS_TESSELLATOR);
    108108  //gluNurbsProperty (theNurb, GLU_NURBS_VERTEX, vertexCallback );
     109
    109110}
    110111
     
    145146  printf ("World::displayLoadScreen - start\n");
    146147 
    147   int w = 680;
    148   int h = 480;
    149 
    150   glViewport(0,0,w,h);
    151  
    152   glMatrixMode(GL_PROJECTION);
    153   glLoadIdentity();
    154   gluPerspective(45.0f,(GLfloat)w/(GLfloat)h, .5f ,150.0f);
    155   glMatrixMode(GL_MODELVIEW);
    156 
    157   Texture* loadScreenTexture = new Texture();
    158   loadScreenTexture->loadImage("orx_tex.bmp");
    159 
    160   /* ------------painten */
    161 
    162   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    163   glLoadIdentity();
    164   gluLookAt(0, 0, 6,     0, 0, 0,     0, 1, 0);
    165 
    166   // Bind the texture stored at the zero index of g_Texture[]
    167   //glBindTexture(GL_TEXTURE_2D, g_Texture[0]);
    168  
    169   // Display a quad texture to the screen
    170   glBegin(GL_QUADS);
    171  
    172   // glTexCoord2f() takes the X and Y offset (or U and V) into the bitmap.
    173   // Then, the next point sent to be rendered attaches that part of the bitmap
    174   // to itself.  The (U, V) coordinates range from (0, 0) being the top left corner
    175   // of the bitmap, to (1, 1) being the bottom left corner of the bitmap.
    176   // You can go above 1 but it just is wrapped around back to zero and repeats the texture.
    177   // Try setting the 1's to 2's and see what it does, then try setting them to 0.5's.
    178   // The higher the number, the more instances of the texture will appear on the square,
    179   // Where the lower the number, it stretches the incomplete texture over the surface of the square.
    180   // For every vertice we need a U V coordinate, as shown below.  You might have to play
    181   // around with the values to make it texture correctly, otherwise it will be flipped, upside down,
    182   // or skewed.  It also depends on where you are looking at it.  We are looking down the -Z axis.
    183  
    184   // Display the top left vertice
    185   glTexCoord2f(0.0f, 1.0f);
    186   glVertex3f(-2.5, 2.5, 0);
    187  
    188   // Display the bottom left vertice
    189   glTexCoord2f(0.0f, 0.0f);
    190   glVertex3f(-2.5, -2.5, 0);
    191  
    192   // Display the bottom right vertice
    193   glTexCoord2f(1.0f, 0.0f);
    194   glVertex3f(2.5, -2.5, 0);
    195  
    196   // Display the top right vertice
    197   glTexCoord2f(1.0f, 1.0f);
    198   glVertex3f(2.5, 2.5, 0);
    199 
    200   glEnd();
    201  
    202   SDL_GL_SwapBuffers();                   
    203 
    204   delete loadScreenTexture;
    205   SDL_Delay (1000);
     148  GLMenuImageScreen* glmis = new GLMenuImageScreen();
     149  glmis->init();
     150  glmis->draw();
     151 
    206152  printf ("World::displayLoadScreen - end\n");
    207153}
Note: See TracChangeset for help on using the changeset viewer.