#pragma comment(lib, "glaux.lib")
#include <tchar.h>
#include <GL/glut.h>
#include <GL/glaux.h>
#define N 20000
float timespan = 0.005;
float wind[3];
struct {
float life, fade, r, g, b, x, y, z, xv, yv, zv, xa, ya, za;
} p[N + 2];
void initial() {
AUX_RGBImageRec *textureImage;
textureImage = auxDIBImageLoad(_T("particle.bmp"));
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, textureImage->sizeX, textureImage->sizeY, GL_RGB, GL_UNSIGNED_BYTE, textureImage->data);
glShadeModel(GL_SMOOTH);
glClearColor(0, 0, 0, 0);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glEnable(GL_TEXTURE_2D);
}
void display() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60, 1, 0.1, 20);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0, 0, 0.8, 0, 0, 0, 0, 1, 0);
glTranslated(0.0, -4, 0.0);
for (int i = 1; i <= N; i+
代码染色!
最新推荐文章于 2024-07-09 11:25:55 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)