Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 30 Apr 2012
Offline Last Active Jan 12 2016 04:47 PM

Topics I've Started

C++ how to avoid calling destructor

29 January 2013 - 12:43 PM

Hi, I've got code like this :



std::vector<some_class> array;

void pushback_function()
    some_class temp;


Is it somehow possible to avoid calling destructor of temp

Loading Texture (SDL surface to OpenGL)

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, 

        GLfloat maxAniso;
        glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAniso);
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAniso);


    return texture;


19 January 2013 - 02:58 AM

Hi, what is typical number of mipmaps? (including base level)

UBO location

14 August 2012 - 01:20 AM

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 August 2012 - 02:17 AM

glDrawElements gives me an exception. All parameters are accessible. I have no idea what to do and where to start.