PS2GL
OpenGL*-like API for the PS2
Loading...
Searching...
No Matches
GS memory 'areas'
+ Collaboration diagram for GS memory 'areas':

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)
 

Detailed Description

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.

Function Documentation

◆ pglCreateGsMemArea()

pgl_area_handle_t pglCreateGsMemArea ( int  width,
int  height,
unsigned int  pix_format 
)

#include <src/gsmemory.cpp>

Create a memory area.

Parameters
widthwidth in pixels
heightheight in pixels
pix_formatpixel format (SCE_GS_PS*)
Returns
a handle to the newly created area

Definition at line 185 of file gsmemory.cpp.

◆ pglDestroyGsMemArea()

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.

◆ pglAllocGsMemArea()

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.

◆ pglFreeGsMemArea()

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.

◆ pglSetGsMemAreaWordAddr()

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).

Parameters
addrthe word address in GS ram (byte addr / 4)

Definition at line 231 of file gsmemory.cpp.

◆ pglBindGsMemAreaToSlot()

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.

◆ pglUnbindGsMemArea()

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.

◆ pglLockGsMemArea()

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.

◆ pglUnlockGsMemArea()

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.

◆ pglGsMemAreaIsAllocated()

int pglGsMemAreaIsAllocated ( pgl_area_handle_t  mem_area)

#include <src/gsmemory.cpp>

Returns
1 if allocated, 0 if not.

Definition at line 277 of file gsmemory.cpp.

◆ pglGetGsMemAreaWordAddr()

unsigned int pglGetGsMemAreaWordAddr ( pgl_area_handle_t  mem_area)

#include <src/gsmemory.cpp>

Returns
the starting word address in GS ram of this area

Definition at line 286 of file gsmemory.cpp.