ZeroBit
Neophyte
3 Posts |
Posted - Jun 08 2004 : 9:16:49 PM
|
Hi I recently started using DX8 instead of DirectDraw from DX7 to render 2D graphics. I use DrawPrimitiveUp to print a 2 triangle strip for each image i want to print. I can now even draw only part of an image, which i didnt know how. The problem is, not only the image files must have 2^x dimensions, but so do the part of the image that i print, or it will print badly.
So is there any way that I can print a part of an image with the dimensions i want, without getting those strange cuts on the rendered image? It must be possible, because I've seen DX Games doing that (for example the health bar from an RPG, where you have to print the empty bar and then part of the filled bar, depending on the current health).
If anyone can help, I'll appreciate much Thanks |
zb |
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - Jun 08 2004 : 9:44:20 PM
|
While it used to be the case with older cards (TNT, Voodoo, etc.), the images do not NEED to be in a base 2 size. However, it is usually a good idea, since it is easier/faster (due to mipmapping, etc.) to follow this format, and it will run on the older cards as well. What kind of graphics card do you have, and what "level" of computers do you want this to run on?
To render something to part of an image (if that is what you mean), just change the tu/tv coordinates. I am not sure how to only print part of a texture though, but I know there is a way... sorry...
|
|
|
ZeroBit
Neophyte
3 Posts |
Posted - Jun 08 2004 : 9:59:25 PM
|
Well I can print part of a texture. But when even that part of the texture is not in a base 2 size, it looks like it has been stretched, althogh its the correct size (same effect as i get if i render a holy non-base2 texture)
So if i have a 64x64 texture and i print a 16x8 piece of it, it will be accurate, but if i render a 16x7 piece, it will look weird.
Oh, if that matters i have a Geforce3 64MB hehe :) thanks for the quick reply :P |
zb |
|
|
masterbooda
Swordmaster
277 Posts |
|
ZeroBit
Neophyte
3 Posts |
Posted - Jun 09 2004 : 1:31:57 PM
|
Wow Thank you so much. It does work if i add 0.1
I wanted to print a 800x600 image which was inside of a 1024x1024 bitmap file. Now i make it print 800.1 * 600.1 and it prints nice
(my function does the maths to convert to the tu an tv stuff)
Anyway thanks alot |
zb |
|
|
|
|