#include "flGlobal.h"
Go to the source code of this file.
Defines | |
#define | graphicsRenderToTexture(inTex) graphicsRenderToVmem((inTex)->texData, (inTex)->texDataWidth, (inTex)->texPixelFormat) |
This sets the render target to a texture. | |
Functions | |
void * | graphicsDispListCur () |
Returns the address of the current display list, to be written to. | |
void * | graphicsDispListLast () |
Returns the address of the last display list, to be drawn onto the screen. | |
void | graphicsInit () |
Initializes the graphics system, this is called internally by flInitialize(). | |
void | graphicsTerm () |
Terminates the graphics system, this is called internally by flTerminate(). | |
void | graphicsSwapBuffers () |
Swaps the buffers and display lists around to show what you drew last frame, this function is used as a launching off point for the notify functions and other functions that need to be called each frame. | |
void | graphicsSetProjection () |
Sets up the projection matrix for 3d. | |
void | graphicsBeginOrtho () |
Begins orthographic drawing mode. | |
void | graphicsEndOrtho () |
Ends orthographic drawing mode. | |
void | graphicsSetLinesAntiAlias (bool inValue) |
This is basically a wrapper for sceGuEnable/Disable(GU_LINE_SMOOTH). | |
void | graphicsRenderToFramebuffer () |
This restores the render target to being the draw buffer again. | |
bool | graphicsRenderToVmem (void *inPtr, int inStride, u8 inPixelFormat) |
This sets the render target to an area in vmem. | |
u8 | graphicsPixelFormatBPP (u8 inPixelFormat) |
Gets the bits per pixel (BPP) of a pixel type. | |
u8 * | graphicsSwizzleData (u8 *inData, u32 inWidth, u32 inHeight, u8 inPixelFormat) |
Swizzles data so it is optimized for the PSP GPU. | |
u8 * | graphicsUnswizzleData (u8 *inData, u32 inWidth, u32 inHeight, u8 inPixelFormat) |
Unswizzles data so it is back in it's natural state ready for saving/modifying. | |
Variables | |
bool | graphicsVSync |
This boolean stores whether VSync is currently activated or not, it defaults to GRAPHICS_VSYNC_DEFAULT and can only be overridden if FL_GRAPHICS_VSYNC_AUTO is enabled. | |
void * | graphicsDisplayList |
Display list memory, used as the main 2 display lists. | |
void * | graphicsDisplayListCache |
A small display list, used for graphics using GU_DIRECT . | |
u8 | graphicsDisplayListCurrent |
The current display list to be used. | |
void * | graphicsDrawBuffer |
Address of the draw buffer. | |
void * | graphicsDispBuffer |
Address of the display buffer. | |
void * | graphicsDepthBuffer |
Address of the Depth/Z buffer. | |
bool | graphicsLinesAntiAlias |
Whether line antialiasing is currently enabled or not. | |
bool | graphicsWireframe |
Whether wireframe mode is enabled or not, this currently only effects the drawing of 3d primatives and models. | |
float | graphicsFPS |
The current fps, this is recalculated every frame so modifying it has almost no effect. | |
bool | graphicsFPSShow |
This variable stores whether the FPS display is enabled or not, it defaults to FL_GRAPHICS_FPS_SHOW_DEFAULT. | |
bool | graphicsFrame |
This stores whether the graphics system is currently mid-frame or not. | |
void * | graphicsRenderTarget |
The current render target address. | |
int | graphicsRenderTargetStride |
The current render target buffer width. | |
u8 | graphicsRenderTargetPixelFormat |
The current render target pixel format. |
#define graphicsRenderToTexture | ( | inTex | ) | graphicsRenderToVmem((inTex)->texData, (inTex)->texDataWidth, (inTex)->texPixelFormat) |
This sets the render target to a texture.
inTex | The texture that will be rendered to. |
Definition at line 232 of file flGraphics.h.
void graphicsBeginOrtho | ( | ) |
Begins orthographic drawing mode.
Definition at line 324 of file flGraphics.c.
void* graphicsDispListCur | ( | ) |
Returns the address of the current display list, to be written to.
Definition at line 51 of file flGraphics.c.
Referenced by graphicsInit(), and graphicsSwapBuffers().
void* graphicsDispListLast | ( | ) |
Returns the address of the last display list, to be drawn onto the screen.
Definition at line 59 of file flGraphics.c.
void graphicsEndOrtho | ( | ) |
Ends orthographic drawing mode.
Definition at line 339 of file flGraphics.c.
void graphicsInit | ( | ) |
Initializes the graphics system, this is called internally by flInitialize().
Definition at line 67 of file flGraphics.c.
References debugError, FL_GRAPHICS_DISP_BUFFER_FORMAT, FL_GRAPHICS_DRAW_BUFFER_FORMAT, graphicsDispListCur(), graphicsFPSTimer, graphicsPixelFormatBPP(), GU_SYNC_WAIT, memAlign, memClear, SCREEN_HEIGHT, SCREEN_PITCH, SCREEN_STRIDE, SCREEN_WIDTH, timerCreate(), vmemAllocBuffer(), and vmemInit().
Referenced by flInitialize().
u8 graphicsPixelFormatBPP | ( | u8 | inPixelFormat | ) |
Gets the bits per pixel (BPP) of a pixel type.
inPixelFormat | The format to get the BPP from, using gu defines (e.g GU_PSM_8888). |
Definition at line 382 of file flGraphics.c.
Referenced by graphicsInit(), graphicsSwizzleData(), graphicsUnswizzleData(), and palBPP().
void graphicsRenderToFramebuffer | ( | ) |
This restores the render target to being the draw buffer again.
Definition at line 361 of file flGraphics.c.
References FL_GRAPHICS_DRAW_BUFFER_FORMAT, and SCREEN_STRIDE.
bool graphicsRenderToVmem | ( | void * | inPtr, | |
int | inStride, | |||
u8 | inPixelFormat | |||
) |
This sets the render target to an area in vmem.
inPtr | Pointer to the start of the render target. | |
inStride | The total width of the buffer including stride. | |
inPixelFormat | The format of the render target using gu defines (e.g GU_PSM_8888). |
Definition at line 368 of file flGraphics.c.
References debugError.
void graphicsSetLinesAntiAlias | ( | bool | inValue | ) |
This is basically a wrapper for sceGuEnable/Disable(GU_LINE_SMOOTH).
inValue | Whether to enable/disable line anti-aliasing. |
Definition at line 351 of file flGraphics.c.
void graphicsSetProjection | ( | ) |
Sets up the projection matrix for 3d.
Definition at line 190 of file flGraphics.c.
References SCREEN_HEIGHT, and SCREEN_WIDTH.
Referenced by flInitialize().
void graphicsSwapBuffers | ( | ) |
Swaps the buffers and display lists around to show what you drew last frame, this function is used as a launching off point for the notify functions and other functions that need to be called each frame.
Definition at line 219 of file flGraphics.c.
References FL_GRAPHICS_DISP_BUFFER_FORMAT, FL_GRAPHICS_DRAW_BUFFER_FORMAT, FL_GRAPHICS_FPS_DAMPRATIO, FL_GRAPHICS_FPS_SHOW_COLOR, FL_GRAPHICS_VSYNC_AUTO_CUTOFF, fontDefault, fontDraw2dString(), graphicsDispListCur(), graphicsFPSTimer, graphicsVSync, GU_SYNC_WAIT, ntfyTick(), NULL, SCREEN_HEIGHT, SCREEN_STRIDE, SCREEN_WIDTH, texBound, timerGetDeltaTime(), vertTsVs::vertU, vertTsVs::vertV, vertTsVs::vertX, vertTsVs::vertY, and vertTsVs::vertZ.
Referenced by debugCriticalErrorFrom().
u8* graphicsSwizzleData | ( | u8 * | inData, | |
u32 | inWidth, | |||
u32 | inHeight, | |||
u8 | inPixelFormat | |||
) |
Swizzles data so it is optimized for the PSP GPU.
inData | A pointer to the data that is to be swizzled. | |
inWidth | The width of the data in pixels. | |
inHeight | The height of the data in pixels. | |
inPixelFormat | The pixel format of the data, using gu defines (e.g GU_PSM_8888). |
Definition at line 403 of file flGraphics.c.
References debugError, debugWarning, graphicsPixelFormatBPP(), memCopy, memFree, memIsCachedPointer, memQalloc, and NULL.
Referenced by fontCreateDebugTex(), and texSwizzle().
void graphicsTerm | ( | ) |
Terminates the graphics system, this is called internally by flTerminate().
Definition at line 205 of file flGraphics.c.
References GU_SYNC_WAIT, memFree, and vmemTerm().
u8* graphicsUnswizzleData | ( | u8 * | inData, | |
u32 | inWidth, | |||
u32 | inHeight, | |||
u8 | inPixelFormat | |||
) |
Unswizzles data so it is back in it's natural state ready for saving/modifying.
inData | A pointer to the data that is to be unswizzled. | |
inWidth | The width of the data in pixels. | |
inHeight | The height of the data in pixels. | |
inPixelFormat | The pixel format of the data, using gu defines (e.g GU_PSM_8888). |
Definition at line 476 of file flGraphics.c.
References debugError, debugWarning, graphicsPixelFormatBPP(), memCopy, memFree, memIsCachedPointer, memQalloc, and NULL.
Referenced by texUnswizzle().
void* graphicsDepthBuffer |
Address of the Depth/Z buffer.
Definition at line 34 of file flGraphics.c.
Referenced by graphicsEffectFsDepthFog().
void* graphicsDispBuffer |
Address of the display buffer.
Definition at line 33 of file flGraphics.c.
Referenced by debugCriticalErrorFrom(), debugDevWarningFrom(), debugErrorFrom(), debugWarningFrom(), and texScreenshot().
void* graphicsDisplayList |
Display list memory, used as the main 2 display lists.
Definition at line 27 of file flGraphics.c.
Referenced by palMoveVMem(), and texMoveVMem().
void* graphicsDisplayListCache |
A small display list, used for graphics using GU_DIRECT .
Definition at line 28 of file flGraphics.c.
void* graphicsDrawBuffer |
Address of the draw buffer.
Definition at line 32 of file flGraphics.c.
Referenced by debugCriticalErrorFrom(), debugDevWarningFrom(), debugErrorFrom(), debugWarningFrom(), graphics2dDrawTexture(), graphics2dDrawTextureSection(), graphicsEffectFsColorEnhance(), graphicsEffectFsDichrome(), graphicsEffectFsGlow(), graphicsEffectFsGrayscale(), graphicsEffectFsGrayscaleSW(), graphicsEffectFsInvert(), graphicsEffectFsLightEnhance(), graphicsEffectFsMonochrome(), graphicsEffectFsNightVision(), graphicsEffectFsNightVisionSW(), and graphicsEffectFsThermalVision().
float graphicsFPS |
The current fps, this is recalculated every frame so modifying it has almost no effect.
Definition at line 41 of file flGraphics.c.
This variable stores whether the FPS display is enabled or not, it defaults to FL_GRAPHICS_FPS_SHOW_DEFAULT.
Definition at line 42 of file flGraphics.c.
This stores whether the graphics system is currently mid-frame or not.
Definition at line 45 of file flGraphics.c.
Referenced by palMoveVMem(), and texMoveVMem().
void* graphicsRenderTarget |
This boolean stores whether VSync is currently activated or not, it defaults to GRAPHICS_VSYNC_DEFAULT and can only be overridden if FL_GRAPHICS_VSYNC_AUTO is enabled.
Definition at line 22 of file flGraphics.c.
Referenced by graphicsSwapBuffers().
Whether wireframe mode is enabled or not, this currently only effects the drawing of 3d primatives and models.
Definition at line 37 of file flGraphics.c.
Referenced by graphics3dDrawCube(), graphics3dDrawCubeColoreda(), mdl3dStatDraw(), and mdl3dStatDrawTextured().