Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Raigen

#1
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:

  • 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:
Code: agsp300speller.dll Plugin

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

#2
Hello AGS Community,

First of all, I apologize for my probably bad english, I dont have much practice.

I'm currently on research for my master thesis at the goethe university in frankfurt, germany.
I have to enhance an open source point & click game engine(AGS seems for me to be the best choice) with bci control features.
That it is possible to control a game with a brain computer interface using event related potential (P300 Signals) for simple yes/no or target/notarget answers
To find out if a button/object should be selected/used/etc.. or not

For a better impression how a P300 Speller works, you should take a look at this Youtube video.
http://www.youtube.com/watch?v=08GNE6OdNcs

In a likewise manner the interactable objects/buttons should be flashing in the game, to select one.
Either each object alone or in rows/columns as seen in the video.
The decision which objects or which row/column flashes in which order comes from the BCI2000 platform and the BCI Headset
that it can match the Signals gained from the BCI with the flashing objects.
To communicate with external applications the BCI2000 has an external application interface for communication via UDP.

My question is:

Could I realize it with an AGS Engine Plugin or also with an AGS Editor plugin?
I can't estimate it, because I don't have much experience with AGS (and unfortunetaley C++, but much with C# and java) yet.

I know these kind of Point & Click Games are a bit limited and could take a long time to play,
but the target group of such BCI games are poeple with motor disorders.



I'm very thankful for each help.

Thank you in advance
Raigen :)

SMF spam blocked by CleanTalk