PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
draw2d.h File Reference
#include <tamtypes.h>
#include <draw_types.h>
+ Include dependency graph for draw2d.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  point_t
 
struct  line_t
 
struct  triangle_t
 
struct  rect_t
 
struct  texrect_t
 

Functions

void draw_enable_blending ()
 
void draw_disable_blending ()
 
qword_t * draw_point (qword_t *q, int context, point_t *point)
 
qword_t * draw_line (qword_t *q, int context, line_t *line)
 
qword_t * draw_triangle_outline (qword_t *q, int context, triangle_t *triangle)
 
qword_t * draw_triangle_filled (qword_t *q, int context, triangle_t *triangle)
 
qword_t * draw_rect_outline (qword_t *q, int context, rect_t *rect)
 
qword_t * draw_rect_filled (qword_t *q, int context, rect_t *rect)
 
qword_t * draw_rect_textured (qword_t *q, int context, texrect_t *rect)
 
qword_t * draw_rect_filled_strips (qword_t *q, int context, rect_t *rect)
 
qword_t * draw_rect_textured_strips (qword_t *q, int context, texrect_t *rect)
 
qword_t * draw_round_rect_filled (qword_t *q, int context, rect_t *rect)
 
qword_t * draw_round_rect_outline (qword_t *q, int context, rect_t *rect)
 
qword_t * draw_arc_outline (qword_t *q, int context, point_t *center, float radius, float angle_start, float angle_end)
 
qword_t * draw_arc_filled (qword_t *q, int context, point_t *center, float radius, float angle_start, float angle_end)
 

Detailed Description

Draw library 2D functions

Definition in file draw2d.h.


Data Structure Documentation

◆ point_t

struct point_t

Definition at line 13 of file draw2d.h.

+ Collaboration diagram for point_t:
Data Fields
vertex_t v0
color_t color

◆ line_t

struct line_t

Definition at line 18 of file draw2d.h.

+ Collaboration diagram for line_t:
Data Fields
vertex_t v0
vertex_t v1
color_t color

◆ triangle_t

struct triangle_t

Definition at line 24 of file draw2d.h.

+ Collaboration diagram for triangle_t:
Data Fields
vertex_t v0
vertex_t v1
vertex_t v2
color_t color

◆ rect_t

struct rect_t

Definition at line 31 of file draw2d.h.

+ Collaboration diagram for rect_t:
Data Fields
vertex_t v0
vertex_t v1
color_t color

◆ texrect_t

struct texrect_t

Definition at line 37 of file draw2d.h.

+ Collaboration diagram for texrect_t:
Data Fields
vertex_t v0
texel_t t0
vertex_t v1
texel_t t1
color_t color

Function Documentation

◆ draw_enable_blending()

void draw_enable_blending ( )

Enables alpha blending

Definition at line 29 of file draw2d.c.

References draw_enable_blending().

Referenced by draw_enable_blending().

◆ draw_disable_blending()

void draw_disable_blending ( )

Disables alpha blending

Definition at line 34 of file draw2d.c.

References draw_disable_blending().

Referenced by draw_disable_blending().

◆ draw_point()

qword_t * draw_point ( qword_t *  q,
int  context,
point_t point 
)

Draws a single point

Definition at line 39 of file draw2d.c.

References draw_point(), GIF_FLG_REGLIST, and PRIM_POINT.

Referenced by draw_point().

◆ draw_line()

qword_t * draw_line ( qword_t *  q,
int  context,
line_t line 
)

Draws a single line

Definition at line 64 of file draw2d.c.

References draw_line(), and GIF_FLG_REGLIST.

Referenced by draw_line(), and draw_round_rect_outline().

◆ draw_triangle_outline()

qword_t * draw_triangle_outline ( qword_t *  q,
int  context,
triangle_t triangle 
)

Draws a triangle using a line strip

Definition at line 91 of file draw2d.c.

References draw_triangle_outline(), and GIF_FLG_REGLIST.

