png error stuff, not sure libpng man suggests this. Png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL) Png_infop end_info = png_create_info_struct(png_ptr) Png_destroy_read_struct(&png_ptr, (png_infopp) NULL, (png_infopp) NULL) Png_infop info_ptr = png_create_info_struct(png_ptr) Png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, GLuint loadTexture(const string filename, int &width, int &height)įILE *fp = fopen(filename.c_str(), 'vtr.png') The function it took from opengl’s wiki looks this, with my global includes and such: So i started by taking the sample loading function for libpng directly from opengl’s wiki page. I’v googled for days through other peoples posts and tutorials but to no avail. After searching different libraries that can load.