Problem displaying point sprites

Apprentice
Posts: 5
Joined: 2010.02
Post: #1
I'm trying to write a simple particle system, and I'm trying to use point sprites to represent each particle for performance sake. However, I must be missing something when trying to draw my point sprites, because I can't get them to show up on screen. I can verify that they are being updated correctly because if I copy the data into individual triangle strips and draw that, the particles display correctly. I store the particles in the following struct and am attempting to use the following drawing code, with no success:

Code:
//A Vector3D is an x,y,z position using three floats
//A Color3D is an RGBA color using four floats
typedef struct
{
    Color3D color;
    float energy;
    Vector3D position;
    Vector3D velocity;
    float scale;
} Particle;


Code:
    glEnableClientState(GL_POINT_SPRITE_OES);
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_COLOR_ARRAY);
    
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
        glBindTexture(GL_TEXTURE_2D, 6);
    glVertexPointer(3, GL_FLOAT, sizeof(Particle), &particles[0].position);
    glColorPointer(4, GL_FLOAT, sizeof(Particle), &particles[0].color);
        glPointSizePointerOES(GL_FLOAT, sizeof(Particle), &particles[0].scale);
        glDrawArrays(GL_POINTS, 0, arraylength);
    
        glDisableClientState(GL_POINT_SPRITE_OES);
    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_COLOR_ARRAY);
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  UIView Subclass not displaying controls... flipflop 7 6,619 May 13, 2010 01:16 PM
Last Post: flipflop
  conditionally displaying interface elements aerospaceman 2 2,620 Jun 25, 2009 12:20 PM
Last Post: aerospaceman
  Point sprites and alpha blending issue OptimisticMonkey 4 4,357 Jun 18, 2009 03:25 PM
Last Post: ThemsAllTook
  OpenGL ES (displaying model) green_ghost 2 3,042 Oct 14, 2008 07:10 AM
Last Post: codetiger