#define ROUND_DOWN(v,p) (floorf(v * p) / p)
#define EQUF(a, b) (fabsf(a-b)<=FLT_EPSILON)
+#ifndef MAX
+ #define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef MIN
+ #define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
#include "cross_os.h"
#include "cross_mutex.h"
#include "stb_image_write.h"
#include "vkh_image.h"
+#define max(x,y)
void vkvg_surface_clear (VkvgSurface surf) {
_clear_surface(surf, VK_IMAGE_ASPECT_STENCIL_BIT|VK_IMAGE_ASPECT_COLOR_BIT);
}
if (!surf)
return NULL;
- surf->width = width;
- surf->height = height;
+ surf->width = MAX(1, width);
+ surf->height = MAX(1, height);
surf->new = true;//used to clear all attacments on first render pass
_create_surface_images (surf);
if (!surf)
return NULL;
- surf->width = width;
- surf->height = height;
+ surf->width = MAX(1, width);
+ surf->height = MAX(1, height);
_create_surface_images (surf);