OpenGLed but slow

Hello everyone!

I’m a college student I’m writing a program for my faculty, and I meet with some bottleneck here:

it’s a demonstration of some particles moving around, and I do it like this: a timer call InvalidateRect every 50ms, and in OnPaint, I call a function updates the particles’ positions and redraw the whole scene, it was ok, but after I add some texture mapping on the experiment devices, the speed becomes unbearably slow, I think redrawing the whole scene rapidly cost much resource, but I wonder how those 3D games make it? For examp, in a tank game, when a tank fires a bullet out, don’t it need to redraw the whole scene?

So I need some help to boost my program’s performance here …

Thank you ahead!

ps: I used gluBuild2DMipmap, I’ve already seen in some post that it’s slow, but I don’t know what to take the place of it…

First, the obvious questions:

Does your test-computer contain a videocard which accelerates opengl?

If so, are the correct drivers for this card installed?

And are you requesting an accelerated pixel format?

Using gluBuild2DMipmap in your paint function?

Originally posted by V-man:
Using gluBuild2DMipmap in your paint function?

Yep, the paint function repaints everything on the screen, including the texture.

Originally posted by kansler:
[b]First, the obvious questions:

Does your test-computer contain a videocard which accelerates opengl?

If so, are the correct drivers for this card installed?

And are you requesting an accelerated pixel format?[/b]

I think the video card supports at least OpenGL 1.1 and the operation system is Windows 2000; and when I rotate or translate the world coordinate by the mouse, it’s not slow, just when I call the timer to reposition the particles and repaint the screen, the particles seems moving more slowly with the texture.

[This message has been edited by piccaliili (edited 11-18-2003).]

[This message has been edited by piccaliili (edited 11-18-2003).]

And what do the functions

glGetString(GL_RENDERER)
and
glGetString(GL_VENDOR)

return?

gluBuild2DMipmap upload a texture to opengl, no need to do that more than once if you dont change teh content of it each frame

If you use more than one texture, use texture objects. Functions are glGenTextures, glBindTexture, glDeleteTextures.
Texture objects store TexParameter with them.
Texture object id 0 is the immediate (default) texture if you need to switch back from a texture object to the immediate texture.

Wow, I got it, thank you all!