beginning to create pedestal VBO
This commit is contained in:
parent
122952f13c
commit
a324dc7d6e
@ -9,6 +9,20 @@
|
|||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
|
|
||||||
#include "Pedestal.h"
|
#include "Pedestal.h"
|
||||||
|
#include "glslUtil/glslUtil.h"
|
||||||
|
|
||||||
|
#define N_PEDESTAL_LEVELS 4
|
||||||
|
#define TOP_LEVEL_SIZE 4
|
||||||
|
#define LEVEL_INC_SIZE 1.5
|
||||||
|
#define LEVEL_HEIGHT 1
|
||||||
|
|
||||||
|
static const GLfloat ped_normals[][3] = {
|
||||||
|
{1, 0, 0},
|
||||||
|
{0, 1, 0},
|
||||||
|
{-1, 0, 0},
|
||||||
|
{0, -1, 0},
|
||||||
|
{0, 0, 1}
|
||||||
|
};
|
||||||
|
|
||||||
Pedestal::Pedestal()
|
Pedestal::Pedestal()
|
||||||
{
|
{
|
||||||
@ -58,6 +72,23 @@ bool Pedestal::configure (GnomeScreensaver & gs)
|
|||||||
|
|
||||||
glViewport(0, 0, gs.getWidth(), gs.getHeight());
|
glViewport(0, 0, gs.getWidth(), gs.getHeight());
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
struct {
|
||||||
|
GLfloat pos[3];
|
||||||
|
GLfloat normal[3];
|
||||||
|
} verts[8];
|
||||||
|
} ped_vertex_data_t;
|
||||||
|
ped_vertex_data_t * vdata = new ped_vertex_data_t[N_PEDESTAL_LEVELS];
|
||||||
|
m_ped_vbo_id = guMakeBuffer(GL_ARRAY_BUFFER, GL_STATIC_DRAW,
|
||||||
|
vdata, N_PEDESTAL_LEVELS * sizeof(vdata[0]));
|
||||||
|
for (int i = 0; i < N_PEDESTAL_LEVELS; i++)
|
||||||
|
{
|
||||||
|
float z = i * LEVEL_HEIGHT;
|
||||||
|
float r = TOP_LEVEL_SIZE / 2.0
|
||||||
|
+ LEVEL_INC_SIZE * (N_PEDESTAL_LEVELS - 1 - i);
|
||||||
|
}
|
||||||
|
delete[] vdata;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ class Pedestal : public Mode
|
|||||||
LogoBox m_logobox;
|
LogoBox m_logobox;
|
||||||
uint64_t m_last_ticks;
|
uint64_t m_last_ticks;
|
||||||
uint64_t m_start_ticks;
|
uint64_t m_start_ticks;
|
||||||
|
GLint m_ped_vbo_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PEDESTAL_H */
|
#endif /* PEDESTAL_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user