1. Import functions in the glext Dynamic Link Library
# Include <GL \ glext. h> required glpointparameterfarb = NULL; required glpointparameterfvarb = NULL; char * ext = (char *) glgetstring (gl_extensions); If (strstr (EXT, "gl_arb_point_parameters") = NULL) {MessageBox (null, "gl_arb_point_parameters extension can't be found", error, mb_ OK | mb_iconexclamation); exit (0);} else {glpointparameterfarb = (pfnglpointparameterfarbproc) Wglgetprocaddress ("glpointparameterfarb"); glpointparameterfvarb = (pfnglpointparameterfvarbproc) wglgetprocaddress ("glpointparameterfvarb"); If (! Glpointparameterfarb |! Glpointparameterfvarb) {MessageBox (null, "one or more gl_arb_point_parameters functions cannot be found", "error", mb_ OK | mb_iconexclamation); exit (0 );}}
2. Set attributes
Gl_texture_2d; float quadratic [] = {1.0, 0, 0, 1.0}; glable (gl_blend); glblendfunc (gl_src_alpha, gl_one_minus_src_alpha); // when using electrical parameters, we need dots instead of square dots, so we need to enable the anti-aliasing function, which is to complete this task gldisable (gl_depth_test); gl_point_sprite); glpointparameterfvarb (Measures, quadratic ); glpointparameterfarb (latency, 10.0f); gltexenvf (latency, latency, gl_true); glpointparameterfarb (latency, m_participant lesize); gltexenvi (latency, latency, gl_true); glpointparameteri (latency, latency );
3. Usage of image points
glBegin(GL_POINTS);DrawParticles(pParticles, len);glEnd();