1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
unit testtextures;
interface
uses
SysUtils,
OPENGL,
glfw,
SDLUtils,
glaux,
Textures;
procedure initialisation();
implementation
procedure initialisation();
var
jouer: boolean;
fond: GLuint;
begin
jouer:=TRUE;
while (jouer) do
begin
//initialisation de la fenetre OPENGL
glfwInit();
glfwOpenWindow(1000, 700, 0, 0, 0, 0, 42, 0, GLFW_WINDOW);
glfwSetWindowTitle('Moteur'); // optionnel
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
glClearColor( 0.0, 0.0, 0.0, 0.0 );
glClear(GL_COLOR_BUFFER_BIT Or GL_DEPTH_BUFFER_BIT);
glEnable( GL_DEPTH_TEST );
glEnable(GL_TEXTURE_2D);
LoadTexture('fond.jpg', fond, FALSE);
glViewPort(0, 0, 1000, 700);
glMatrixMode(GL_PROJECTION);
gluperspective(70,(640/480),1,100);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
gluLookAt(10, 0, 10, -5, 0,0, 0, 0, 1);
glLoadIdentity;
glBindTexture(GL_TEXTURE_2D, fond);
glpushmatrix();
glBegin(GL_QUADS);
glTexCoord2f(0,1);glVertex3f(0,0,0);
glTexCoord2f(0,0);glVertex3f(0,1,0);
glTexCoord2f(1,0);glVertex3f(0,1,1);
glTexCoord2f(1,1);glVertex3f(1,0,1);
glEnd;
glpopmatrix();
glfwSwapBuffers();
jouer := glfwGetKey(GLFW_KEY_ESC) = 0;
end;
end;
end. |
Partager