Archived

This topic is now archived and is closed to further replies.

basics of the basics, an attempt at deeper understanding

This topic is 4951 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

Ive been playing with the SetPixel() function in an attempt to understand better some things about graphical programming. I use DirectX usually, but since all DXgraphics *really* does is draw a point at (x,y) of a certian color, I thought I could learn things from SetPixel(), since thats what it does. its (at its core) Well, I have learnt some things, and now I have questions. Heres the most pressing one : Q : Is there anything faster than SetPixel() to put a pixel to the screen? Even using inline functions and Win32Releaase on a dual processor P4 3.2GHZ, its slow doing it 25,000,000 times. -Jason BTW, some of the neato things Ive been able to figure out : 1) How to stuff the screen into a custom "buffer" I made using ScreenData[500][500] and GetPixel(dc, x, y,), and be able to redisplay it. 2) A nifty spirograph function using LineTo() 3) Manipulating the ScreenData[][] to make random points appear to move 4) Drawing a grid 5) Repositioning the origin from the default top left of the window to dead center. 6)Im now trying to make a rotating 3D MTV logo like John Carmack did as described in the book "masters of doom". Stuck on going from model space to perspectivelike screen space.

Share this post


Link to post
Share on other sites
quote:
Original post by nosajghoul
Ive been playing with the SetPixel() function in an attempt to understand better some things about graphical programming.
Much like learning calculus using only the numbers 0 and 1.
quote:
Original post by nosajghoul
... since all DXgraphics *really* does is draw a point at (x,y) of a certian color ...
That is only the top snowflake on the tip of the iceberg.
quote:
Original post by nosajghoul
Is there anything faster than SetPixel() to put a pixel to the screen?


A much faster method would be to draw into a "framebuffer". Then once per frame, render the framebuffer onto the screen (as a texture on a single quad or using GDI).

Look up "software rasterizer". You will find plenty of info about how to do what you want to do.


John Bolton
Page 44 Studios
Current project: NHL Faceoff 2005 PS2


[edited by - JohnBolton on May 29, 2004 3:09:03 PM]

Share this post


Link to post
Share on other sites