I want to display only a inner rectangle region from an image.I tryed this code, but it doesn’t do the trick.
GLubyte *pData;
GLint pwidth;
GLint pheight;
GLubyte *pData;
GLint pwidth;
GLint pheight;
GLenum format;
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
pData=LoadTGA(“Baner3.tga”,&pwidth,&pheight,&format);
glClear(GL_COLOR_BUFFER_BIT);
glRasterPos2i(0,0);
glPixelStorei(GL_UNPACK_SKIP_ROWS,32);
glPixelStorei(GL_UNPACK_SKIP_PIXELS,32);
glDrawPixels(pwidth/2,pheight/2,format,GL_UNSIGNED_BYTE,pData);
glutSwapBuffers();