Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DirectX Programming Basics

DirectX Programming Basics

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsgame-devtutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kuroro Rucilful
    wrote on last edited by
    #1

    Hi, Please tell me how to plot a single dot in directx with mode 320x200. i have to plot hundreds of dots to form a figure. all the examples about directx programming tackles almost "loading" a bitmap then animating it. e.g. drawing letter "A" using only the pixels meaning drawing each pixels(with respective x and y coordinates) until you will form the letter "A". :confused:

    "We are all the same in different ways" Kuroro Rucilful

    U 1 Reply Last reply
    0
    • K Kuroro Rucilful

      Hi, Please tell me how to plot a single dot in directx with mode 320x200. i have to plot hundreds of dots to form a figure. all the examples about directx programming tackles almost "loading" a bitmap then animating it. e.g. drawing letter "A" using only the pixels meaning drawing each pixels(with respective x and y coordinates) until you will form the letter "A". :confused:

      "We are all the same in different ways" Kuroro Rucilful

      U Offline
      U Offline
      uusheikh
      wrote on last edited by
      #2

      You can achieve that without using DirectX. You can just use GDI or GDI+. However, if you want to use DirectX (Direct3D), you can do that. Just create a direct3d surface, and when you want to access the individual pixel, call GetBackBuffer(), which returns a pointer to the buffer array (in a structure). You can access each pixel, and change it as you like.

      K 1 Reply Last reply
      0
      • U uusheikh

        You can achieve that without using DirectX. You can just use GDI or GDI+. However, if you want to use DirectX (Direct3D), you can do that. Just create a direct3d surface, and when you want to access the individual pixel, call GetBackBuffer(), which returns a pointer to the buffer array (in a structure). You can access each pixel, and change it as you like.

        K Offline
        K Offline
        Kuroro Rucilful
        wrote on last edited by
        #3

        Thanks pal, I will refrain in using GDI or DIB coz i'm coding a time percised process with minimum frequency of 16 Hz. I've got to finish the whole single process in 0.0625 seconds.:(( I thought DirectDraw has the functionality of plotting a pixel with specified x and y axis, and also color. :(( Thanks once again:rolleyes:

        "We are all the same in different ways" Kuroro Rucilful

        K 1 Reply Last reply
        0
        • K Kuroro Rucilful

          Thanks pal, I will refrain in using GDI or DIB coz i'm coding a time percised process with minimum frequency of 16 Hz. I've got to finish the whole single process in 0.0625 seconds.:(( I thought DirectDraw has the functionality of plotting a pixel with specified x and y axis, and also color. :(( Thanks once again:rolleyes:

          "We are all the same in different ways" Kuroro Rucilful

          K Offline
          K Offline
          Kuroro Rucilful
          wrote on last edited by
          #4

          Hi everyone, This is a sample program in pascal with the aid of a little assembly. Assume that Mode 13h is being made before this line of code by INT 10H. Does DirectDraw has this some sort of function? ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Writes a pixel dot of a specified color at a specified screen coordinate. On entry: AH 0Ch AL Pixel color CX Horizontal position of pixel DX Vertical position of pixel BH Display page number (graphics modes with more than 1 page) Returns: None Registers destroyed: AX, SP, BP, SI, DI ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ As seen from our SetMCGA example, you would write this by doing the following:

          mov dx,[y] mov bx,[1] int 10h end;**END;

          "We are all the same in different ways" Kuroro Rucilful

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups