summaryrefslogtreecommitdiff
path: root/graphics.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-08-07 11:47:31 +0000
committerrodri <rgl@antares-labs.eu>2024-08-07 11:47:31 +0000
commit03149e5536a831e2ea7a20175f04938343529c99 (patch)
tree9494afdaa6be39a528640b2bf43bb773c1b55cf3 /graphics.h
parent05ae0d42a944f6c7d940a5e58eb90b619dadbfdb (diff)
downloadlibgraphics-03149e5536a831e2ea7a20175f04938343529c99.tar.gz
libgraphics-03149e5536a831e2ea7a20175f04938343529c99.tar.bz2
libgraphics-03149e5536a831e2ea7a20175f04938343529c99.zip
offset fb during drawing based on viewport config. move OBJ-related procedures to its own unit.
Diffstat (limited to 'graphics.h')
-rw-r--r--graphics.h15
1 files changed, 10 insertions, 5 deletions
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*);