PDA

View Full Version : TEXTURE



08-01-2005, 05:27 PM
where is the misitake ?
Uses tex,wingraph,crt,gl,glu,glut;
const poly1=1;
var poly:array[1..100]of GLuint;
img:texture;
Procedure Init;
Begin
SetOpenGlMode(DirectOn);

TexLoad('mop.tex',img);
getmem(TBuf,mx*my*3);
tBuf:=@img;

GLClearColor(0,0,0,0);
GLClear (GL_Color_Buffer_bit OR gl_dEPTH_buffer_bit);
glOrtho(0.0,1.0,0.0,1.0,-1.0,1.0);

end;
Procedure Draw;
Begin
{poly[1]:=1;}
GLNewList(poly1,GL_Compile);
GLBegin(GL_POLYGON);
GLColor4f(1.0,1.0,1.0,1.0);
GLVertex3f(0.25,0.25,0.0);
GLVertex3f(0.75,0.25,0.0);
GLVertex3f(0.75,0.75,0.0);
GLVertex3f(0.25,0.75,0.0);
GLEnd();
GLEndList;
GLFlush();
end;
Begin
InitGraph(d8bit,m640x480,'TEXTURE TEST 1');
init;
draw;
GLCallList(Poly1);
updategraph(updatenow);
if REadkey=#27 then
Begin
halt;
closegraph;
end;
end.

08-01-2005, 05:47 PM
here you can find a screenshot of the result : http://www.testimg.20m.com

08-01-2005, 06:39 PM
by the way img it's an [0..256,0..256,0..2]array
is it correct ?
any help would be very appreciated !