Posted: 30th Jul 2021 4:26
Interpreter: Core.cpp line 971

+ Code Snippet
		// initialise graphics API for app
		agk::InitGraphics( (void*) hWnd, App.m_sProgram.GetRendererMode(), App.m_sProgram.GetFlags() );
		//agk::InitGraphics( (void*) hWnd, AGK_RENDERER_MODE_ONLY_LOWEST, 0 );
		g_bAGKInitialised = true;


Template vs2015: Core.cpp line 913
+ Code Snippet
	// initialise graphics API (win32 openGL) for app
		agk::InitGraphics( (void*) hWnd, AGK_RENDERER_MODE_PREFER_BEST, 0 ); // Vulkan then OpenGL
		//agk::InitGraphics( (void*) hWnd, AGK_RENDERER_MODE_ONLY_LOWEST, 0 ); // OpenGL only
		g_bAGKInitialised = true;


What local version do you have?

I just checked both Classic and Studio tier 2 files and they both the same

Edit: No, I stand corrected, it is InitGL in Classic you are right.

Edit2: I will have another crack at this tomorrow, with the right libs this time, a silly oversight there on my part!
Posted: 30th Jul 2021 4:30
See above, I've attached the studio symbols from "AppGameKit Studio\Tier 2\platform\windows\Lib\VS2015\Release"
Posted: 30th Jul 2021 4:33
Super cool, thanks for your help, I'll post my results

Thanks Adam
Posted: 31st Jul 2021 22:14
Awesome !!!
if you need any help or have any questions, you can contact cmgo whenever you can. .
Posted: 1st Aug 2021 10:40
Great tutorial. Thanks for posting
Posted: 8th Aug 2021 0:26
with the wrapper you made is it possible to send and receive any information from the AppGameKit application through the plugin?
Posted: 8th Aug 2021 16:31
Could you be more specific... sending information between ... is exactly what plugins do.

I don't understand the question?
Posted: 9th Aug 2021 3:17
sorry for not being specific, taking the opportunity, I have 2 questions to ask

Question 1: a few weeks ago I was looking for ways to "protect and encrypt" my assets in agk tier 1, so I decided to make a "raw" example, packaging an image inside a purebasic DLL, and trying to import it into AppGameKit before I could create an image encryption algorithm to protect them ... Is there anything I can do about it using the Plugin Wrapper you created above?
this is the topic i created asking : https://forum.thegamecreators.com/thread/227684

Question 2:
besides the asset protection issue, I would also like to know if with the wrapper you created, I can control assets position, create or destroy entities such as: music, sprites, meshs, and others...
because I would like to create a Thread inside the DLL made in purebasic (Plugin) that starts a "Socket Client" so that I can send and receive information from a server asynchronously

example : if i send a string message > :
+ Code Snippet
createSprite:spriteimg.png:100:100


through the plugin made in purebasic imported into AppGameKit, the game AppGameKit would create a sprite asynchronously through external messages...

I hope I conveyed my questions well. I am very grateful for your attention
Posted: 10th Aug 2021 16:46
Sure the framework is capable of doing all that, you have access to all AppGameKit functions inside your plugin code thats what the wrapper is for.

As for protecting assets, PB has a packer and a cypher lib, you could certainly code a entity encryption system but bear in mind that that protected asset had to be unprotected at some point for agk to load it, you could rip them to memory and encrypt then load in on a memblock, you dont need a plugin for this you can code that in basic look at [href=https://forum.thegamecreators.com/thread/220121]WadPacker
[/href]

And the server creating the sprites, sure, just setup a messaging system, the server does not actually call the sprite create function it sends a command to the client to create the sprite.

for a messaging system you want low latency which usually means DONT SEND STRINGS

CONST_CREATE_SPRITE = 100
CONST_IMAGE_A = 101

setup some constants that both the server and client understand CONST_CREATE_SPRITE|CONST_IMAGE_A|100|100|

and send as data, 4 ints travel the net a lot faster than a long ass string, do some bit shifting to make longs you now have 2 longs with HI and LO words.

But, yea, everything you ask is possible with the plugin framework
Posted: 11th Aug 2021 1:42
it's wonderful to know that!!

thank you for solving my doubts, but i still have a question about how to manipulate memories allocated in purebasic, with the agk memblocks

"


would you have any example of how i could import the image through a memblock in agk from a memory allocated from pb ?

in this topic >: https://forum.thegamecreators.com/thread/227684 i packaged an image inside the Plugin.dll, and the pb returns the allocated memory of the image, can I display it in AppGameKit?
Posted: 11th Aug 2021 15:02
I have not tried to load embedded resources in AppGameKit but I do this often in PB, use ImportFile in a data section and then catchImage ... from there I am not quite sure what AppGameKit does with the image I would need to look at the core source but I would hazard a guess and say its a hBitMap GDI+ conversion (thats how I'd do it)

I'll take a poke round the source...
Posted: 16th Aug 2021 5:16
can i inject a memory with a png image inside a memblock in AppGameKit ?
Posted: 3rd Oct 2021 22:24
@PartTimeCoder

How do we know what to put and how to put it in the text file that is with the dll's in AppGameKit directory? What is the format how it goes in the txt file? Is it from what I see in the command.txt files in each plugin, the top line is the same and everything underneath is the commands with their parameters after that on each line. Is this correct?

Also, I have notice that your CL plugin for AppGameKit doesn't have the function listed below anywhere in the code. Do we have to have the function to use our own created plugins in AppGameKit or not?

+ Code Snippet
PrototypeC _GetAGKFunction(Function.p-ascii)

ProcedureCDLL ReceiveAGKPtr(*GetFunction)

 GetAGKFunction._GetAGKFunction=*GetFunction

EndProcedure


Of course I do see that there is an #IncludeFile statement at the top of your code, so do that mean you do have to have that particular function above in your code to activate any created plugin and we can just add #IncludeFile sources to add other stuff from PB to it. Or can we activate any plugin from PB any way we can/need to to use in AppGameKit and not have to use that particular function?