Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8312 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Jun 11, 2006, 12:49:25 PM (19 years ago)
Author:
bensch
Message:

trunk: merged the water-branche back here
removed the HACK in GameWorld in the Process (hope it is not needed anymore…

merged with command:
svn merge https://svn.orxonox.net/orxonoanches/water/src/lib/gui/gl_gui src/lib/gui/gl/ -r8063:HEAD

Location:
trunk/src/lib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/material.cc

    r8037 r8312  
    103103 * @brief sets the material with which the following Faces will be painted
    104104 */
    105 bool Material::select() const
     105  bool Material::select() const
    106106{
    107107  if (unlikely(this == Material::selectedMaterial))
     
    397397  assert(textureNumber < this->textures.size());
    398398
    399   glActiveTexture(0);
     399  // HACK
     400  glActiveTexture(textureNumber);
    400401   glEnable(GL_TEXTURE_2D);
    401402   glBindTexture(GL_TEXTURE_2D, this->textures[textureNumber].getTexture());
  • trunk/src/lib/graphics/importer/texture.cc

    r8293 r8312  
    151151
    152152
    153 Texture::Texture(GLenum target)
     153Texture::Texture(GLenum target, unsigned int width, unsigned int height, unsigned int channels, GLenum type)
    154154{
    155155  this->init();
    156   GLuint texture;
     156  GLuint texture = 0;
    157157  Texture::generateTexture(texture, target);
     158
     159  glBindTexture(target, texture);
     160
     161  unsigned int* pixels = new unsigned int[width * height * channels];
     162  memset(pixels, 0, width * height * channels * sizeof(unsigned int));
     163 
     164 
     165  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
     166  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
     167  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     168  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     169
     170  glTexImage2D(target, 0, channels, width, height, 0, type, GL_UNSIGNED_INT, pixels);
     171 
     172 
     173 
     174  delete[] pixels;
     175
    158176  this->data->setTexture(texture);
    159177}
     
    374392  //  printf("%s, w:%d h:%d, 0x%x\n", this->getName(), surface->w, surface->h, target);
    375393
     394  /* control the mipmap levels */
     395  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, 5);
     396  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
     397
    376398  // build the MipMaps automaticaly
    377399  errorCode = gluBuild2DMipmaps(target, format,
     
    400422  glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    401423
    402   /* control the mipmap levels */
    403   glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, 5);
    404   glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
    405 }
     424}
  • trunk/src/lib/graphics/importer/texture.h

    r8145 r8312  
    5050  Texture();
    5151  Texture(const Texture& texture);
    52   Texture(GLenum target);
     52  Texture(GLenum target, unsigned int width, unsigned int height, unsigned int channels, GLenum type);
    5353  Texture(const std::string& imageName, GLenum target = GL_TEXTURE_2D);
    5454  Texture(SDL_Surface* surface, GLenum target = GL_TEXTURE_2D);
  • trunk/src/lib/gui/gl/glgui_cursor.cc

    r8309 r8312  
    3333    this->init();
    3434
    35     this->subscribeEvent(ES_MENU,  EV_MOUSE_MOTION);
    36     this->subscribeEvent(ES_MENU, EV_WINDOW_FOCUS);
     35    this->subscribeEvent(ES_ALL,  EV_MOUSE_MOTION);
     36    this->subscribeEvent(ES_ALL, EV_WINDOW_FOCUS);
    3737
    3838
  • trunk/src/lib/gui/gl/glgui_handler.cc

    r8145 r8312  
    4040
    4141
    42     EventHandler::getInstance()->withUNICODE(ES_MENU, true );
     42    EventHandler::getInstance()->withUNICODE(ES_ALL, true );
    4343
    4444    this->cursor = NULL;
    4545    for (unsigned int i = 0; i < EV_NUMBER; i++)
    4646    {
    47       this->subscribeEvent(ES_MENU, i);
     47      this->subscribeEvent(ES_ALL, i);
    4848    }
    4949  }
  • trunk/src/lib/gui/gl/glgui_widget.cc

    r8145 r8312  
    234234
    235235
     236
    236237  void GLGuiWidget::hide()
    237238  {
  • trunk/src/lib/gui/gl/glgui_widget.h

    r8148 r8312  
    5353    void show();
    5454    void hide();
    55 
    5655
    5756    void setParentWidget(GLGuiWidget* parent);
Note: See TracChangeset for help on using the changeset viewer.