DX pixel drawing

This is a discussion on DX pixel drawing within the Game Programming forums, part of the General Programming Boards category; With C# and Direct X is there a way to simply plot a pixel onto the screen? Or do you ...

  1. #1
    VOX
    VOX is offline
    Deleting... VOX's Avatar
    Join Date
    Oct 2004
    Location
    VA
    Posts
    94

    DX pixel drawing

    With C# and Direct X is there a way to simply plot a pixel onto the screen? Or do you always have to draw polygons?
    Boy you stink, go take a shower before you continue to code. Better do your laundry and spray your chair too.

    The one and only resource for finding information.

    Next version of windows released!!!!

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    It really depends on what you're going for. You can lock the back buffer and manipulate the pixels that way, but it won't be fast. What exactly do you want to do?
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  3. #3
    VOX
    VOX is offline
    Deleting... VOX's Avatar
    Join Date
    Oct 2004
    Location
    VA
    Posts
    94
    Well I can draw a triangle or square onto the screen, but I don't know how to simply draw a pixel at "x,y". Or mkae the triangles wireframe they always have a color.
    Boy you stink, go take a shower before you continue to code. Better do your laundry and spray your chair too.

    The one and only resource for finding information.

    Next version of windows released!!!!

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    You can make the rendering wireframe by setting a render state:

    Code:
    pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
    Otherwise you can lock the back buffer like i was saying and manually manipulate the bits. You have to create the device with the lockable back buffer flag and then use the IDirect3DDevice9::GetBackBuffer method. You can look into the docs for specific params and such.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How can I make this code more elegant?
    By ejohns85 in forum C++ Programming
    Replies: 3
    Last Post: 04-02-2009, 09:55 AM
  2. Slow drawing code
    By tjpanda in forum Windows Programming
    Replies: 5
    Last Post: 05-09-2008, 06:09 PM
  3. Drawing a single pixel
    By SMB3Master in forum C++ Programming
    Replies: 14
    Last Post: 05-26-2003, 07:17 AM
  4. What is wrong with this function!!!
    By stupid_mutt in forum C Programming
    Replies: 9
    Last Post: 01-08-2002, 11:34 AM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21