本文整理汇总了C++中timer::get_ticks方法的典型用法代码示例。如果您正苦于以下问题:C++ timer::get_ticks方法的具体用法?C++ timer::get_ticks怎么用?C++ timer::get_ticks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类timer
的用法示例。
在下文中一共展示了timer::get_ticks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawGLScene
/* The main drawing function. */
void DrawGLScene(void)
{
const_move(delta.get_ticks());
delta.start();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glLoadIdentity(); // Reset The View
glTranslatef(-(gridsize/2) +1, 0, -30);
//glRotatef(zrot, 0.0f, 0.0f, 1.0f);
// choose the texture to use
glBindTexture(GL_TEXTURE_2D, texture[0]);
//glLoadIdentity();
for(float _xtrans_l =0; _xtrans_l < gridsize; _xtrans_l+=2)
{
for(float _ztrans_l =0; _ztrans_l < gridsize; _ztrans_l+=2)
{
//glPushMatrix();
glDisable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor3ub(144, 213, 225);
glLineWidth(1);
glPushMatrix();
// rotate triangle on y axis
/**glRotatef(xrot, 0.0f, 1.0f, 0.0f);*/
//glRotatef(0, 0.0f, 0.0f, 0.0f);
glTranslatef(_xtrans_l, _ytrans, _ztrans_l);
if(_xtrans_l != gridsize)
{
glBegin(GL_LINES);
glVertex3f(-1.0f, 0.0f, -1.0f);
glVertex3f(1.0f, 0.0f, -1.0f);
glEnd();
glBegin(GL_LINES);
glVertex3f(-1.0f, 0.0f, 1.0f);
glVertex3f(1.0f, 0.0f, 1.0f);
glEnd();
}
// {
// glBegin(GL_LINES);
// glVertex3f(0.0f, 0.0f, 0.0f);
// glVertex3f(2.0f, 0.0f, 0.0f);
// glEnd();
// }
if(_ztrans_l != gridsize)
{
glBegin(GL_LINES);
glVertex3f(-1.0f, 0.0f, -1.0f);
glVertex3f(-1.0f, 0.0f, 1.0f);
glEnd();
glBegin(GL_LINES);
glVertex3f(1.0f, 0.0f, -1.0f);
glVertex3f(1.0f, 0.0f, 1.0f);
glEnd();
}
// {
// glBegin(GL_LINES);
// glVertex3f(0.0f, 0.0f, 0.0f);
// glVertex3f(0.0f, 0.0f, 2.0f);
// glEnd();
// }
glPopMatrix();
}
}
glPushMatrix();
glTranslatef(_xtrans, _ytrans, _ztrans);
if(dir_array[0])
{
//up
glRotatef(90, 0, 1, 0);
}
else if(dir_array[1])
{
//right
glRotatef(0, 0, 1, 0);
}
else if(dir_array[2])
{
//down
glRotatef(-90, 0, 1, 0);
}
else if(dir_array[3])
{
//left
glRotatef(180, 0, 1, 0);
}
//draw cube for player palceholder
glBegin(GL_QUADS);
//bottom colour
//.........这里部分代码省略.........