Skip to main content
GameDev.net gamedev.net
🔒 Locked

Memory Copy, Being Safe

Started by Gary Oct 11, 2000 at 3:03 AM 0 replies 250+ views
Original Post
Gary
Gary
Lets assume that I''m running a program in 16-bit. Now lets say I create a texture by: PR_SetTextureFormat ( TEXTURE_RGB_565 ); PR_SetTextureStage ( 0 ); image = wallocblock (VTEXSIZE, VTEXSIZE); VTexture = PR_AddTexture ("vtex", image); I have a question. Some cards use 555 and some use 565, can I just assume that the backbuffer and texure are both converted to the same 16-bit format. Or is it possible to get a 555 backbuffer and a 565 texture or maybe a 565 backbuffer and a 555 texture in which case I''d have to convert between 16-bit formats. Gary
ChrisE
ChrisE
wallocblock will allocate an 8 bit image regardless of the video mode you''re in. wnewblock on the other hand will grab a section of the backbuffer in the same format as the backbuffer. wnewblock can''t be used with PR_AddTexture(32) since it expects 8 or 32 bit images.

Internally PR converts everything to 32 bit, then converts to the format needed by the hardware. It''s easy if you work in 32 bit color and let PR downgrade the quality to whatever it needs.

You cannot guarantee the backbuffer surface format will match the texture formats.

Chris
Author of Power Render (http:/www.powerrender.com)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.