nehewidget.h
来自「一些OpenGL的开发实例」· C头文件 代码 · 共 72 行
H
72 行
/* Qt OpenGL Tutorial - Lesson 09 nehewidget.h v 1.00 2002/12/19 Copyright (C) 2002 Cavendish cavendish@qiliang.net http://www.qiliang.net/nehe_qt This program 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 2 of the License, or (at your option) any later version.*/#ifndef NEHEWIDGET_H#define NEHEWIDGET_H#include <qgl.h>#include <qtimer.h>const GLuint num = 50;typedef struct{ int r, g, b; GLfloat dist; GLfloat angle;}stars;class NeHeWidget : public QGLWidget{ Q_OBJECTpublic: NeHeWidget( QWidget* parent = 0, const char* name = 0, bool fs = false ); ~NeHeWidget();protected: void initializeGL(); void paintGL(); void resizeGL( int width, int height ); void keyPressEvent( QKeyEvent *e ); void loadGLTextures(); void timerEvent( QTimerEvent * );protected: bool fullscreen; GLfloat xRot, yRot, zRot; GLfloat zoom; GLfloat tilt; GLfloat spin; GLuint loop; GLuint texture[1]; bool twinkle; stars star[num];};#endif//NEHEWIDGET_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?