• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

784 Good

About Aroidzap

  • Rank
  1. I think I will try to solve my problem another way... I don't want to make it messy. But thanks for help ;)
  2. ok... so... is it possible to push_back pointer to "temp" (create temp using some_class *temp = new some_class;) in array?
  3. Hi, I've got code like this :     std::vector<some_class> array; void pushback_function() {     some_class temp;     array.push_back(temp); }   Is it somehow possible to avoid calling destructor of temp
  4. Well...I've found that problem... I'm using GLEW... and I've forgotten to call glewInit(); 
  5. Will glTexImage2D work right for mipmapping? And one more thing... I just don't get, why this code works in one my app and in another not :/
  6. Hi, I can't figure out why this code throws me an exception. Can you help me?   TEXTURE LoadTexture(const char* file) {     TEXTURE texture; // GLuint texture, int width, int height     if ( IMG_Load(file) )     {         SDL_Surface* surface = IMG_Load(file);         GLuint tex;                  glGenTextures(1, &tex);         glBindTexture(GL_TEXTURE_2D, tex); THROWS EXCEPTION at this point -> glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, surface->w, surface->h);         glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, surface->w, surface->h, GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels);                  glGenerateMipmap(GL_TEXTURE_2D);         GLfloat maxAniso;         glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAniso);         glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAniso);         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);         texture.texture=tex;         texture.width=surface->w;         texture.height=surface->h;         SDL_FreeSurface(surface);     }     else     {         texture.texture=0;         texture.width=0;         texture.height=0;     }     return texture; }  
  7. Mipmaps

    ok thanks ;)
  8. Mipmaps

    Hi, what is typical number of mipmaps? (including base level)
  9. Hi :)   I don't know if it will work, but try this (I've used it somewhere) glEnable(GL_BLEND); glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_DST_ALPHA); :)
  10. VBO under WIn7 64bit

    Check your code for bad pointers. I expect you can have some glVertexAttribPointer() pointers fixed, where you have to use sizeof()
  11. UBO location

    Hi, is possible to use "layout (location = x)" for Uniform Block? I'm trying to make VAOs and UBOs independent on current Shader/Program.
  12. VBO data

    OK thanks ;)
  13. glDrawElements

    But some things i don't really get... when I'm drawing : [CODE]glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO_ID); glDrawElements(GL_TRIANGLES,Index_Count,GL_UNSIGNED_SHORT,NULL);[/CODE] 1) Why i'm binding IBO, why not VBO (is it possible to discard VBO id after generating buffer?) 2) Why is [b]const GLvoid *indices[/b] of glDrawElements set to NULL?
  14. VBO data

    Does anybody know? ie. can i speedup drawing by glDisableVertexAttribArray of unnecessary attributes?
  • Advertisement