C/C++
installuserdriver()

#include <graphics.h>

int farinstalluserdriver()


char far *name
int huge(*detect)(void)


BGI

. BGI . name - (.BGI) , detect , . .

, . , Spiffy Graphic Array (SGA) SGA BGI- (SGA.BGI). installuserdriver, ( ) initgraph.

, , initgraph (, SGA ). installuserdriver, .

SGA- , initgraph . initgraph (detectgraph), SGA- . SGA- SGA, -11 (grError), initgraph , ). , , , SGA , ; initgraph SGA.BGI, , , , , .

.

installuserdriver , initgraph , .

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int huge detectEGA(void);
void checkerrors(void);

int main(void)
{
	int gdriver,gmode;
	gdriver = installuserdriver("EGA",detectEGA);	/*  ,
							 */
	gdriver = DETECT;		// 
	checkerrors();			//   
	initgraph(&gdriver,&gmode,"");	//    
	checkerrors();			//   
	line(0,0,getmaxx(),getmaxy());	// 
	getch();
	closegraph();
	return 0;
}

/*   EGA  VGA */
int huge detectEGA(void)
{
	int driver, mode, sugmode = 0;
	detectgraph(&driver,&mode);
	if((driver == EGA) || (driver == VGA))
        	return sugmode;	//   
	else
		return grError;	//  
}

/*       */
void checkerrors(void)
{
	int errorcode;
	errorcode = graphresult();
	if(errorcode != grOk)
	{
		printf("  %s\n",grapherrormsg(errorcode));
		printf("    ... ");
		getch();
		exit(1);
	}
}







Нет комментариев.



Оставить комментарий:
Ваше Имя:
Email:
Антибот: *  
Ваш комментарий: