Skip to main content
gamedev.net
🔒 Locked

Plz help... texture memory problems!!!

Started by avoden Aug 23, 2000 at 1:29 PM 2 replies 750+ views
Original Post
avoden
avoden
How can I tell if current device uses video or system memory for the textures and if I can use both with that device? Im trying to load textures into system memory if device runs out of video memory. So far I failed miserably. Here is slice of the code I use for surface creation: 1) Create texture surface A in system memory using following caps: DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY 2) copy image there 3) Create texture surface B using following caps: DDSCAPS_TEXTURE |DDSCAPS_ALLOCONLOAD 4) call Load () function to load image A into texture B If I try to set caps for surface B to :DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD|DDSCAPS_SYSTEMMEMORY or DDSCAPS_VIDEOMEMORY thus explicitly specifying type of memory I want to use, it fails. Any help greatly appreciated. Andrei
Tornado
Tornado
I''m not sure I understand what your doing but if I do, that''s exactly what I asked 2 hours ago!
To set the texture in the video memory you do:

DDSURFACEDESC2 ddsd;

ddsd.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE;

Credits to Xeno for this one



The road to success is always under construction
Goblineye EntertainmentThe road to success is always under construction
avoden
avoden
Problem with my case is, Im using DirectX6 which does not have Texture manager yet. In any case, how does this texture manager works in DirectX7 in case if I try to load texture in the memory and video memory is full? Does it move them back and forth from/to system memory?

Thanks,
Andrei
Tornado
Tornado
I think that in DX6 textures are managed by D3D and not the video card.
You should upgrade to DX7, much better



The road to success is always under construction
Goblineye EntertainmentThe road to success is always under construction

Topic Locked

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

Sign in to reply to this topic.