Plotting Pixels on a Direct3D Texture

Started by
0 comments, last by Phillip Schuster 24 years, 8 months ago
Hi all !!

How can I plot pixels on a Direct3D Texture ?? I simply do that:

unsigned char color = 64;

unsigned char* bits = (unsigned char*)TextureSurface;
bits[y*pitch+x] = unsigned char color;

The texture is 8-Bit Palettized. The Texture has a greyscale palette.

On Voodoo cards, this works fine, but on my TNT I get strange colors. I think that is, because the TNT cannot use 8-Bit. How can I plot pixels for the TNT.

If this would work, I only could use 8-Bit. What about 16-Bit Textures, for example RGB565. How can I plot pixels in this texture-format ??


Thanks, Phillip

Phillip Schuster
Advertisement
Hi,
I'm not sure, but why not simply use and RGB() struct ? You've got to use an USHORT because of the 16 bit. And remember each color component has the maximum value 31.

code:
#define RGB16BIT(r,g,b) ((b%32)+(g%32)<<5)+((r%32)<<10)TextureMemory[...] = (USHORT) RGB16BIT(r,g,b);

That should work.

CU

------------------
Skullpture Entertainment
#40842461

Graphix Coding @Skullpture Entertainmenthttp://www.skullpture.de

This topic is closed to new replies.

Advertisement