PDA

View Full Version : Pyrogine2Dび「 API v1.0.1 Released



Pyrogine
09-11-2007, 01:32 AM
Pyrogine2D (http://www.pyrogine.com/index.php?content/view/15/35/) is a pure rendering API suitable for making 2D games and graphic simulations. It's being developed in and usable from Delphi and other languages that work with standard Win32 DLLs. At present there are around 300+ exported routines which give you a solid low-level foundation for making any type of 2D game. You can build on top of this layer to any level of complexity that is required for your project. The API includes support for surfaces, textures, sprites, audio, streams, archives, databases, INI files, configuration variables, render targets, swap chains and much more. There is also support for event callbacks to you application. You can setup events to standard routines and/or class methods. It supports all the standard calling conventions so most any language can be use if there is a binding that exists for it.

In addition to the low-level, to the metal access, there exist a thin high level framework unit (Delphi only at the present time) p2dFramework that exports the following classes:

* TP2DObject - Base object class
* TP2DObjectList - Basic object linked list class
* TP2DActor - Generic actor class
* TP2DActorList - Base actor linked list class
* TP2DActorScene - scene manager
* TP2DAIState - AI state class
* TP2DAIStateMachine - AI state machine class
* TP2DAIActor - Actor with AI support
* TP2DEntity - Animated actor class with AI support
* TP2DGame - Game manager class

This gives you enough high level support over the API to make it easy to get started with your projects in an object oriented way.

Pyrogine2Dび「 API v1.0.1 (3.26 Mb) (http://www.pyrogine.com/index.php?component/option,com_docman/task,doc_download/gid,6/)

arthurprs
09-11-2007, 01:51 AM
I used it some time ago for some tests and porting my game from asphyre, but as i needed to run the app on ubuntu i got sticked with sdl, but i can tell that its powerfullャ? library.

ps: im confused with "sdk of api", whats the dif?

Pyrogine
09-11-2007, 02:20 AM
Thanks.

pyroEngine SDK represent more or less a super high level SDK around a low-level core. You can access the low-level features if you wish, but it is more hidden and was designed to be wrapped up and used from the classes and routines in the SDK itself. Some developers like to do the high-level stuff themselves. The low-level core in PESDK was really not designed to be used outside of the higher level SDK so correct functioning of the library required they be used together.

In Pyrogine2D, you interact with the core engine via exported routines only. All its functionality is from the API (application program interface). You can build upon the solid core foundation and add what ever higher level functionality that you need for your projects. Another way to think of it is like this: if you are going to build a new car there are fundamental things that are the same for each car, you can purchase these necessary parts, but then you add on top of this all things that make your car different and unique.

In addition to this, it is much easier to use P2D from different languages. If Delphi is not your language of choice and say C/C++ is, then as long as your preferred language supports standard WIN32 DLLs you should be able to use P2D with it. You can even link the event callbacks directly to methods and standard routines in the supported language. So when the application is minimized/restored for example this callback can jump directly to a c/c++ method. P2D should now also work with FPC (I've not tested for full compatibility at this time).

Robert Kosek
09-11-2007, 03:05 AM
Any chance to compile things in Delphi/FPC as native code without the DLLs? The DLLs for a library in your own native language are the worst thing. They aren't needed at all.

Pyrogine
09-11-2007, 03:42 AM
Robert Kosek

The freeware version is in DLL format only. We may offer a source code license at some point.

Some advantages of DLLs:

* As long as the API is the same, it works (should work) consistently across multiple versions of a language. In theory, it should work with Delphi 2-2007 and I can use my Delphi version of choice for development.

* As long as the API is the same, the dll can be updated independently of the application.

* If there are multiple apps that depend on the API, they can all share the dll without code duplication.

* A single consistent API that works across multiple languages without the problems of source code nuances. You can build on top of the API to any degree that you wish in your language of choice.

Of coarse there are advantages of having the sources. We will look into offering a source code license if there is a demand.

Pyrogine
22-11-2007, 04:28 AM
I got it compiling with Lazarus 0.9.24, but for some reason it crashes when I try to display the Options Form. Any ideas as to what the problem maybe?

http://www.pyrogine.com/images/stories/products/Pyrogine2D/pyrogine2d_small.jpg (http://www.pyrogine.com/images/stories/products/Pyrogine2D/gallery/pyrogine2d_scroll.jpg)

savage
22-11-2007, 02:28 PM
Are you using Delphi compatibility mode? What sort of error is it?

Pyrogine
22-11-2007, 02:49 PM
I've only just started using Lazarus, so I will assume I'm doing something wrong. I used the tools to convert the project, units and forms. It added the delphi mode directive and I was able to compile and run. When the form is created:

f := TOptionsForm.Create(nil);

the call to GlobalNameSpace.BeginWrite seems to be the source of the access violation. When the debugger hits this line it will generate an exception and terminate.

constructor TCustomForm.Create(AOwner : TComponent);
begin
//DebugLn('[TCustomForm.Create] A Class=',Classname);
FShowInTaskbar := stDefault;
FAllowDropFiles := False;

GlobalNameSpace.BeginWrite; // this line seems to cause the AV
....

savage
22-11-2007, 09:48 PM
in the initialization section of each form make sure you have something like this...


initialization
{$I [FormName].lrs}

end.


If you don't have that line, the various events are not called correctly.
At least that is what happened to me recently on Mac OS X.

Also are you sure the GlobalNameSpace classe is being created?

Pyrogine
22-11-2007, 10:44 PM
Yes, I discovered and fixed this problem too. Another important thing I just found out is that Interfaces has to be added to the uses section. Once I did this then any form that is created in the IDE will work, but not the form that was converted from Delphi. I got another type of error now.

All in all, the problem seems to be related more to conversion. The p2dApi unit, which is most important seems to work and run without problems after adding {$mode delphi}. I was hoping that I could convert some of the examples over fairly easily so that they could run in Lazarus, but it's looking like it will be more involved than I thought and will have to redo them in Lazarus (the ones with UI). I may have to wait until I have more time. *sigh*

Thanks for your help savage.