PS2GL
OpenGL*-like API for the PS2
|
Functions | |
pgl_area_handle_t | pglCreateGsMemArea (int width, int height, unsigned int pix_format) |
void | pglDestroyGsMemArea (pgl_area_handle_t mem_area) |
void | pglAllocGsMemArea (pgl_area_handle_t mem_area) |
void | pglFreeGsMemArea (pgl_area_handle_t mem_area) |
void | pglSetGsMemAreaWordAddr (pgl_area_handle_t mem_area, unsigned int addr) |
void | pglBindGsMemAreaToSlot (pgl_area_handle_t mem_area, pgl_slot_handle_t mem_slot) |
void | pglUnbindGsMemArea (pgl_area_handle_t mem_area) |
void | pglLockGsMemArea (pgl_area_handle_t mem_area) |
void | pglUnlockGsMemArea (pgl_area_handle_t mem_area) |
int | pglGsMemAreaIsAllocated (pgl_area_handle_t mem_area) |
unsigned int | pglGetGsMemAreaWordAddr (pgl_area_handle_t mem_area) |
API for working with GS memory "areas" that are used to allocate GS ram. An area is defined by a width and height (in pixels) and a pixel format. The area can then be given an address in GS ram by the application or be bound to a memory slot (either automatically or by the user) which will set the address in GS ram.
An allocated memory area (one that has an address) can be used as a texture, drawn to, or displayed.
pgl_area_handle_t pglCreateGsMemArea | ( | int | width, |
int | height, | ||
unsigned int | pix_format | ||
) |
#include <src/gsmemory.cpp>
Create a memory area.
width | width in pixels |
height | height in pixels |
pix_format | pixel format (SCE_GS_PS*) |
Definition at line 185 of file gsmemory.cpp.
void pglDestroyGsMemArea | ( | pgl_area_handle_t | mem_area | ) |
#include <src/gsmemory.cpp>
Destroy a memory area (free the memory it occupies).
Definition at line 194 of file gsmemory.cpp.
void pglAllocGsMemArea | ( | pgl_area_handle_t | mem_area | ) |
#include <src/gsmemory.cpp>
Allocate GS ram by binding to a slot. This operation will first find a list of slots which are closest in dimension and pixel format to the memory area in question, then bind either to a free slot or, if none are available, to the least-recently-used slot after first freeing it.
Note that this will always succeed. If no suitable, unlocked slots exist the memory manager will panic and fail an assertion.
Definition at line 210 of file gsmemory.cpp.
void pglFreeGsMemArea | ( | pgl_area_handle_t | mem_area | ) |
#include <src/gsmemory.cpp>
Free a memory area. Note that this does not free any main ram; the user must still call pglDestroyGsMemArea();
Definition at line 220 of file gsmemory.cpp.
void pglSetGsMemAreaWordAddr | ( | pgl_area_handle_t | mem_area, |
unsigned int | addr | ||
) |
#include <src/gsmemory.cpp>
Manually set the starting GS ram word address of this area (mainly for compatibility with existing code).
addr | the word address in GS ram (byte addr / 4) |
Definition at line 231 of file gsmemory.cpp.
void pglBindGsMemAreaToSlot | ( | pgl_area_handle_t | mem_area, |
pgl_slot_handle_t | mem_slot | ||
) |
#include <src/gsmemory.cpp>
This is the manual equivalent of pglAllocGsMemArea() (except that the slot does not have to be unlocked).
Definition at line 241 of file gsmemory.cpp.
void pglUnbindGsMemArea | ( | pgl_area_handle_t | mem_area | ) |
#include <src/gsmemory.cpp>
Release the slot bound to this area.
Definition at line 251 of file gsmemory.cpp.
void pglLockGsMemArea | ( | pgl_area_handle_t | mem_area | ) |
#include <src/gsmemory.cpp>
Prevent this area from being allocated or freed automatically by the memory manager (it may still be operated on manually).
Definition at line 261 of file gsmemory.cpp.
void pglUnlockGsMemArea | ( | pgl_area_handle_t | mem_area | ) |
#include <src/gsmemory.cpp>
Let the memory manager affect the allocation of this area.
Definition at line 269 of file gsmemory.cpp.
int pglGsMemAreaIsAllocated | ( | pgl_area_handle_t | mem_area | ) |
#include <src/gsmemory.cpp>
Definition at line 277 of file gsmemory.cpp.
unsigned int pglGetGsMemAreaWordAddr | ( | pgl_area_handle_t | mem_area | ) |
#include <src/gsmemory.cpp>
Definition at line 286 of file gsmemory.cpp.