DirectX Programming Basics
-
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
-
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
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.
-
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.
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
-
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
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