Voila je commence en visual c++ et je voudrais tracer des lines mais sa marche pas donc est ce que vous pouvez m'aider?
voila mon code:
#include "graphics.h"
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define PI 3.14116
void Initialize(void);
void main()
{
int MaxX,MaxY;
Initialize();//initialisation du mode graphique
MaxX = 100;
MaxY = 180;
//tracer de deux axes
moveto(MaxX/2,0);
lineto(MaxX/2,MaxY);
moveto(0,MaxY/2);
lineto(MaxX,MaxY/2);
//se positionner en 0,MaxY/2
moveto(0,MaxY/2);
getch();
closegraph(); //arrêt du mode graphique
}
void Initialize(void)
{
int GraphDriver; /* The Graphics device driver */
int GraphMode; /* The Graphics mode value */
int ErrorCode; /* Reports any graphics errors */
GraphDriver = DETECT; /* Request auto-detection */
initgraph( &GraphDriver, &GraphMode, "" );
ErrorCode = graphresult(); /* Read result of initialization*/
if( ErrorCode != grOk )
{ /* Error occured during init */
printf(" Graphics System Error: %s\n", grapherrormsg( ErrorCode ) );
exit( 1 );
}
}
MAIS SA NE MARCHE PAS!!!!!!