|
GetResourcePtr | |
Address = GetResourcePtr(Index) | |
Parameters: Index = The Index of the resource in the internal resource buffer |
|
Returns: Address = Address the resource, zero if doesn't exist |
|
The GetResourcePtr function returns the pointer (address in memory) of a file that's been bound to the program executable at compile time using the #AddResource directive. To query the resource the we give the GetResourcePtr function the index of the resource in the internal resource buffer array. You can locate a bound resource by using FindResourceIndex and it's filename. GetResourcePtr is useful as it allows a program to read and manipulate the data directly from the memory rather than disc ( ie. decompression, decryption etc). So the bound resource is hidden from the users of your program, meaning you don't need to include the file externally with the final game/application. FACTS: * GetResourcePtr will return 0 if the resource doesn't exist. * Resources can be used as an alternative way to store information than DATA statements. * For more information about resource binding see the #AddResource directive. |
|
Example Source: Download This Example
|
Related Info: | #AddResource | Data | FindResourceIndex | GetResourceSize | PeekByte | PeekInt : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |