I'm making a basic (very basic) pseudo 3D game and it requires a lot of per pixel calculations. Basically, I'm just running software stretching algorithms to stretch textures into a variety of square and trapezoid shaped quads (and also a few triangles).
Now, originally I had all my surfaces in Video Memory and to draw the floor and ceiling at 640x480 took about 300 milliseconds. An absurdly long time considering that games like Quake2 and Half-Life could access every pixel at least 20 times a seconds at that resolution on a respectable machine (years ago).
So, as a test, I stored all of my texture surfaces in system memory. Sure enough, the rendering time decreased by an order of magnitude (about 30 milliseconds). Previously, the "texture" pixels were being taken from video memory, to the cpu and then back to video memory to be put on the draw surface. With the textures in system memory, the texture pixels (texels) get to the cpu much quicker.
However, now it crashes my brothers computer and probably a lot of other older machines (works fine on mine). We updated his direct x, but since the video card is a 4 year old OEM TNT, the drivers can't be updated.
Do you either (a) have any idea why this would crash a computer, or (b) know how to get directdraw to copy pixels directly from one surface to another (without having the pixel sent to the cpu). Right now I'm using pointers to directly access the surface memories causing the slowdown. Bliting one pixel at a time doesn't make it faster (figured that would keep things in hardware, but the blt overhead on a per pixel basis is just absurd).
I'm writing this in object pascal (delphi) but I can read C.
Any ideas on how to keep all the surfaces in video memory and keep the speed up would be greatly appreciated.
Thanks!
Now, originally I had all my surfaces in Video Memory and to draw the floor and ceiling at 640x480 took about 300 milliseconds. An absurdly long time considering that games like Quake2 and Half-Life could access every pixel at least 20 times a seconds at that resolution on a respectable machine (years ago).
So, as a test, I stored all of my texture surfaces in system memory. Sure enough, the rendering time decreased by an order of magnitude (about 30 milliseconds). Previously, the "texture" pixels were being taken from video memory, to the cpu and then back to video memory to be put on the draw surface. With the textures in system memory, the texture pixels (texels) get to the cpu much quicker.
However, now it crashes my brothers computer and probably a lot of other older machines (works fine on mine). We updated his direct x, but since the video card is a 4 year old OEM TNT, the drivers can't be updated.
Do you either (a) have any idea why this would crash a computer, or (b) know how to get directdraw to copy pixels directly from one surface to another (without having the pixel sent to the cpu). Right now I'm using pointers to directly access the surface memories causing the slowdown. Bliting one pixel at a time doesn't make it faster (figured that would keep things in hardware, but the blt overhead on a per pixel basis is just absurd).
I'm writing this in object pascal (delphi) but I can read C.
Any ideas on how to keep all the surfaces in video memory and keep the speed up would be greatly appreciated.
Thanks!