User Tag List

Results 1 to 4 of 4

Thread: How to get hold of a cSurface buffer?

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to get hold of a cSurface buffer?

    Hi all,

    I have a cSurface in my extension, but how do I get hold of the buffer that it's using?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Hey! I hope this helps:
    http://pastebin.com/Ex2A3JDe

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So the locking/unlocking bit tells other threads to keep off the memory till I'm finished with it, right? Or is LockBuffer() actually creating and returning a temporary buffer, which then overwrites the real internal buffer on UnlockBuffer()?

    I'm in a bit of a pickle, because I'm trying to share the window's surface over a Memory Mapped File, and I'm not sure what the most efficient way is without massively affecting frame rate.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Hey. It doesn't copy the buffer, so unless you Delete() the Surface and Create() a new one, it should work fine for memory files as far as I know. Just make sure to lock and unlock properly (While locked, you aren't able to modify the Surface via SetPixel etc.)
    You are talking about the window surface - I suppose you mean the one allocated by MMF itself? I'm not sure if that won't cause any trouble, but you can try. Just consider that MMF blits onto that Surface and it needs to be unlocked at that point.

    If you haven't already, download http://www.clickteam.com/webftp/files/mmf2/Exts/MMF2SDK.zip and go to Extensions/Help, there's a documenation of the SDK which includes cSurface.

Similar Threads

  1. CSurface documentation
    By Phi in forum Extension Development
    Replies: 2
    Last Post: 11th December 2012, 02:31 PM
  2. DLL & Binary Object - integer buffer
    By RichTheDude in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 12th October 2012, 10:24 AM
  3. Audio buffer length?
    By Nifflas in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th March 2012, 11:28 PM
  4. [DLL Object] Buffer + DLL chargée = crash
    By ouly in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 3rd June 2008, 01:23 PM
  5. Clearing string buffer
    By Nickydude in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 5th April 2007, 11:54 PM

Posting Permissions

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