Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 6, 2005, 9:21:13 PM (20 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/glmenu_imagescreen.cc

    r3357 r3358  
    1818
    1919#include "glmenu_imagescreen.h"
    20 
     20#include "importer/texture.h"
    2121
    2222using namespace std;
     
    4646*/
    4747void GLMenuImageScreen::init ()
    48 {}
     48{
     49  int w = 680;
     50  int h = 480;
     51
     52  glViewport(0,0,w,h);
     53 
     54  glMatrixMode(GL_PROJECTION);
     55  glLoadIdentity();
     56  gluPerspective(45.0f,(GLfloat)w/(GLfloat)h, .5f ,150.0f);
     57  glMatrixMode(GL_MODELVIEW);
     58
     59  this->backTex = new Texture();
     60  this->backTex->loadImage("orx_tex.bmp");
     61
     62  /* ------------painten */
     63
     64  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     65  glLoadIdentity();
     66  gluLookAt(0, 0, 6,     0, 0, 0,     0, 1, 0);
     67
     68  // Bind the texture stored at the zero index of g_Texture[]
     69  //glBindTexture(GL_TEXTURE_2D, g_Texture[0]);
     70}
    4971
    5072
     
    6991*/
    7092void GLMenuImageScreen::draw ()
    71 {}
     93{
     94  // Display a quad texture to the screen
     95  glBegin(GL_QUADS);
     96 
     97  // Display the top left vertice
     98  glTexCoord2f(0.0f, 1.0f);
     99  glVertex3f(-2.5, 2.5, 0);
     100 
     101  // Display the bottom left vertice
     102  glTexCoord2f(0.0f, 0.0f);
     103  glVertex3f(-2.5, -2.5, 0);
     104 
     105  // Display the bottom right vertice
     106  glTexCoord2f(1.0f, 0.0f);
     107  glVertex3f(2.5, -2.5, 0);
     108 
     109  // Display the top right vertice
     110  glTexCoord2f(1.0f, 1.0f);
     111  glVertex3f(2.5, 2.5, 0);
     112
     113  glEnd();
     114 
     115  SDL_GL_SwapBuffers();                   
     116
     117  delete this->backTex;
     118  SDL_Delay(1000);
     119}
    72120
    73121 
Note: See TracChangeset for help on using the changeset viewer.