procedure TForm1.InitElements; var Cesta : string; begin Cesta := ExtractFilePath(Application.ExeName); LoadBitmap(Cesta + 'Image1.bmp'); glBindTexture(GL_TEXTURE_2D, 0); glTexImage2d(GL_Texture_2D,0,3,Velikost,Velikost,0,GL_RGB,GL_Unsigned_byte,@buffer); //pozice bodu 1 VertexPointer[0].X := -1; VertexPointer[0].Y := 1; VertexPointer[0].Z := 0; //texturova koordinace bodu 1 CoordPointer[0].S := 1; CoordPointer[0].K := 1; //identifikace bodu 1 Indices[0] := 0; //pozice bodu 2 VertexPointer[1].X := 1; VertexPointer[1].Y := 1; VertexPointer[1].Z := 0; //texturova koordinace bodu 2 CoordPointer[1].S := 0; CoordPointer[1].K := 1; //identifikace bodu 2 Indices[1] := 1; //pozice bodu 3 VertexPointer[2].X := -1; VertexPointer[2].Y := -1; VertexPointer[2].Z := 0; //texturova koordinace bodu 3 CoordPointer[2].S := 1; CoordPointer[2].K := 0; //identifikace bodu 3 Indices[2] := 2; //druhy trojuhelnik VertexPointer[3].X := -1; VertexPointer[3].Y := -1; VertexPointer[3].Z := 0; CoordPointer[3].S := 1; CoordPointer[3].K := 0; Indices[3] := 3; VertexPointer[4].X := 1; VertexPointer[4].Y := 1; VertexPointer[4].Z := 0; CoordPointer[4].S := 0; CoordPointer[4].K := 1; Indices[4] := 4; VertexPointer[5].X := 1; VertexPointer[5].Y := -1; VertexPointer[5].Z := 0; CoordPointer[5].S := 0; CoordPointer[5].K := 0; Indices[5] := 5; glEnableClientState(GL_COLOR_ARRAY); //aktivuje pole barev glEnableClientState(GL_VERTEX_ARRAY); //aktivuje pole bodu glEnableClientState(GL_TEXTURE_COORD_ARRAY); //aktivuje pole texturovych koordinaci glColorPointer( 4, GL_UNSIGNED_BYTE, 0, @Buffer ); //nacte pole barev glTexCoordPointer(2, GL_FLOAT, 0, @CoordPointer); //nacte pole texturovych koordinaci glVertexPointer(3, GL_FLOAT, 0, @VertexPointer); //nacte pole bodu end; procedure TForm1.DrawElements; begin glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, @Indices); //zobrazi vysledny objekt end;