Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8089 in orxonox.OLD for branches/water/src/lib


Ignore:
Timestamp:
Jun 1, 2006, 5:24:57 PM (18 years ago)
Author:
stefalie
Message:

water: gui hack

Location:
branches/water/src/lib
Files:
7 edited

Legend:

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

    r8037 r8089  
    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))
  • branches/water/src/lib/graphics/importer/texture.cc

    r7790 r8089  
    115115
    116116
    117 Texture::Texture(GLenum target)
     117Texture::Texture(GLenum target, unsigned int width, unsigned int height, unsigned int channels, GLenum type)
    118118{
    119119  this->init();
    120   GLuint texture;
     120  GLuint texture = 0;
    121121  Texture::generateTexture(texture, target);
     122
     123  glBindTexture(target, texture);
     124
     125  unsigned int* pixels = new unsigned int[width * height * channels];
     126  memset(pixels, 0, width * height * channels * sizeof(unsigned int));
     127 
     128 
     129  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
     130  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
     131  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     132  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     133
     134  glTexImage2D(target, 0, channels, width, height, 0, type, GL_UNSIGNED_INT, pixels);
     135 
     136 
     137 
     138  delete[] pixels;
     139
    122140  this->data->setTexture(texture);
    123141}
     
    346364  //  printf("%s, w:%d h:%d, 0x%x\n", this->getName(), surface->w, surface->h, target);
    347365
     366  /* control the mipmap levels */
     367  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, 5);
     368  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
     369
    348370  // build the MipMaps automaticaly
    349371  errorCode = gluBuild2DMipmaps(target, format,
     
    372394  glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    373395
    374   /* control the mipmap levels */
    375   glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, 5);
    376   glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
    377 }
     396}
  • branches/water/src/lib/graphics/importer/texture.h

    r7790 r8089  
    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);
  • branches/water/src/lib/gui/gl_gui/glgui_cursor.cc

    r8035 r8089  
    3232    this->init();
    3333
    34     this->subscribeEvent(ES_MENU,  EV_MOUSE_MOTION);
    35     this->subscribeEvent(ES_MENU, EV_WINDOW_FOCUS);
     34    this->subscribeEvent(ES_ALL,  EV_MOUSE_MOTION);
     35    this->subscribeEvent(ES_ALL, EV_WINDOW_FOCUS);
    3636
    3737
  • branches/water/src/lib/gui/gl_gui/glgui_handler.cc

    r8035 r8089  
    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  }
  • branches/water/src/lib/gui/gl_gui/glgui_widget.cc

    r8035 r8089  
    204204
    205205
     206
    206207  void GLGuiWidget::hide()
    207208  {
  • branches/water/src/lib/gui/gl_gui/glgui_widget.h

    r8035 r8089  
    4242    void show();
    4343    void hide();
    44 
    4544
    4645    void setParentWidget(GLGuiWidget* parent);
Note: See TracChangeset for help on using the changeset viewer.