📄 gluttimer.h
字号:
// ___ ___ ___ ___ ___ // /\__\ ___ /\__\ /\ \ /\__\ /\ \. // /::| | /\ \ /::| | /::\ \ /:/ / /::\ \. // /:|:| | \:\ \ /:|:| | /:/\:\ \ /:/ / /:/\:\ \. // /:/|:|__|__ /::\__\ /:/|:| |__ /:/ \:\ \ /:/ / /::\~\:\ \. // /:/ |::::\__\ __/:/\/__/ /:/ |:| /\__\ /:/__/_\:\__\ /:/__/ /:/\:\ \:\__\.// \/__/~~/:/ / /\/:/ / \/__|:|/:/ / \:\ /\ \/__/ \:\ \ \:\~\:\ \/__/// /:/ / \::/__/ |:/:/ / \:\ \:\__\ \:\ \ \:\ \:\__\. // /:/ / \:\__\ |::/ / \:\/:/ / \:\ \ \:\ \/__/ // /:/ / \/__/ /:/ / \::/ / \:\__\ \:\__\. // \/__/ \/__/ \/__/ \/__/ \/__/ // // =============================================================================// Minimalist OpenGL Environment// =============================================================================//// This file is part of Minimalist OpenGL Environment (MinGLE)//// Version: 0.2.0// Author: Balazs Domonkos// Filename: src/GLUT/include/GLUTTimer.h// Creation Date: December 12th 2007// Revision Date: December 12th 2007////// The Minimalist OpenGL Environment is free software: you can// redistribute it and/or modify it under the terms of the GNU// General Public License as published by the Free Software// Foundation, either version 3 of the License, or (at your// option) any later version.//// The Minimalist OpenGL Environment is distributed in the hope// that it will be useful, but WITHOUT ANY WARRANTY; without// even the implied warranty of MERCHANTABILITY or FITNESS FOR// A PARTICULAR PURPOSE. See the GNU General Public License// for more details.//// You should have received a copy of the GNU General Public License// along with Minimalist OpenGL Environment. If not, see // <http://www.gnu.org/licenses/>. See the COPYING file included // with this distribution file for license details.///// @file GLUTTimer.h/// GLUT timer class#ifndef __MINGLE_GLUTTIMER_H__#define __MINGLE_GLUTTIMER_H__// Include class definitions#include <classes.h>// MinGLE headers#include <Timer.h>#include <GLUTWindow.h>// System headers#include <vector>namespace MinGLE {class GLUTTimer : public Timer { friend class GLUTWindow;protected: static const double GLUT_GRANULARITY = 0.001; typedef std::vector<GLUTTimer*> TimerTable;protected: static TimerTable mTimerTable; bool mPausing; int mIndex;protected: GLUTTimer(GLUTWindow *window, double period, TimerType type = TIMER_PERIODIC); virtual ~GLUTTimer();public: // Start and stop inline virtual void start(); inline virtual void pause(); virtual double getGranularity() { return GLUT_GRANULARITY; }protected: inline static void _onTickStatic(int value) { mTimerTable[value]->_onTick(); } void _onTick(); void _addToTimerTable(); void _removeFromTimerTable(); void _registerGlutCallback();}; // class GLUTTimer} // namespace MinGLE#endif // __MINGLE_TIMER_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -