🔒 Locked
Surface Copy
Advertisement
Original Post
Most cards don''t support texture of arbitrary size (they need to be powers of 2 in size) so your back buffer wont be able to just be copied to a texture because the sizes cant match up. You have two options then. Make a really big texture so the back buffer only fills part of it, or you can scale the backbuffer down. With this in mind, you only need to get the surface (DDraw object) from the texture, and do the blit from one surface to another.
Just curious, what type of effect are you using this for?
Just curious, what type of effect are you using this for?
this curious thing is for an brand new low resources
mirror effect (not cube), when i get this function to run i
show it at the "screenshots of your engine" post here,
believe me..test with loaded screenshots are absolut great,
i only need to copy the backbuffer...
my texture have the same size and format
(for example 800x6000 X8R8G8B8)
like the backbuffer
but every thing i try to copy fails:
can you give me a litte example how to copy
, i cant find any solution anywhere,
i believe i am the only one that uses a function like this
,but when it runs look at the screenshots
(i am more experienced in programming netcode for this mmorpg than in directx)
thx to everybody
[edited by - Aragon on January 1, 2003 1:49:19 PM]
mirror effect (not cube), when i get this function to run i
show it at the "screenshots of your engine" post here,
believe me..test with loaded screenshots are absolut great,
i only need to copy the backbuffer...
my texture have the same size and format
(for example 800x6000 X8R8G8B8)
like the backbuffer
but every thing i try to copy fails:
can you give me a litte example how to copy
, i cant find any solution anywhere,
i believe i am the only one that uses a function like this
,but when it runs look at the screenshots
(i am more experienced in programming netcode for this mmorpg than in directx)
thx to everybody
[edited by - Aragon on January 1, 2003 1:49:19 PM]
How about you just use a texture as a render target? That''s by far the quickest and easiest method.
- JQ
Full Speed Games. Are back.
- JQ
Full Speed Games. Are back.
Yeah - I''d render to a texture display that texture and then use it as the basis for the display of the mirror. OK that way the display in the mirror will be 1 frame behind but as long as you keep to 60fps upwards noone should notice.
Neil
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
Neil
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
for screenshots i take
d3dxSaveSurfaceToFilaA
and this works perfect
*buhuhuhu, nobody understand me*
on my Amstrad CPC 664 in the year 1986
it looks like this
DIM Textur [800,600]
DIM Backbuffer [800,600]
for int tt=0 to 800
for int t =0 to 600
textur[t,tt]=backbuffer[t,tt]
end t
end tt
d3dxSaveSurfaceToFilaA
and this works perfect
*buhuhuhu, nobody understand me*
on my Amstrad CPC 664 in the year 1986
it looks like this
DIM Textur [800,600]
DIM Backbuffer [800,600]
for int tt=0 to 800
for int t =0 to 600
textur[t,tt]=backbuffer[t,tt]
end t
end tt
Most graphics cards have problems with textures that aren''t powers of 2. Therefore, if you need to use an existing rendering result, you are usually best off rendering to a texture.
To do this, create a texture in the DEFAULT pool and set it as the render target (IDirect3DDevice?::SetRenderTarget()). Look this up in the SDK documentation, it explains everything there. Then set the render target back to the backbuffer and use the newly rendered texture with SetTexture().
- JQ
Full Speed Games. Are back.
To do this, create a texture in the DEFAULT pool and set it as the render target (IDirect3DDevice?::SetRenderTarget()). Look this up in the SDK documentation, it explains everything there. Then set the render target back to the backbuffer and use the newly rendered texture with SetTexture().
- JQ
Full Speed Games. Are back.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement