c++ - Access violation when calling glTextureParameteri with OpenGL and DevIL -


I'm trying to load an image from the devil and then make a texture. I have a code named Texture , and I am doing all this in the constructor, a valid reference has been made. I have an access violation on the first call to glTextureParameteri () , so I think the texture did not tie properly. I do not see any reason why it does not bind.

Here's the creator:

  Texture :: Texture (constant std :: string & file name) {// handle for unsigned image unsigned int ilID; ILJenizays (1, and IIILID); IlBindImage (ILID); IlEnable (IL_ORIGIN_SET); IlOriginFunc (IL_ORIGIN_LOWER_LEFT); If (! IlLoad (IL_BMP, (ILstring) filename.c_str ())) {DebugUtility :: gl_log_err (;, filename.c_str) "s \ n Failed to load image &"); // Just print that to return the log file; } ILconvert image (IL_RGBA, IL_UNSIGNED_BYTE); Glenn Texture (1, and Texture); // "texture" is global gluent-glibinated (GL_TEXTURE_2D, texture); // The reason behind the violation of the bottom line! Glaciationsparametry (GL_digitanti.dd, gl_white_wp_spe_s, glupet); Gleetextensions parametarium (GL_digitantiDD, GL_WAVER_WAPS_S, GLUPET); Glitchespametaph (GL_digitantiDD, GL_ITORUIR_MIN_Filter, GL_LNIAR); Gleetshek Parmethef (GL_EducationEndy, GL_ITTech_MG_Filler, GL_LNIAR); GlTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, ilGetInteger (IL_IMAGE_WIDTH), ilGetInteger (IL_IMAGE_HEIGHT), 0, GL_RGBA, GL_UNSIGNED_BYTE, ilGetData ()); IDelight Images (1, and IIILID); // Then, print the file DebugUtility: gl_log ("succefully loaded and made texture% s", filename.c_str ()); }  

ilLoad Returns are correct, because if the block is not executed within that code. Here is an error (I'm using Visual Studio 2013):

Unsupported exception to 0x74E1CB49 in Project SDL.XA: 0xC0000005: 0x00000000 violation of location execution.

itemprop = "text">

function glTextureParameteri () is an extension, using Try glTexParameteri () and an active texture unit binding Glitchweighttextex (GL_charcher 0) . glTextureParameteri () also does not expect texture ID, no targets


Comments