11 #define SCALING_NONE 0
12 #define SCALING_RATIO 1
14 /// GSKit CLUT base struct. This should've been in gsKit from the start :)
16 u8 PSM
; ///< Pixel Storage Method (Color Format)
17 u8 ClutPSM
; ///< CLUT Pixel Storage Method (Color Format)
18 u32
*Clut
; ///< EE CLUT Memory Pointer
19 u32 VramClut
; ///< GS VRAM CLUT Memory Pointer
34 // Some convenience globals
39 const u64 gDefaultCol
;
40 const u64 gDefaultAlpha
;
48 /** Initializes the rendering manager */
51 /** Sets a new screen mode */
52 int rmSetMode(int force
);
56 /** Fills the parameters with the screen width and height */
57 void rmGetScreenExtents(int *w
, int *h
);
59 /** Manually prepares a texture for rendering (should not be normally needed).
60 * txt->Vram will be nonzero on success.
61 * @param txt The texture to upload (if not uploaded already)
62 * @return 1 if ok, 0 if error uploading happened (likely too big texture) */
63 int rmPrepareTexture(GSTEXTURE
* txt
);
65 /** Flushes all rendering buffers - renders the gs queue, removes all textures from GS ram */
68 /** Issues immediate rendering of the accumulated operations */
69 void rmDispatch(void);
71 void rmDrawQuad(rm_quad_t
* q
);
73 void rmSetupQuad(GSTEXTURE
* txt
, int x
, int y
, short aligned
, int w
, int h
, short scaled
, u64 color
, rm_quad_t
* q
);
75 /** Queues a specified pixmap (tinted with colour) to be rendered on specified position */
76 void rmDrawPixmap(GSTEXTURE
* txt
, int x
, int y
, short aligned
, int w
, int h
, short scaled
, u64 color
);
78 void rmDrawOverlayPixmap(GSTEXTURE
* overlay
, int x
, int y
, short aligned
, int w
, int h
, short scaled
, u64 color
,
79 GSTEXTURE
* inlay
, int ulx
, int uly
, int urx
, int ury
, int blx
, int bly
, int brx
, int bry
);
81 /** Queues a opaque rectangle to be rendered */
82 void rmDrawRect(int x
, int y
, int w
, int h
, u64 color
);
84 /** Queues a single color line to be rendered */
85 void rmDrawLine(int x
, int y
, int x1
, int y1
, u64 color
);
87 /** Starts the frame - first to call every frame */
88 void rmStartFrame(void);
90 /** Ends the frame - last to call every frame */
91 void rmEndFrame(void);
93 /** Sets the aspect ratio correction for the upcoming operations.
94 * When set, it will treat all pixmap widths/heights (not positions) as scaled with the ratios provided */
95 void rmSetAspectRatio(float width
, float height
);
97 /** Resets aspect ratio back to 1:1 */
98 void rmResetAspectRatio();
100 /** gets the current aspect ratio */
101 void rmGetAspectRatio(float *w
, float *h
);
103 void rmApplyAspectRatio(int* w
, int* h
);
105 void rmSetShiftRatio(float height
);
107 void rmResetShiftRatio();
109 void rmApplyShiftRatio(int* y
);
111 /** sets the transposition coordiantes (all content is transposed with these values) */
112 void rmSetTransposition(float x
, float y
);