#include "CrabClaw/types.h"#include "CrabClaw/texture.h"Data Structures | |
| struct | cc_screen |
| A screen to which drawing occurs. More... | |
| struct | cc_vertex |
A vertex to draw to a cc_screen_t. More... | |
Defines | |
| #define | CC_LIST_INVALID 0xFFFFFFFF |
| Invalid primitive list. | |
| #define | CC_LIST_OPAQUE 0x01 |
| Opaque primitive list. | |
| #define | CC_LIST_PUNCHTHRU 0x02 |
| Punch-thru primitive list. | |
| #define | CC_LIST_TRANSLUCENT 0x04 |
| Translucent primitive list. | |
Typedefs | |
| typedef struct cc_screen | cc_screen_t |
| A screen to which drawing occurs. | |
| typedef struct cc_vertex | cc_vertex_t |
A vertex to draw to a cc_screen_t. | |
Functions | |
| void | cc_video_begin_list (cc_screen_t *screen, uint32 list) |
| Begin a primive list's output. | |
| void | cc_video_begin_polygon (cc_screen_t *screen, cc_texture_t *txr) |
| Begin a polygon on the current primitive list. | |
| void | cc_video_begin_scene (cc_screen_t *screen) |
| Begin a scene of video output. | |
| void | cc_video_disable_clipping (cc_screen_t *screen) |
| Disable clipping on the screen. | |
| void | cc_video_enable_clipping (cc_screen_t *screen, uint32 minX, uint32 maxX, uint32 minY, uint32 maxY) |
| Enable clipping on the screen. | |
| void | cc_video_finish_list (cc_screen_t *screen) |
| End output of the current primitive list. | |
| void | cc_video_finish_polygon (cc_screen_t *screen) |
| End the polygon currently being processed. | |
| void | cc_video_finish_scene (cc_screen_t *screen) |
| End a scene of video output. | |
| int | cc_video_init (cc_screen_t *screen, uint32 width, uint32 height, uint32 bpp, uint32 xpos, uint32 ypos, const char title[], uint32 flags) |
| Initialize the video system of CrabClaw. | |
| int | cc_video_shutdown (cc_screen_t *screen) |
| Shut down the video system of CrabClaw. | |
| void | cc_video_submit_vertex (cc_screen_t *screen, cc_vertex_t *vert) |
| Submit a vertex for inclusion in the current polygon. | |
| #define CC_LIST_INVALID 0xFFFFFFFF |
Invalid primitive list.
This constant is not for use outside of CrabClaw. Use of this constant to describe a primitive will cause the primitive to be ignored. This is merely intended as an internal placeholder when no lists are open.
| #define CC_LIST_OPAQUE 0x01 |
Opaque primitive list.
Every primitive in CrabClaw belongs to a list. These lists may or may not be of the traditional type. They are merely there to describe certain attributes of the primitive in question in order to aid in its rendering. Primitives must be drawn in a certain order in order to ensure correct rendering. Opaque, or solid primitives must be drawn first.
| #define CC_LIST_PUNCHTHRU 0x02 |
Punch-thru primitive list.
Every primitive in CrabClaw belongs to a list. These lists may or may not be of the traditional type. They are merely there to describe certain attributes of the primitive in question in order to aid in its rendering. Primitives must be drawn in a certain order in order to ensure correct rendering. Punch-thru primitives must be drawn after any opaque primitives, but before any translucent primitives.
| #define CC_LIST_TRANSLUCENT 0x04 |
Translucent primitive list.
Every primitive in CrabClaw belongs to a list. These lists may or may not be of the traditional type. They are merely there to describe certain attributes of the primitive in question in order to aid in its rendering. Primitives must be drawn in a certain order in order to ensure correct rendering. Translucent primitives must be drawn after any opaque and punch-thru primitives.
| typedef struct cc_screen cc_screen_t |
A screen to which drawing occurs.
A cc_screen_t is an area to which primitives can be drawn. Currently only screens that correspond to the actual window of the program are supported. All fields in this structure should be considered by the user program to be read only (many are simply set on init, and then ignored).
| typedef struct cc_vertex cc_vertex_t |
A vertex to draw to a cc_screen_t.
A cc_vertex_t is the representation of one point on the screen. A vertex is used as a corner of a polygon.
| void cc_video_begin_list | ( | cc_screen_t * | screen, | |
| uint32 | list | |||
| ) |
Begin a primive list's output.
This function prepares CrabClaw to accept primitives of the given type. Each primitive belongs to a list to better handle sorting of primitives (also for congruence with the PVR of the Dreamcast). All opaque primitives must be drawn before punchthru primitives, and all punchthru before translucent.
| screen | The cc_screen_t to draw to. | |
| list | The primitive list to draw to. |
| void cc_video_begin_polygon | ( | cc_screen_t * | screen, | |
| cc_texture_t * | txr | |||
| ) |
Begin a polygon on the current primitive list.
This function begins drawing of a polygon in the current primitive list. The polygon may be textured if desired. Vertices must be submitted as a triangle strip.
| screen | The cc_screen_t to draw to. | |
| txr | The texture to apply, or NULL if texturing is not desired. |
| void cc_video_begin_scene | ( | cc_screen_t * | screen | ) |
Begin a scene of video output.
This function prepares CrabClaw for graphics primitives to be sent for the next scene of video output.
| screen | The cc_screen_t to draw to. |
| void cc_video_disable_clipping | ( | cc_screen_t * | screen | ) |
Disable clipping on the screen.
This function tells CrabClaw to disable clipping of primitives submitted to the given cc_screen_t.
| screen | The cc_screen_t to disable clipping on. |
| void cc_video_enable_clipping | ( | cc_screen_t * | screen, | |
| uint32 | minX, | |||
| uint32 | maxX, | |||
| uint32 | minY, | |||
| uint32 | maxY | |||
| ) |
Enable clipping on the screen.
This function tells CrabClaw to perform clipping of all primitives to be drawn on the screen. The granularity of this function differs from platform to platform.
| screen | The cc_screen_t to enable clipping on. | |
| minX | The left side of the clipping rectangle. | |
| maxX | The right side of the clipping rectangle. | |
| minY | The top side of the clipping rectangle. | |
| maxY | The bottom side of the clipping rectangle. |
| void cc_video_finish_list | ( | cc_screen_t * | screen | ) |
End output of the current primitive list.
This function informs CrabClaw that the program is finished drawing to the current primitive list for this frame.
| screen | The cc_screen_t to draw to. |
| void cc_video_finish_polygon | ( | cc_screen_t * | screen | ) |
End the polygon currently being processed.
This function informs CrabClaw that the polygon the program is currently drawing has been completed.
| screen | The cc_screen_t being drawn to. |
| void cc_video_finish_scene | ( | cc_screen_t * | screen | ) |
End a scene of video output.
This function informs CrabClaw that the video output for the current frame is complete.
| screen | The cc_screen_t drawn to. |
| int cc_video_init | ( | cc_screen_t * | screen, | |
| uint32 | width, | |||
| uint32 | height, | |||
| uint32 | bpp, | |||
| uint32 | xpos, | |||
| uint32 | ypos, | |||
| const char | title[], | |||
| uint32 | flags | |||
| ) |
Initialize the video system of CrabClaw.
This function initializes the video system of CrabClaw, setting up the cc_screen_t object passed in up with the appropriate settings.
| screen | The cc_screen_t object to initialize. | |
| width | The width of the video output. | |
| height | The height of the video output. | |
| bpp | Bits per pixel of the video output. | |
| xpos | X Position of the window. | |
| ypos | Y Position of the window. | |
| title | Title of the window. | |
| flags | Reserved for future use, pass 0 for now. |
| int cc_video_shutdown | ( | cc_screen_t * | screen | ) |
Shut down the video system of CrabClaw.
This function cleans up all resources associated with the video system in CrabClaw. The screen object passed in should be the same one passed into cc_video_init earlier.
| screen | The main screen of the program. |
| void cc_video_submit_vertex | ( | cc_screen_t * | screen, | |
| cc_vertex_t * | vert | |||
| ) |
Submit a vertex for inclusion in the current polygon.
This function submits a vertex to be included in the current polygon. The vertices should be submitted as a triangle strip.
| screen | The cc_screen_t to draw to. | |
| vert | The cc_vertex_t to submit. |