quakeforge/ruamoko/include/draw.h
Bill Currie 125821fcdd [render] Add basic 2d line drawing
The software renderer uses Bresenham's line slice algorithm as presented
by Michael Abrash in his Graphics Programming Black Book Special Edition
with the serial numbers filed off (as such, more just so *I* can read
the code easily), along with the Chen-Sutherland line clipping
algorithm. The other renderers were more or less trivial in comparison.
2022-09-22 09:35:56 +09:00

48 lines
1.4 KiB
Objective-C

#ifndef __ruamoko_draw_h
#define __ruamoko_draw_h
#include <Object.h>
struct _qpic_t {
int width;
int height;
int handle;
};
typedef struct _qpic_t *qpic_t;
@extern int Draw_Width (void);
@extern int Draw_Height (void);
@extern void Draw_FreePic (qpic_t pic);
@extern qpic_t Draw_MakePic (int width, int heiight, string data);
@extern qpic_t Draw_CachePic (string name, int alpha);
@extern void Draw_Pic (int x, int y, qpic_t pic);
@extern void Draw_Picf (float x, float y, qpic_t pic);
@extern void Draw_SubPic (int x, int y, qpic_t pic, int srcx, int srcy, int width, int height);
@extern void Draw_CenterPic (int x, int y, qpic_t pic);
@extern void Draw_Character (int x, int y, int chr);
@extern void Draw_String (int x, int y, string text);
@extern void Draw_nString (int x, int y, string text, int n);
@extern void Draw_AltString (int x, int y, string text);
@extern void Draw_Fill (int x, int y, int w, int h, int c);
@extern void Draw_Line (int x0, int y0, int x1, int y1, int c);
@extern void Draw_Crosshair (int ch, int x, int y);
@extern void text_box (int x, int y, int width, int lines);
@interface QPic : Object
{
string name;
struct _qpic_t size;
BOOL centered;
}
-initName:(string)n;
-initName:(string)n Centered:(BOOL)c;
-draw:(int)x :(int)y;
-draw:(int)x :(int)y :(int)srcx :(int)srcy :(int)width :(int)height;
-(int)width;
-(int)height;
@end
#endif//__ruamoko_draw_h