Older Newer
Wed, 18 Dec 2019 02:48:55 . . . . SyneRyder [Initial function definition]


Changes by last author:

Added:
= lockHost =

== Syntax ==

void* lockHost(int bufferID)

== Arguments ==

:bufferID

::The ID of the memory buffer to lock.

== Return ==

A pointer to the memory block allocated by the host application.

== Description ==

Retrieves a pointer to a memory block allocated by the host application with the allocHost function. Since some graphics programs like Photoshop manage memory themselves, you might want to use this in preference to the C-language system memory functions like malloc.

== Example ==

<code>

int bufferID = allocHost(100);

if (bufferID == NULL) {

Warn("Could not allocate memory");

}

else {

char* memptr = lockHost(bufferID);

sprintf(memptr, "Message goes here!");

Info(memptr);

freeHost(bufferID);

}

</code>

== See Also ==

allocHost, freeHost