Results 1 to 5 of 5

Thread: Asphyre Extreme- How to draw a Tbitmap onto the canvas?

  1. #1

    Asphyre Extreme- How to draw a Tbitmap onto the canvas?

    Not sure if anybody is still reading this forum, but I'm a newbie to Asphyre Extreme
    after using DelphiX for many years and need a little help please.

    I'm converting an old game which makes some Delphi tbitmaps during a frame and then writes
    them directly to the canvas, the old code is:-

    form1.DXDraw.Surface.Canvas.Draw(x,y,mybitmap);

    Which I know is really slow, but works fine for my needs. Is there something equivalent in Asphyre Extreme?

    Thanks.

  2. #2
    Quote Originally Posted by Damot View Post
    Not sure if anybody is still reading this forum, but I'm a newbie to Asphyre Extreme
    after using DelphiX for many years and need a little help please.
    Don't worry some of us are reading all the forums

    First I would recomend yout to switch to Asphyre Sphinx 3 graphical engine if posible (you don't code in old Delphi or use Asphyre Sprite Engine).
    http://www.afterwarp.net/products/asphyresphinx3
    Why? While Asphyre eXtreme is a god graphical engine it is old graphical engine which is formaly no longer maintained (existing bugs may not be fixed).
    It is true that Asphyre Sphinx 3 is a 3D graphical engine but it still alows you to render 2D graphics. It supports all the latest hardware features (DirectX 7, 9, 10 and even 11, OpenGL 2.1) but still works on older hardware. It supports 32-bit Windows, 64-bit Windows, 32-bit Linux, 64-bit Linux and Mac OS X platforms.

    Now I know what you might be thinking: "I don't need 3D graphics, I currently have no intention of porting my game to other platforms." But hey someday you might change your mind and do decide that you wanna do sone of this. And when that day comes would you rather be using a graphical engine which already supports all this, or switch to another graphical engine, learning hot to work with it from the start, redesigning your code to be usable with that engine, etc.

    And now to your answer:

    Asphyre draws most of things using either AsphyreImage-s or various AsphyreTexture-s.
    TAsphyreImage alows loading its contents from TBitmap using:

    function LoadFromBitmap(Source: TBitmap; NeedMasked: Boolean; MaskedColor: Longword; Tolerance: Integer): Boolean

    Now if it isn't a secret you could post the Bitmap generation code here and we will see if we can rewrite the code to get same resuts using only Asphyre. This might provide you with more performance.

  3. #3
    I would avoid CPU->GPU texturedata movement on every frame, if possible, because it's slow. 3D-engines can only draw anything that is stored on GPU. That makes game programmers look the rendering process from a little different perspective. Doesn't mean that old things aren't possible to do anymore, you just do them little differently.

    PS. I still rely on "What's New?" link, for quick recap on everything that's happened here Browsing random forum sections is thing of the past.

  4. #4
    Quote Originally Posted by SilverWarior View Post
    Don't worry some of us are reading all the forums

    First I would recomend yout to switch to Asphyre Sphinx 3 graphical engine if posible (you don't code in old Delphi or use Asphyre Sprite Engine).
    http://www.afterwarp.net/products/asphyresphinx3
    Why? While Asphyre eXtreme is a god graphical engine it is old graphical engine which is formaly no longer maintained (existing bugs may not be fixed).
    It is true that Asphyre Sphinx 3 is a 3D graphical engine but it still alows you to render 2D graphics. It supports all the latest hardware features (DirectX 7, 9, 10 and even 11, OpenGL 2.1) but still works on older hardware. It supports 32-bit Windows, 64-bit Windows, 32-bit Linux, 64-bit Linux and Mac OS X platforms.

    Now I know what you might be thinking: "I don't need 3D graphics, I currently have no intention of porting my game to other platforms." But hey someday you might change your mind and do decide that you wanna do sone of this. And when that day comes would you rather be using a graphical engine which already supports all this, or switch to another graphical engine, learning hot to work with it from the start, redesigning your code to be usable with that engine, etc.

    And now to your answer:

    Asphyre draws most of things using either AsphyreImage-s or various AsphyreTexture-s.
    TAsphyreImage alows loading its contents from TBitmap using:

    function LoadFromBitmap(Source: TBitmap; NeedMasked: Boolean; MaskedColor: Longword; Tolerance: Integer): Boolean

    Now if it isn't a secret you could post the Bitmap generation code here and we will see if we can rewrite the code to get same resuts using only Asphyre. This might provide you with more performance.
    First of all thanks for the quick reply, I'm glad there are a few people reading this forum!

    I would have started this conversion with Asphyre Sphinx 3 but I'm still using Delphi 7 and I don't have a lot of time so I thought I'd stick with Extreme for now. I'm really only converting this particular game because it simply doesn't want to work in full screen mode in Windows 8 with DelphX - it just freezes.

    However as soon as I have done I have every intention of switching to Asphyre Sphinx 3 and the latest Delphi.

    I have managed to get my game to load and initialise, as well as display it's main screen and menus, so conversion is going okay, I love Asphyre already!

    It's just at various points in the game (usually just on menu screens) I create and modify the contents of a tbitmap and write it directly to the canvas.

    Sometimes this is done every frame, I know, very messy and slow, but it worked and I'm just patching together this conversion so I was hoping there
    was a straight forward alternative in Extreme.

    I'm aware of the LoadFromBitmap procedure for AsphyreImage, but is it safe to perform that on every frame with the same AsphyreImage? If so then
    my patching will just require me to have a AsphyreImage that I constantly change and then draw. A nasty but simple fix. Speed is not important - crashing regularly
    would be :-)

    Being able to directly write onto the canvas every frame with a Delphi Tbitmap seems so far to be my only stumbling block.

    After this is all done I'm really looking forward to using the latest Asphyre for new projects.

  5. #5
    Quote Originally Posted by User137 View Post
    I would avoid CPU->GPU texturedata movement on every frame, if possible, because it's slow. 3D-engines can only draw anything that is stored on GPU. That makes game programmers look the rendering process from a little different perspective. Doesn't mean that old things aren't possible to do anymore, you just do them little differently.
    Yes I know it's not the thing to do and I certainly won't do it with any new project, but I did it a little more often that I thought I had, so providing I can do it reliably (no crashing!) speed is not important as it's really only for
    menus screens anyway.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •