Hello Guys,
I'm working on a Engine Plugin and I want to send an Allegro BITMAP which I get using "engine->GetScreen()" via TCPIP to another program.
I want to do the following steps:
I need help at the first point, but feel free to provide some suggestions or tipps for the others, too.
(Because I'm still learning C++)
Therefore I need to know how can I use allegro within an ags engine plugin using Visual C++ Express 2010 (on Win7 x86 OS running currently on a virtual machine)
I tried to include the allegro libraries as in many tutorials described, but when I used #include <allegro.h> it did not work and produced errors.
I think the main difference is that I dont want to use allegro to develope a game, but to get access to the mentioned function(s).
I have allegro-msvc10-4.2.3.7z used in my tries to get it work, but without success.
The code of the current method is shown below:
Code: agsp300speller.dll Plugin
----------
If someone is wondering why I send the current game screen to the target program,
this is because the target program does critical work in realtime on this screen, before continuing the game progress.
the result would be a switching between the programs active/idle states.
Thanks in advance
Raigen
I'm working on a Engine Plugin and I want to send an Allegro BITMAP which I get using "engine->GetScreen()" via TCPIP to another program.
I want to do the following steps:
- Convert Allegro BITMAP to HBITMAP using convert_bitmap_to_hbitmap (DDB)
- Convert the result Bitmap to something like a base64 string and send it to the target program
- Convert the base64 back to Bitmap or better directly to a QBitmap, QPixmap etc, because the target program uses Qt
I need help at the first point, but feel free to provide some suggestions or tipps for the others, too.
(Because I'm still learning C++)
Therefore I need to know how can I use allegro within an ags engine plugin using Visual C++ Express 2010 (on Win7 x86 OS running currently on a virtual machine)
I tried to include the allegro libraries as in many tutorials described, but when I used #include <allegro.h> it did not work and produced errors.
I think the main difference is that I dont want to use allegro to develope a game, but to get access to the mentioned function(s).
I have allegro-msvc10-4.2.3.7z used in my tries to get it work, but without success.
The code of the current method is shown below:
const char * RequestSpellerMatrixResult(int matrixLeft, int matrixTop, int matrixWidth, int matrixHeight, int rows, int columns, int resolutionWidth, int resolutionHeight)
{
// Get the Screen
BITMAP* screen = engine->GetScreen();
// creating the parameter string
sprintf_s(spellerParams, "%d;%d;%d;%d;%d;%d;%d;%d\0", matrixLeft, matrixTop, matrixWidth, matrixHeight, rows, columns, resolutionWidth, resolutionHeight);
// sending the parameters
send(sock, spellerParams, strlen(spellerParams), 0);
// sending screen bitmap
// TODO
// receive requested SpellerMatrixResult
long end = recv(sock, spellerResult, 20, 0);
spellerResult[end] = '\0';
return engine->CreateScriptString(spellerResult);
}
----------
If someone is wondering why I send the current game screen to the target program,
this is because the target program does critical work in realtime on this screen, before continuing the game progress.
the result would be a switching between the programs active/idle states.
Thanks in advance
Raigen