Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Qpeg

IDirect3DTexture9::GetPrivateData()

This topic is 5537 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to write a function,D3DCOLOR GetPixel(int x, int y) for my sprite class(i only use one level atm). As mentioned here earlier, the way to do this is to 1)lock the texture 2)use GetPrivateData() 3)get the correct pixel from the buffer 4)unlock. (actually, if I am shure my textures will stay the same, do I have to lock them?) My problem is using the GetPrivateData() function; what kind of variable should get the data, and what is REFGUID? If anybody has written a similar function, it would be really nice to see a couple of lines on what variables are used, and how one could access pixel x,y. Regards, Eivind

Share this post


Link to post
Share on other sites
Advertisement
i was just informed GetPrivateData is used for something different (a possibility for additional external data). LockRect is the way to go

Share this post


Link to post
Share on other sites
Glad you fixed your problem but a word of caution to you:

Don''t lock and unlock for every single pixel you need.

Lock it, get ALL the pixels you need then unlock it. Also, don''t do this too many times a frame. It''s really slow.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!