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

Messages - Raigen

#1
Thanks this helped :)

Code: ags

#define WIN32_LEAN_AND_MEAN
#include <allegro.h>
#include <winalleg.h>
#include <winsock2.h>
#include <string>

#define THIS_IS_THE_PLUGIN
#include "agsplugin.h"



But if I only took <winalleg.h>
then the errors says add <allegro.h> before <winalleg.h> :)

Code: ags
#include <allegro.h>
#include <winalleg.h>


Thank you very much
Raigen
#2
Hi,

here are the listed errors after I've build the project

Code: ags

#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <string>

#include "allegro.h"

#define THIS_IS_THE_PLUGIN
#include "agsplugin.h"

...

The include itself does not produce any error, but when building the solution the following errors occur:

in english:
Quote
Error   1   error C2371: 'BITMAP' : redefinition; different basic types   d:\allegro\include\allegro\system.h   31
Error   2   error C2731: 'WinMain' : function cannot be overloaded   d:\allegro\include\allegro\platform\alwin.h   49
Error   3   error C2733: second C linkage of overloaded function 'WinMain' not allowed   d:\allegro\include\allegro\platform\alwin.h   49
   5   IntelliSense: cannot open source file "base.h"   d:\allegro\include\allegro\system.h   22
   7   IntelliSense: cannot open source file "config.h"   d:\allegro\include\allegro\system.h   24
   6   IntelliSense: cannot open source file "unicode.h"   d:\allegro\include\allegro\system.h   23
   4   IntelliSense: more than one instance of overloaded function "WinMain" has 'C' linkage   d:\allegro\include\allegro\platform\alwin.h   49


in german:
Quote
Fehler   1   error C2371: 'BITMAP': Neudefinition; unterschiedliche Basistypen   d:\allegro\include\allegro\system.h   31
Fehler   2   error C2731: 'WinMain': Überladen der Funktion nicht möglich   d:\allegro\include\allegro\platform\alwin.h   49
Fehler   3   error C2733: Zweite C-Bindung für überladene Funktion 'WinMain' nicht zulässig   d:\allegro\include\allegro\platform\alwin.h   49
   5   IntelliSense: Die Datei "Quelle" kann nicht geöffnet werden: "base.h".   d:\allegro\include\allegro\system.h   22
   7   IntelliSense: Die Datei "Quelle" kann nicht geöffnet werden: "config.h".   d:\allegro\include\allegro\system.h   24
   6   IntelliSense: Die Datei "Quelle" kann nicht geöffnet werden: "unicode.h".   d:\allegro\include\allegro\system.h   23
   4   IntelliSense: Mindestens eine Instanz der überladenen Funktion ""WinMain"" weist eine "C"-Verknüpfung auf.   d:\allegro\include\allegro\platform\alwin.h   49
#3
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

#4
Thank you very much for the fast answer :)

I will start to do this plugin within the next weeks and will provide information for those who are interested in this.
I hope I get it to work, without big problems

But I'm always open for suggestions and idea's :)

Best Regards
Raigen
#5
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