Rename MAX_VERTS_PER_DRAW to MAX_VERTS
This commit is contained in:
@@ -9,8 +9,6 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <xf86drm.h>
|
#include <xf86drm.h>
|
||||||
|
|
||||||
#define MAX_VERTS_PER_DRAW 8U
|
|
||||||
|
|
||||||
static int drm_fd;
|
static int drm_fd;
|
||||||
static drmModeConnector *conn;
|
static drmModeConnector *conn;
|
||||||
static drmModeCrtc *crtc;
|
static drmModeCrtc *crtc;
|
||||||
@@ -22,7 +20,7 @@ static int front, back;
|
|||||||
static uint32_t width, height;
|
static uint32_t width, height;
|
||||||
static mat3_t view;
|
static mat3_t view;
|
||||||
|
|
||||||
static vec3_t vert_buf[MAX_VERTS_PER_DRAW];
|
static vec3_t vert_buf[MAX_VERTS];
|
||||||
|
|
||||||
static void page_flip_handler(int, unsigned, unsigned, unsigned, void *)
|
static void page_flip_handler(int, unsigned, unsigned, unsigned, void *)
|
||||||
{
|
{
|
||||||
@@ -146,7 +144,7 @@ void renderer_swap()
|
|||||||
void renderer_draw(const vec2_t *vs, unsigned count, mat3_t model)
|
void renderer_draw(const vec2_t *vs, unsigned count, mat3_t model)
|
||||||
{
|
{
|
||||||
mat3_t transform = mat3_mul_mat3(view, model);
|
mat3_t transform = mat3_mul_mat3(view, model);
|
||||||
assert(count < MAX_VERTS_PER_DRAW);
|
assert(count < MAX_VERTS);
|
||||||
for (unsigned i = 0; i < count; ++i)
|
for (unsigned i = 0; i < count; ++i)
|
||||||
vert_buf[i] = mat3_mul_vec3(transform, vec2_extend(vs[i]));
|
vert_buf[i] = mat3_mul_vec3(transform, vec2_extend(vs[i]));
|
||||||
for (unsigned i = 1; i < count; ++i)
|
for (unsigned i = 1; i < count; ++i)
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define MAX_VERTS 8U
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int drm_fd;
|
int drm_fd;
|
||||||
float aspect;
|
float aspect;
|
||||||
|
|||||||
Reference in New Issue
Block a user