I am playing with opengl on a slow computer and I need better frame rate. (above 20 would be nice)

how can you find out the frame rate? (i just guess i have about 15 at the moment)

I need to optomise my code a LOT anyone got any info on basic optimizing?

how can I push up the priority of my thread?

I need my code to run faster an I figered that pushing the priority will help.

thanks for all the help.
Posted on 2001-08-25 18:27:32 by robsonde
If no other programs are running when you increase the priority of the thread, you might be only getting an extra 1% (or less) processing time increase. The best way would be to pair some of the instructions in your main loop. Also, don't do excessive C-style calls because that kills the processor if there are branch predictions. Also, if you have a long code block, make sure it doesn't excede 4K in size or you will notice the processor has to load it into L2 cache.

I just thought up some optimizations, but I have not tried them, so bear with me.

Could you do this:
push st0
push st1
push st2
call glvertex3f

instead of:
fstp var0
fstp var1
fstp var2
invoke glvertex3f, var2, var1, var0

-----------------------

Also, could you do this:
push st0
push st1
push st2
push st3
push st4
push st5
push st0
push st2
push st4
call glvertex3f
call glvertex3f
call glvertex3f

That way, you would be pairing some of those instructions, and there might not be branch mispredictions on the calls because the processor knows what it will be doing next?

Where are some of those hardcore optimizer guys when you need them :alright:
Posted on 2001-08-25 22:50:07 by Kenny
Unfortunatly if OpenGL is very slow it may not be easy to speed it up at all. Its unlikly that a few clocks you'll save here and there will have practical advantages. Rarther it may just be that your PC is too slow when it renders the OpenGL scene.

Try a simple scene, just a spinning cube and use an FPS counter to see how fast it renders.

For an FPS counter simly use GetTickCount at the start of each frame to work out how much time has passed since to last. Dividing this value into 1000 will find you a very simple FPS counter.

If for small windows your not getting frame rates above 100 then you're probably in trouble.

Also check out the OpenGL forums and ask about using OpenGL on old computers. Maybe things like hardware acceleration and fullscreen mode will help.
Posted on 2001-08-26 06:54:25 by Eóin