From 03149e5536a831e2ea7a20175f04938343529c99 Mon Sep 17 00:00:00 2001 From: rodri Date: Wed, 7 Aug 2024 11:47:31 +0000 Subject: offset fb during drawing based on viewport config. move OBJ-related procedures to its own unit. --- graphics.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'graphics.h') diff --git a/graphics.h b/graphics.h index dfc9f39..4aa18f1 100644 --- a/graphics.h +++ b/graphics.h @@ -261,10 +261,10 @@ struct Framebufctl uint idx; /* front buffer index */ uint upfilter; /* upscaling filter */ - void (*draw)(Framebufctl*, Image*); - void (*upscaledraw)(Framebufctl*, Image*, Point); - void (*memdraw)(Framebufctl*, Memimage*); - void (*upscalememdraw)(Framebufctl*, Memimage*, Point); + void (*draw)(Framebufctl*, Image*, Point); + void (*upscaledraw)(Framebufctl*, Image*, Point, Point); + void (*memdraw)(Framebufctl*, Memimage*, Point); + void (*upscalememdraw)(Framebufctl*, Memimage*, Point, Point); void (*drawnormals)(Framebufctl*, Image*); void (*swap)(Framebufctl*); void (*reset)(Framebufctl*); @@ -283,6 +283,8 @@ struct Viewport void (*setscale)(Viewport*, double, double); void (*setscalefilter)(Viewport*, int); Framebuf *(*getfb)(Viewport*); + int (*getwidth)(Viewport*); + int (*getheight)(Viewport*); }; struct Camera @@ -344,8 +346,11 @@ Point3 world2model(Entity*, Point3); void perspective(Matrix3, double, double, double, double); void orthographic(Matrix3, double, double, double, double, double, double); -/* scene */ +/* obj */ int loadobjmodel(Model*, OBJ*); +Model *readobjmodel(char*); + +/* scene */ Model *newmodel(void); Model *dupmodel(Model*); void delmodel(Model*); -- cgit v1.2.3