I've heard that you need power of two texture dimensions for it to work in OpenGL. However, I've been able to load textures which are 200x200 and 300x300 (not powers of 2). Meanwhile when I tried to load a texture that is 512x512 (powers of two) with the same code but the data won't load (by the way I am using DevIL to load these pngs). I have not been able to find any thing that will tell me what type of dimensions will load. I also know that you can clip the textures and add borders but I don't know what the resulting dimensions should be.
Here is the load function:
void tex::load(std::string file)
{
ILuint img_id = 0;
ilGenImages(1,&img_id);
ilBindImage(img_id);
ilLoadImage(file.c_str());
ilConvertImage(IL_RGBA,IL_UNSIGNED_BYTE);
pix_data = (GLuint*)ilGetData();
tex_width = (GLuint)ilGetInteger(IL_IMAGE_WIDTH);
tex_height = (GLuint)ilGetInteger(IL_IMAGE_HEIGHT);
ilDeleteImages(1,&img_id);
//create
glGenTextures(1,&tex_id);
glBindTexture(GL_TEXTURE_2D,tex_id);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,tex_width,tex_height,0,GL_RGBA,GL_UNSIGNED_BYTE,pix_data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glBindTexture(GL_TEXTURE_2D,NULL);
}