JacksEscape/render_util.h
Edgaru089 299272b7aa Shiny orb
What could it be?
2024-03-19 15:14:23 +08:00

71 lines
1.5 KiB
C

#pragma once
#include "types.h"
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#define TEXTHEIGHT 18
// Draws text at the given on-screen position.
//
// unlike outtext(), this function takes consideration
// for newlines.
void render_DrawText(int x, int y, const char *str);
// Fill modes.
typedef struct {
// Most often it's:
// R2_COPYPEN (Output = Pen color)
// R2_BLACK (Output = Black)
// R2_WHITE (Output = White)
// R2_NOT (Output = NOT Screen color)
//
// https://docs.easyx.cn/zh-cn/setrop2
int rop2;
// Style & hatch passed into setfillstyle()
//
// https://docs.easyx.cn/zh-cn/setfillstyle
int style;
long hatch;
// Rotates in /-\| every this amount of time, if not 0
// Overrides style & hatch
Duration rotate;
// Dissolve the entire screen in an animation in this
// amount of time. Overrides rotate, style & hatch
Duration dissolve;
bool fadein; // Fade Into being full for true, fade out of otherwise
} FillMode;
// Default fill mode.
// rop2 = R2_COPYPEN,
// style = BS_SOLID,
// others = 0
extern const FillMode render_DefaultMode;
typedef struct _App App;
// Calls the required setfillstyle/setrop2 calls for the struct.
void render_SetModes(FillMode mode, TimePoint since);
// Fills the entire screen
void render_FillScreen();
// Fills a rectangle in world coordinates
void render_FillRectW(App *app, Box2 rect);
// Fills a circle in world coordinates
void render_FillCircleW(App *app, Vec2 center, double radius);
#ifdef __cplusplus
}
#endif