Click here to Skip to main content
Click here to Skip to main content
Articles » Multimedia » OpenGL » General » Downloads
 
Add your own
alternative version

Quagmire Particle Engine

, 23 Feb 2005
An object oriented OpenGL particle engine, for the simple creation of advanced particle effects.
particleengine_demo.zip
FireEngine.exe
FireEngine.dsp
FireEngine.dsw
glut32.dll
particle.bmp
particleengine_src.zip
#include <windows.h>
#include <GL/glut.h>
#include <stdlib.h>
#include "FireEngine.h"

QdFireEngine pe(1.0f, 0.2f, 0.0f, 1.0f);

void display(void)
{
	glPushMatrix();
	glLoadIdentity();
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glColor3f(1.0,1.0,1.0);
	pe.draw();
	glutSwapBuffers();
    glutPostRedisplay();
    glPopMatrix();
}


void init(void) 
{
	pe.setLimit(-2, 2, -1, 3);
	pe.init(1000);

	glEnable(GL_LIGHTING);
	glEnable(GL_LIGHT0);
	glShadeModel(GL_SMOOTH);				
	glEnable(GL_COLOR_MATERIAL);
	glMatrixMode(GL_PROJECTION);					
	glLoadIdentity();								
	glMatrixMode(GL_MODELVIEW);	
	glEnable(GL_TEXTURE_2D);
	glDisable(GL_DEPTH_TEST);					
	glEnable(GL_BLEND);									
	glBlendFunc(GL_SRC_ALPHA,GL_ONE);	
}

//Function is called when the dimensions of the client area change
void reshape(int w, int h)
{
   glViewport (0, 0, (GLsizei) w, (GLsizei) h);
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
}


//Function that is run first
void main(void)
{
   glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
   glutInitWindowSize (500, 500); 
   glutInitWindowPosition (100, 100);
   glutCreateWindow ("Quagmire Particle Engine Environment");
   init();
   glutDisplayFunc(display); 
   glutReshapeFunc(reshape); 
   glutMainLoop();
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Ken Mazaika

United States United States
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.1411019.1 | Last Updated 23 Feb 2005
Article Copyright 2005 by Ken Mazaika
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid