2019-01-18 21:26:57 +01:00
|
|
|
#pragma once
|
2019-01-18 15:55:06 +01:00
|
|
|
#include "bbsys.hpp"
|
2019-01-18 21:26:57 +01:00
|
|
|
|
|
|
|
|
#include <gxgraphics.hpp>
|
|
|
|
|
#include <gxcanvas.hpp>
|
|
|
|
|
#include <gxscene.hpp>
|
|
|
|
|
#include <gxfont.hpp>
|
2014-01-31 08:23:00 +13:00
|
|
|
|
2019-01-18 17:04:17 +01:00
|
|
|
extern gxGraphics* gx_graphics;
|
|
|
|
|
extern gxCanvas* gx_canvas;
|
|
|
|
|
extern gxScene* gx_scene;
|
2014-01-31 08:23:00 +13:00
|
|
|
|
|
|
|
|
class bbImage;
|
|
|
|
|
|
|
|
|
|
//general graphics functions
|
2019-01-18 17:04:17 +01:00
|
|
|
int bbCountGfxDrivers();
|
|
|
|
|
BBStr* bbGfxDriverName(int n);
|
|
|
|
|
BBStr* bbGfxDriverDesc(int n);
|
|
|
|
|
void bbSetGfxDriver(int n);
|
|
|
|
|
int bbGfxModeExists(int w, int h, int d);
|
|
|
|
|
int bbCountGfxModes();
|
|
|
|
|
int bbGfxModeWidth(int n);
|
|
|
|
|
int bbGfxModeHeight(int n);
|
|
|
|
|
int bbGfxModeDepth(int n);
|
|
|
|
|
int bbGraphicsWidth();
|
|
|
|
|
int bbGraphicsHeight();
|
|
|
|
|
int bbGraphicsDepth();
|
|
|
|
|
int bbAvailVidMem();
|
|
|
|
|
int bbTotalVidMem();
|
2014-01-31 08:23:00 +13:00
|
|
|
|
|
|
|
|
//mode functions
|
2019-01-18 17:04:17 +01:00
|
|
|
void bbGraphics(int w, int h, int d, int mode);
|
|
|
|
|
gxCanvas* bbFrontBuffer();
|
|
|
|
|
gxCanvas* bbBackBuffer();
|
|
|
|
|
void bbEndGraphics();
|
|
|
|
|
int bbGraphicsLost();
|
|
|
|
|
int bbScanLine();
|
|
|
|
|
void bbVWait(int n);
|
|
|
|
|
void bbFlip(int vwait);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
|
|
|
|
//graphics buffer functions
|
2019-01-18 17:04:17 +01:00
|
|
|
void bbSetBuffer(gxCanvas* buff);
|
|
|
|
|
gxCanvas* bbGraphicsBuffer();
|
|
|
|
|
int bbLoadBuffer(gxCanvas* surf, BBStr* str);
|
|
|
|
|
int bbSaveBuffer(gxCanvas* surf, BBStr* str);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
|
|
|
|
//fast read/write operations...
|
2019-01-18 17:04:17 +01:00
|
|
|
void bbLockBuffer(gxCanvas* buff);
|
|
|
|
|
void bbUnlockBuffer(gxCanvas* buff);
|
|
|
|
|
int bbReadPixel(int x, int y, gxCanvas* buff);
|
|
|
|
|
void bbWritePixel(int x, int y, int argb, gxCanvas* buff);
|
|
|
|
|
int bbReadPixelFast(int x, int y, gxCanvas* buff);
|
|
|
|
|
void bbWritePixelFast(int x, int y, int argb, gxCanvas* buff);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
|
|
|
|
//2d rendering functions
|
2019-01-18 17:04:17 +01:00
|
|
|
void bbOrigin(int x, int y);
|
|
|
|
|
void bbViewport(int x, int y, int w, int h);
|
|
|
|
|
void bbColor(int r, int g, int b);
|
|
|
|
|
void bbClsColor(int r, int g, int b);
|
|
|
|
|
void bbCls();
|
|
|
|
|
void bbPlot(int x, int y);
|
|
|
|
|
void bbLine(int x1, int y1, int x2, int y2);
|
|
|
|
|
void bbRect(int x, int y, int w, int h, int solid);
|
|
|
|
|
void bbOval(int x, int y, int w, int h, int solid);
|
|
|
|
|
void bbText(int x, int y, BBStr* str, int centre_x, int centre_y);
|
|
|
|
|
void bbGetColor(int x, int y);
|
|
|
|
|
int bbColorRed();
|
|
|
|
|
int bbColorGreen();
|
|
|
|
|
int bbColorBlue();
|
2014-01-31 08:23:00 +13:00
|
|
|
|
|
|
|
|
//font functions
|
2019-01-18 17:04:17 +01:00
|
|
|
gxFont* bbLoadFont(BBStr* name, int height, int bold, int italic, int underline);
|
|
|
|
|
void bbFreeFont(gxFont* f);
|
|
|
|
|
void bbSetFont(gxFont* f);
|
|
|
|
|
int bbFontWidth();
|
|
|
|
|
int bbFontHeight();
|
|
|
|
|
int bbStringWidth(BBStr* str);
|
|
|
|
|
int bbStringHeight(BBStr* str);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
|
|
|
|
//image functions
|
2019-01-18 17:04:17 +01:00
|
|
|
bbImage* bbLoadImage(BBStr* s);
|
|
|
|
|
bbImage* bbCopyImage(bbImage* i);
|
|
|
|
|
bbImage* bbCreateImage(int w, int h, int n);
|
|
|
|
|
bbImage* bbLoadAnimImage(BBStr* s, int w, int h, int first, int cnt);
|
|
|
|
|
void bbFreeImage(bbImage* i);
|
|
|
|
|
int bbSaveImage(bbImage* i, BBStr* filename, int frame);
|
|
|
|
|
void bbGrabImage(bbImage* i, int x, int y, int n);
|
|
|
|
|
gxCanvas* bbImageBuffer(bbImage* i, int n);
|
|
|
|
|
void bbDrawImage(bbImage* i, int x, int y, int frame);
|
|
|
|
|
void bbDrawBlock(bbImage* i, int x, int y, int frame);
|
|
|
|
|
void bbTileImage(bbImage* i, int x, int y, int frame);
|
|
|
|
|
void bbTileBlock(bbImage* i, int x, int y, int frame);
|
|
|
|
|
void bbDrawImageRect(bbImage* i, int x, int y, int r_x, int r_y, int r_w, int r_h, int frame);
|
|
|
|
|
void bbDrawBlockRect(bbImage* i, int x, int y, int r_x, int r_y, int r_w, int r_h, int frame);
|
|
|
|
|
void bbMaskImage(bbImage* i, int r, int g, int b);
|
|
|
|
|
void bbHandleImage(bbImage* i, int x, int y);
|
|
|
|
|
void bbScaleImage(bbImage* i, float w, float h);
|
|
|
|
|
void bbResizeImage(bbImage* i, float w, float h);
|
|
|
|
|
void bbRotateImage(bbImage* i, float angle);
|
|
|
|
|
void bbTFormImage(bbImage* i, float a, float b, float c, float d);
|
|
|
|
|
void bbTFormFilter(int enable);
|
|
|
|
|
void bbAutoMidHandle(int enable);
|
|
|
|
|
void bbMidHandle(bbImage* i);
|
|
|
|
|
int bbImageWidth(bbImage* i);
|
|
|
|
|
int bbImageHeight(bbImage* i);
|
|
|
|
|
int bbImageXHandle(bbImage* i);
|
|
|
|
|
int bbImageYHandle(bbImage* i);
|
|
|
|
|
int bbImagesOverlap(bbImage* i1, int x1, int y1, bbImage* i2, int x2, int y2);
|
|
|
|
|
int bbImagesCollide(bbImage* i1, int x1, int y1, int f1, bbImage* i2, int x2, int y2, int f2);
|
|
|
|
|
int bbRectsOverlap(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
|
|
|
|
|
int bbImageRectOverlap(bbImage* i, int x, int y, int r_x, int r_y, int r_w, int r_h);
|
|
|
|
|
int bbImageRectCollide(bbImage* i, int x, int y, int f, int r_x, int r_y, int r_w, int r_h);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
|
|
|
|
//simple print functions
|
2019-01-18 17:04:17 +01:00
|
|
|
void bbWrite(BBStr* str);
|
|
|
|
|
void bbPrint(BBStr* str);
|
|
|
|
|
BBStr* bbInput(BBStr* prompt);
|
|
|
|
|
void bbLocate(int x, int y);
|