mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
43 lines
547 B
C
43 lines
547 B
C
|
#pragma once
|
||
|
#include <stdlib.h>
|
||
|
#include <algorithm>
|
||
|
|
||
|
struct BaseVertex
|
||
|
{
|
||
|
float x, y, z;
|
||
|
float u, v;
|
||
|
|
||
|
void SetVertex(float _x, float _y, float _z = 0)
|
||
|
{
|
||
|
x = _x;
|
||
|
y = _y;
|
||
|
z = _z;
|
||
|
}
|
||
|
|
||
|
void SetTexCoord(float _u = 0, float _v = 0)
|
||
|
{
|
||
|
u = _u;
|
||
|
v = _v;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
enum EDrawType
|
||
|
{
|
||
|
DT_TRIANGLES,
|
||
|
DT_TRIANGLE_STRIP,
|
||
|
DT_TRIANGLE_FAN,
|
||
|
DT_QUADS,
|
||
|
DT_LINES
|
||
|
};
|
||
|
|
||
|
class GLInstance
|
||
|
{
|
||
|
|
||
|
public:
|
||
|
|
||
|
std::pair<size_t, BaseVertex *> AllocVertices(size_t num);
|
||
|
void Draw(EDrawType type, size_t start, size_t count);
|
||
|
|
||
|
};
|
||
|
|
||
|
extern GLInstance GLInterface;
|