Referenced by draw_triangle_outline().

◆ draw_triangle_filled()

qword_t * draw_triangle_filled ( qword_t *  q,
int  context,
triangle_t triangle 
)

Draws a single triangle

Definition at line 126 of file draw2d.c.

References draw_triangle_filled(), and GIF_FLG_REGLIST.

Referenced by draw_triangle_filled().

◆ draw_rect_outline()

qword_t * draw_rect_outline ( qword_t *  q,
int  context,
rect_t rect 
)

Draws a rectangle using line primitives

Definition at line 159 of file draw2d.c.

References draw_rect_outline(), and GIF_FLG_REGLIST.

Referenced by draw_rect_outline().

◆ draw_rect_filled()

qword_t * draw_rect_filled ( qword_t *  q,
int  context,
rect_t rect 
)

Draws a single sprite

Definition at line 197 of file draw2d.c.

References draw_rect_filled(), and GIF_FLG_REGLIST.

Referenced by draw_rect_filled(), and draw_round_rect_filled().

◆ draw_rect_textured()

qword_t * draw_rect_textured ( qword_t *  q,
int  context,
texrect_t rect 
)

Draws a single texture mapped sprite

Definition at line 224 of file draw2d.c.

References draw_rect_textured(), and GIF_FLG_REGLIST.

Referenced by draw_rect_textured().

◆ draw_rect_filled_strips()

qword_t * draw_rect_filled_strips ( qword_t *  q,
int  context,
rect_t rect 
)

◆ draw_rect_textured_strips()

qword_t * draw_rect_textured_strips ( qword_t *  q,
int  context,
texrect_t rect 
)

Draws multiple strips to render a large texture width must be multiple of 32 - 0.9375

Definition at line 303 of file draw2d.c.

References draw_rect_textured_strips(), GIF_FLG_PACKED, GIF_FLG_REGLIST, GIF_REG_AD, GIF_REG_PRIM, and GIF_REG_RGBAQ.

Referenced by draw_rect_textured_strips().

◆ draw_round_rect_filled()

qword_t * draw_round_rect_filled ( qword_t *  q,
int  context,
rect_t rect 
)

Draws filled round rectangle, buggy with partial coordinates

Definition at line 482 of file draw2d.c.

References draw_arc_filled(), draw_rect_filled(), draw_rect_filled_strips(), and draw_round_rect_filled().

Referenced by draw_round_rect_filled().

◆ draw_round_rect_outline()

qword_t * draw_round_rect_outline ( qword_t *  q,
int  context,
rect_t rect 
)

Draws a hollow round rectangle, buggy with partial coordinates

Definition at line 579 of file draw2d.c.

References draw_arc_outline(), draw_line(), and draw_round_rect_outline().

Referenced by draw_round_rect_outline().

◆ draw_arc_outline()

qword_t * draw_arc_outline ( qword_t *  q,
int  context,
point_t center,
float  radius,
float  angle_start,
float  angle_end 
)

Draws an arc using line primitives

Definition at line 370 of file draw2d.c.

References draw_arc_outline(), DRAW_XYZ_REGLIST, GIF_FLG_PACKED, GIF_FLG_REGLIST, GIF_REG_AD, GIF_REG_PRIM, and GIF_REG_RGBAQ.

Referenced by draw_arc_outline(), and draw_round_rect_outline().

◆ draw_arc_filled()

qword_t * draw_arc_filled ( qword_t *  q,
int  context,
point_t center,
float  radius,
float  angle_start,
float  angle_end 
)

Draws multiple triangle fans

Definition at line 425 of file draw2d.c.

References draw_arc_filled(), DRAW_XYZ_REGLIST, GIF_FLG_PACKED, GIF_FLG_REGLIST, GIF_REG_AD, GIF_REG_PRIM, and GIF_REG_RGBAQ.

Referenced by draw_arc_filled(), and draw_round_rect_filled().