Gmapi, Library for VC++ that is helpful in writing DLLs for GM |
This forum provides a place to post your Dlls, Scripts, Libraries and Extensions for GM. Be sure to read these rules prior to posting. The guidelines for each sub-forum are pinned at the top of that forum.
![]() ![]() |
Gmapi, Library for VC++ that is helpful in writing DLLs for GM |
Apr 22 2009, 02:25 PM
Post
#1
|
|
|
GMC Member Group: GMC Member Posts: 22 Joined: 2-December 07 From: Poland Member No.: 94338 |
Last update: 17 may 2009
Current version: 0.4 About...
Using the library
InitializationBefore you'll begin to work with the library You must include gmapi.h header to one of the source files in Your project. If You don't have DirectX SDK installed define GMAPI_NO_D3D before including gmapi.h (D3D interfaces will be defined as void), thus this will look like: Calling GM functionsWhen GMAPI is initialized You can now call GM functions from the DLL. All functions are nicely wrapped in the library so You can call them in a simple way, take a look: Accessing game resourcesNotes:You can access them by a three ways: with GM functions of course (least efficent, less possibilities), by GM's structures that I've analyzed in runner and with "accessing classes" defined in GMAPI. Using structures is most efficent and equally unsafe, I'll explain how to use them in a documentation that I'll write later. Meanwhile, You can use the classes I mentioned - they're safer and easier to use than using the GM's structures. Why I called them "accessing" (wtf) ? Well, they're operating entirely on runner's memory, what is also reason why using them is somewhat entangled. In CGMAPI class there are some objects of these classes defined: Sprites (ISprites class), Backgrounds (IBackgrounds), Sounds (ISounds), Surfaces (ISurfaces) and Scripts (IScripts). All of these classes shares some methods that can retrieve various data that is relevant to respective GM resource type (for example, GetID() returns an ID of specified resource by given name of this type, GetCount() returns number of resources of this type) and all of them have an array operator ("[]") overloaded that returns reference type to next "accessing classes" - these classes gives You access to resource with ID specified in brackets. Damn, hard to explain... so, for example: As I mentioned before, I'll write a documentation later. Meanwhile, You have to rely on IntelliSense, comments in GmapiInternal.h header file and on 3 crappy examples I wrote ;p In GMAPI there are also constants from GM. Of course please report all bugs You've found - project is still in testing stage.Download:
DLLs that uses GMAPI: Advanced console by TheMagicNumber This post has been edited by Snake_PL: Sep 6 2009, 10:39 PM |
|
|
|
Apr 22 2009, 02:47 PM
Post
#2
|
|
|
GMC Member Group: GMC Member Posts: 45 Joined: 16-June 04 From: GdaĆsk, Poland Member No.: 10578 |
Thanks dude, it's awesome!
|
|
|
|
Apr 22 2009, 03:17 PM
Post
#3
|
|
|
GMC Member Group: GMC Member Posts: 1697 Joined: 1-March 05 From: Here in holland Member No.: 23016 |
Well as I said in pm, maybe inverse the usage of d3d8.h: it's nowadays difficult to get the directx8 develop thing, (you can't get from MSDN anymore) - so you'll always have to add this line:
CODE #define GMAPI_NO_D3D maybe make it so that d3d8.h is ONLY used if something is defined.... |
|
|
|
Apr 22 2009, 03:25 PM
Post
#4
|
|
|
GMC Member Group: GMC Member Posts: 22 Joined: 2-December 07 From: Poland Member No.: 94338 |
Ok, I'll correct that in next version.
|
|
|
|
Apr 25 2009, 08:36 AM
Post
#5
|
|
|
GMC Member Group: GMC Member Posts: 337 Joined: 6-October 07 Member No.: 90046 |
hi there, i'm kindoff new to c/c++ so i neaad some help setting this up, especialy what do i have to do EXACTLY when you say this:
QUOTE Now You must add to the library dependencies proper static library - all depends on which runtime library You choose in Your project: gmapi-mt.lib - Multithreaded gmapi-mt-dll.lib - Multithreaded DLL gmapi-mt-d.lib - Multithreaded debug gmapi-mt-d-dll.lib - Multithreaded debug DLL (using dev c++) thanks already |
|
|
|
Apr 25 2009, 10:47 AM
Post
#6
|
|
|
I am stupid Group: GMC Member Posts: 2115 Joined: 27-October 03 From: Finland Member No.: 707 |
|
|
|
|
Apr 25 2009, 01:31 PM
Post
#7
|
|
|
GMC Member Group: GMC Member Posts: 337 Joined: 6-October 07 Member No.: 90046 |
that page doesn't give any real argument, it only has one weak argument "it's outdated", but so is windows xp and that sucks less than vista, but ok, whatever, downloading code::blocks EDIT:ok, that really solved nothing, QUOTE Process terminated with status 1 (0 minutes, 4 seconds) 50 errors, 22 warnings This post has been edited by ditdingiscool: Apr 25 2009, 01:45 PM |
|
|
|
Apr 25 2009, 01:54 PM
Post
#8
|
|
|
freak up! Group: GMC Member Posts: 898 Joined: 7-April 07 From: India Member No.: 75612 |
Post some of those 50 errors.
Most probably they'll be linker related errors. Also,(AFAIK) you'll have to convert those .lib files to .a archives for GCC's linker to use. Use a tool in your bin folder called REIMP to do this. Also Snake_PL, what do you use to hook d3d functions ? This post has been edited by freaked: Apr 25 2009, 01:56 PM |
|
|
|
Apr 25 2009, 01:58 PM
Post
#9
|
|
|
I am stupid Group: GMC Member Posts: 2115 Joined: 27-October 03 From: Finland Member No.: 707 |
|
|
|
|
Apr 25 2009, 03:11 PM
Post
#10
|
|
|
GMC Member Group: GMC Member Posts: 3746 Joined: 9-December 07 Member No.: 94888 |
If nobody is working on it, can you work on a Code::Blocks version? (Tuntis, if you ever tell me to use VC++, I despise Microsoft products)
By the way, Windows XP was unsupported for a while, but they extended the support, probably because many people downgraded from Windows Vista. |
|
|
|
Apr 25 2009, 04:33 PM
Post
#11
|
|
|
I am stupid Group: GMC Member Posts: 2115 Joined: 27-October 03 From: Finland Member No.: 707 |
|
|
|
|
Apr 25 2009, 04:57 PM
Post
#12
|
|
|
Deus Verus Group: GMC Member Posts: 1827 Joined: 18-December 04 From: Land of Twilight Member No.: 18164 |
QUOTE Tuntis, if you ever tell me to use VC++, I despise Microsoft products You're not using a dev tool because you despise that company that its affiliated with? Even though its arguably the best one around and free? You're so awesome. |
|
|
|
Apr 26 2009, 07:25 AM
Post
#13
|
|
|
GMC Member Group: GMC Member Posts: 337 Joined: 6-October 07 Member No.: 90046 |
QUOTE Tuntis, if you ever tell me to use VC++, I despise Microsoft products You're not using a dev tool because you despise that company that its affiliated with? Even though its arguably the best one around and free? You're so awesome. i'm also not a big fan off vc++, and not only because it's from micro$oft, it has 'adobe reader syndrome'(load a document, have lunch, wait another 10 minutes for it to load), and it isn't able to create empty projects on my pc... ONTOPIC: CODE ||=== vonoroi, default ===|
C:\Documents and Settings\lieuwe\Bureaublad\bende\GMAPI\dll_vonoroi\GmapiCore.h|32|warning: `GMDeallocateString' initialized and declared `extern'| C:\Documents and Settings\lieuwe\Bureaublad\bende\GMAPI\dll_vonoroi\GmapiCore.h|32|error: variable or field `GMDeallocateString' declared void| C:\Documents and Settings\lieuwe\Bureaublad\bende\GMAPI\dll_vonoroi\GmapiCore.h|32|error: `gm::core::GMDeallocateString' declared as an `inline' variable| C:\Documents and Settings\lieuwe\Bureaublad\bende\GMAPI\dll_vonoroi\GmapiCore.h|32|warning: `__stdcall__' attribute only applies to function types| C:\Documents and Settings\lieuwe\Bureaublad\bende\GMAPI\dll_vonoroi\GmapiCore.h|32|error: `__in' was not declared in this scope| C:\Documents and Settings\lieuwe\Bureaublad\bende\GMAPI\dll_vonoroi\GmapiCore.h|33|warning: `GMDeallocateResult' initialized and declared `extern'| C:\Documents and Settings\lieuwe\Bureaublad\bende\GMAPI\dll_vonoroi\GmapiCore.h|33|error: variable or field `GMDeallocateResult' declared void| C:\Documents and Settings\lieuwe\Bureaublad\bende\GMAPI\dll_vonoroi\GmapiCore.h|33|error: `gm::core::GMDeallocateResult' declared as an `inline' variable| <snip> ||More errors follow but not being shown.| ||Edit the max errors limit in compiler options...| ||=== Build finished: 50 errors, 22 warnings ===| |
|
|
|
Apr 26 2009, 09:11 AM
Post
#14
|
|
|
Behemoth Creator Group: GMC Member Posts: 439 Joined: 11-October 06 From: Kingsport, Tennessee Member No.: 61283 |
Honestly, I think you should have made this compatible with the GCC compiler also.
QUOTE You're not using a dev tool because you despise that company that its affiliated with? Even though its arguably the best one around and free? You're so awesome. Errr, he's not trying to be awesome, he has just been mis-guided about Microsoft products. A lot of them are actually pretty good, and VC++ is one of them. Honestly, if you were to ever download a Microsoft product, I reccomend you try that one. Download Visual C++ Express You could have at least been helpful GearGod. :/ EDIT: Honestly, I think GMREC uses linux anyway, and I have no clue why he is really worrying about Game Maker in the first place... I don't think WINE can even run it. This post has been edited by X-tra Fear: Apr 26 2009, 09:16 AM |
|
|
|
Apr 26 2009, 10:27 AM
Post
#15
|
|
|
I am stupid Group: GMC Member Posts: 2115 Joined: 27-October 03 From: Finland Member No.: 707 |
QUOTE Errr, he's not trying to be awesome Oh trust me, this guy refuses to use pretty much any Microsoft technology because it's a "giant fag company". Funny how he still uses Windows... |
|
|
|
Apr 26 2009, 11:18 AM
Post
#16
|
|
|
Behemoth Creator Group: GMC Member Posts: 439 Joined: 11-October 06 From: Kingsport, Tennessee Member No.: 61283 |
|
|
|
|
Apr 26 2009, 12:00 PM
Post
#17
|
|
|
freak up! Group: GMC Member Posts: 898 Joined: 7-April 07 From: India Member No.: 75612 |
Lol. GMREC and me even had PM discussion involving C::B's greatness and MSVC's suckiness.
|
|
|
|
Apr 26 2009, 02:00 PM
Post
#18
|
|
|
GMC Member Group: GMC Member Posts: 3746 Joined: 9-December 07 Member No.: 94888 |
|
|
|
|
Apr 26 2009, 11:58 PM
Post
#19
|
|
|
GMC Member Group: GMC Member Posts: 7682 Joined: 26-October 06 Member No.: 62394 |
What is weird is your DLLMain, which is proper to use in that manner but... I found out a while back in my dlls that this is never called for dll's used by GM (7)
|
|
|
|
Apr 27 2009, 10:34 PM
Post
#20
|
|
|
GMC Member Group: GMC Member Posts: 1697 Joined: 1-March 05 From: Here in holland Member No.: 23016 |
What is weird is your DLLMain, which is proper to use in that manner but... I found out a while back in my dlls that this is never called for dll's used by GM (7) ? - Uhm well I found out that they are actually called, DLL_PROCESS_ATTACH, when you 'initialize' your first function.. And DLL_PROCESS_DETTACH when you unload the dll. (Also using GM 7) |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th November 2009 - 10:31 PM |