   Cant get textures to draw
  Hey ive just recentlystarted with openGL and SDL and am having trouble drawing textures to a 2D quad. I have this quick unefficient but just for texting purposes Texture class: class Texture{    private:    public:    GLuint theTexture;    Texture();    ~Texture();    void enableTexture();    void loadTexture_BMP(std::string filename);};Texture::Texture(){   std::cout << "Texture created" << std::endl;}Texture::~Texture(){}void Texture::enableTexture(){    glBindTexture(GL_TEXTURE_2D,theTexture);}void Texture::loadTexture_BMP(std::string filename){    SDL_Surface* temp = SDL_LoadBMP(filename.c_str());std::cout << "SDL_SURFACE loaded" << std::endl;    glGenTextures(1,&theTexture);    glBindTexture(GL_TEXTURE_2D, theTexture);    glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,temp->w,temp->h,0,GL_RGB,GL_UNSIGNED_BYTE,temp->pixels);    std::cout << "Texture loaded" << std::endl;    SDL_FreeSurface(temp);}yet when I go to draw it with this:void myRect::Draw(){    glEnable(GL_TEXTURE_2D);    tex.enableTexture();    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);    glEnable2D();  glBegin(GL_QUADS);  glTexCoord2f(0.0f,0.0f);  glVertex2d(points[0].x,points[0].y);   glTexCoord2f(1.0f,0.0f);  glVertex2d(points[1].x,points[1].y);   glTexCoord2f(1.0f,1.0f);  glVertex2d(points[2].x,points[2].y);   glTexCoord2f(0.0f,1.0f);  glVertex2d(points[3].x,points[3].y);   glEnd();  glDisable2D();}this does not work. Anyone know why? I have made a call to load the texture inside the myRect class but its alot of code to paste.Thanks Catkill   
  What's happening? Do you get a black quad? White quad? Nothing?Also you're setting min_filter twice, I assume you meant one of those to be mag_filter. Though this shouldn't be your problem because mag_filter defaults to GL_LINEAR anyway.Everything looks right to me after a quick look.   ;  Actually what the other guy said is wrong and right. You have to set valid texture parameters before using a texture, you must set the texture min/max filters.   ;  I disagree, I believe what I said was correct. The reason textures don't work out of the box if you don't set the filters is because they default to the following values (according to red book):GL_TEXTURE_MIN_FILTER: GL_NEAREST_MIPMAP_LINEARGL_TEXTURE_MAG_FILTER: GL_LINEARSetting the mag filter to GL_LINEAR does nothing if it already defaults to GL_LINEAR. The problem is that the min filter default requires mipmaps to be built. ;  I get a white quad drawn on a black background thats all no texture. The create texture function is called as my std::cout says the function is called and the texture loaded. the texture is in the binary folder and the main project folder and I checked spelling.   ;  Check if SDL_LoadBMP() returns NULL.   ;  It is returning null...but why?   ;  It probably can't find the file. Try placing it in a "simple" place (like c:) and specifying the full path ("c:/myimage.bmp").   ;  Still coming up NULL....weird.   ;  If texture class does not have the opengl context glGenTextures will not work.   