Mi da come errori
c:\codeblocksdv2\mingw\bin\..\lib\gcc\i686-mingw32\4.4.5\..\..\..\..\include\allegro\gfx.h|276|error: conflicting types for 'BITMAP'|
c:\codeblocksdv2\mingw\bin\..\lib\gcc\i686-mingw32\4.4.5\..\..\..\..\include\wingdi.h|1356|note: previous declaration of 'BITMAP' was here|
D:\Codeblocks\Allegro2\Untitled1.c|58|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'con_takexy'|
D:\Codeblocks\Allegro2\Untitled1.c|83|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'con_colorset'|
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include "allegro.h"
//ritorna handle console
HWND con_gethwnd()
{
char ct[80];
GetConsoleTitle(ct,80);
return FindWindow(NULL,ct);
}
//setta il buffer dei caratteri(quanti caratteri maniene memorizzati nelle colonne e righe
void con_setbuffercr(short c,short r)
{
HANDLE hconsole;
if ( (hconsole=GetStdHandle(STD_OUTPUT_HANDLE)) == INVALID_HANDLE_VALUE ) return;
COORD co;
co.X=c;
co.Y=r;
SetConsoleScreenBufferSize(hconsole,co);
}
//setta la dimensione della console in base al numero di caratteri in colonne e righe
//a differenza delle altre finestre non si lavora in pixel per la dimensione.
void con_setwincr(short c,short r)
{
HANDLE hconsole;
if ( (hconsole=GetStdHandle(STD_OUTPUT_HANDLE)) == INVALID_HANDLE_VALUE ) return;
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(hconsole,&csbi);
csbi.srWindow.Left = 0;
csbi.srWindow.Top = 0;
csbi.srWindow.Right=c;
csbi.srWindow.Bottom=r;
SetConsoleWindowInfo(hconsole,TRUE,&csbi.srWindow);
}
//setta la dimensione della finestra ed i numero dei caratteri che si possono inserire è
//uguale alla dimensione della finestra,quindi nessuno scroll possibile.
void con_setwball(short c,short r)
{
con_setbuffercr(c,r);
con_setwincr(c-1,r-1);
}
void con_gotoxy (short x,short y)
{
HANDLE hconsole;
if ( (hconsole=GetStdHandle(STD_OUTPUT_HANDLE)) == INVALID_HANDLE_VALUE ) return;
COORD coord = {x, y};
SetConsoleCursorPosition (hconsole,coord );
}
void DLL_EXPORT con_takexy(int *x,int *y)
{
HANDLE hconsole;
if ( (hconsole=GetStdHandle(STD_OUTPUT_HANDLE)) == INVALID_HANDLE_VALUE ) return;
CONSOLE_SCREEN_BUFFER_INFO con;
if (GetConsoleScreenBufferInfo(hconsole,&con))
{
*x = con.dwCursorPosition.X;
*y = con.dwCursorPosition.Y;
}
}
void con_cls()
{
HANDLE hconsole;
if ( (hconsole=GetStdHandle(STD_OUTPUT_HANDLE)) == INVALID_HANDLE_VALUE ) return;
CONSOLE_SCREEN_BUFFER_INFO csbi;
const COORD startCoords = {0,0};
DWORD dummy;
GetConsoleScreenBufferInfo(hconsole,&csbi);
FillConsoleOutputAttribute(hconsole,0,csbi.dwSize.X * csbi.dwSize.Y,startCoords,&dummy);
FillConsoleOutputCharacter(hconsole,' ',csbi.dwSize.X * csbi.dwSize.Y,startCoords,&dummy);
con_gotoxy(0,0);
}
void DLL_EXPORT con_colorset(unsigned short color)
{
HANDLE hconsole;
if ( (hconsole=GetStdHandle(STD_OUTPUT_HANDLE)) == INVALID_HANDLE_VALUE ) return;
SetConsoleTextAttribute(hconsole,color);
}