Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/ddk_en/graphics/devg_get_memfuncs.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/ddk_en/graphics/devg_get_memfuncs.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/ddk_en/graphics/devg_get_memfuncs.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/ddk_en/graphics/devg_get_memfuncs.html on line 8

devg_get_memfuncs()

Get a table of your driver's video memory management functions

Synopsis:

int devg_get_memfuncs (disp_adapter_t *ctx,
                       disp_memfuncs_t *funcs,
                       int tabsize);

Description:

A driver must provide an entry point called devg_get_memfuncs(). The graphics framework calls it to get a table of your driver's video memory management functions.

The arguments are:

ctx
A pointer to the disp_adapter_t structure that describes the graphics adapter.
funcs
A pointer to a disp_memfuncs_t structure that your driver must fill with pointers to its video memory management functions.
tabsize
The size of the table, in bytes.

Use the DISP_ADD_FUNC() macro to add function pointers to the table. It checks the tabsize argument and adds a function pointer only if there's space for it in the table.

The video driver is responsible for keeping track of the allocation of video memory. The framework requests the allocation of 2D surfaces, and asks the driver to free them when they're no longer in use. The onus is on the framework to free all surfaces; that is, for each surface that's allocated, the framework explicitly asks the driver to free the surface at some point before the driver is unloaded.

In general, you don't need to deal with all the complexities of writing a memory manager. Library routines in the DISPUTIL library can perform the bulk of the work. For more information, see the Libraries chapter.

Returns:

0
Success.
-1
An error occurred.

Classification:

Neutrino

Safety:
Interrupt handler Not applicable
Signal handler Not applicable
Thread Not applicable

See also:

disp_adapter_t, DISP_ADD_FUNC(), disp_memfuncs_t


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/ddk_en/graphics/devg_get_memfuncs.html on line 146

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/ddk_en/graphics/devg_get_memfuncs.html on line 146