Jump to content
  • Advertisement
Sign in to follow this  
hahaha

Which Is Faster????

This topic is 3968 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If i load a 128*128 square and use glDrawPixels to draw it? or if i use glBegin(GL_QUADS); glVertex3f(x,x,x)... to draw the same square?

Share this post


Link to post
Share on other sites
Advertisement
I dont think so because from the tests ive just been doing when i draw pixels my frame rate is around 58 but when drawing vertex i get a frame rate of about 30

Share this post


Link to post
Share on other sites
Well, without a doubt, storing an image as a texture, and then drawing a texture quad will be faster. If it's not faster, that means you're doing something wrong (or something is fishy with your drivers).

Let us see some code: How do you upload the texture to the graphics card? What's your drawing code look like?

~Chris

Share this post


Link to post
Share on other sites
never draw pixels. i once made a glow function using pixel operations, instead of using a pixel shader.. and the fps was at 640x480 about 8fps at really good optimizations, while comparing to a pixel shader, which nearly doesn't affect the frame rate at all..

Share this post


Link to post
Share on other sites
The texture loading function is LoadTGA really really long not gonna put it here but for drawing the image i use
 glDrawPixels(image->sizeX,image->sizeYGL_RGB,GL_UNSIGNED_BYTE,(GLvoid*)image->data);

for drawing the vertices:

glBegin(GL_QUADS);
glVertex2f(30,530);
glVertex2f(760,530);
glVertex2f(760,25);
glVertex2f(30,25);
glEnd();

Share this post


Link to post
Share on other sites
Quote:
I dont think so because from the tests ive just been doing when i draw pixels my frame rate is around 58 but when drawing vertex i get a frame rate of about 30

Try doing that a 100 times. The quad should be much faster than glDrawPixels, then.

That said, how can you only get 30 fps with a simple, textured quad? The number should have been more like 300 (if not 3000) fps. Maybe you are rendering onto a non-accelerated opengl context (where glDrawPixels might be faster than rendering quads)?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!