Jump to content
• Advertisement

#### Archived

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

# basics of the basics, an attempt at deeper understanding

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

##### Share on other sites
Advertisement
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

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
49
2. 2
3. 3
4. 4
5. 5
• Advertisement

• 10
• 28
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633409
• Total Posts
3011722
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!