Jump to content
Remember me This is not recommended for shared computers
Sign in anonymously Don't add me to the active users list
Aroidzap hasn't added any contacts yet.
29 January 2013 - 12:43 PM
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
26 January 2013 - 03:03 AM
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; }
19 January 2013 - 02:58 AM
Hi, what is typical number of mipmaps? (including base level)
14 August 2012 - 01:20 AM
12 August 2012 - 02:17 AM