Results 1 to 8 of 8

Thread: Memory in (Un)Delphix

  1. #1

    Memory in (Un)Delphix

    Hi, I'm using this code to display images on the screen:

    Code:
    DXImage.Items[0].Draw(DXDraw1.Surface,round(x),round(y),0);




    I realized that every image loaded used more and more memory. How to release the memory used by the surface?

  2. #2

    Re: Memory in (Un)Delphix

    You can do that by not loading the images at design-time, but during run-time. However if you go that route you'll need to distribute the images with you executable.

  3. #3

    Re: Memory in (Un)Delphix

    Also a call to <object>.free might come in handy. Do this after you are done displaying it and move to the next screen.
    http://3das.noeska.com - create adventure games without programming

  4. #4

    Re: Memory in (Un)Delphix

    Quote Originally Posted by Traveler
    You can do that by not loading the images at design-time, but during run-time. However if you go that route you'll need to distribute the images with you executable.
    I understand, but I use the picture for 30 seconds and do not need it after that. Is there a way to release memory?

    Quote Originally Posted by noeska
    Also a call to <object>.free might come in handy. Do this after you are done displaying it and move to the next screen.
    I'll do that then I say if it worked
    Thanks o/

  5. #5

    Re: Memory in (Un)Delphix

    Its been a while I used DelpphiX but iirc you can create an object TDirectDrawSurface and then use that to load and draw the image. When you nolonger need it you can release the object again.

  6. #6

    Re: Memory in (Un)Delphix

    Thanks everyone

    Quote Originally Posted by Traveler
    Its been a while I used DelpphiX but iirc you can create an object TDirectDrawSurface and then use that to load and draw the image. When you nolonger need it you can release the object again.
    I will do this

    I found a good example... \o/
    http://www.pascalgamedevelopment.com...fd42d1f7cf82f6

  7. #7

    Re: Memory in (Un)Delphix

    Memory is managed internaly, you can use DxDraw1.ClearStack for force prune texture stack manually. But new restoring all used next screen texture consume more times, you be sure, that example level finished or menu screen is loaded etc.
    Ijcro.

  8. #8

    Re: Memory in (Un)Delphix

    I understand
    Thanks for help

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
  •  
Comodo SSL