Public Member Functions | Protected Member Functions | Protected Attributes

xl7::directx::Resource Class Reference

#include <Resource.h>

Inheritance diagram for xl7::directx::Resource:
xl7::direct3d::Resource xl7::directinput::Resource xl7::directshow::Resource xl7::directsound::Resource xl7::direct3d::meshes::IndexBuffer xl7::direct3d::meshes::VertexBuffer xl7::direct3d::models::Model xl7::direct3d::models::ModelInstance xl7::direct3d::shader::Shader xl7::direct3d::shader::VertexDeclaration xl7::direct3d::surfaces::Surface xl7::direct3d::textures::BaseTexture xl7::directinput::devices::InputDevice xl7::directshow::media::MultiMedia xl7::directsound::buffers::BaseBuffer

List of all members.

Public Member Functions

ResourceManagerGetManager () const
bool IsAcquired () const
bool IsResigned () const
const cl7::string_typeGetIdentifier () const
bool IsLocked () const
bool Request ()
bool Release ()
bool Resign ()
bool Restore ()
bool Update ()
unsigned EstimateUsedMemory () const
bool Lock (unsigned first, unsigned count, void **local_copy_data)
bool Unlock ()
bool Flush ()

Protected Member Functions

 Resource (ResourceManager *manager)
 Resource (ResourceManager *manager, const cl7::string_type &identifier)
virtual ~Resource (void)

Protected Attributes

LocalCopy _local_copy

Detailed Description

The base class for any DirectX resources (such as textures, input devices, etc.).


Constructor & Destructor Documentation

xl7::directx::Resource::Resource ( ResourceManager manager  )  [protected]
xl7::directx::Resource::Resource ( ResourceManager manager,
const cl7::string_type identifier 
) [protected]
xl7::directx::Resource::~Resource ( void   )  [protected, virtual]

Member Function Documentation

unsigned xl7::directx::Resource::EstimateUsedMemory (  )  const

Approximately estimates the memory, in bytes, used by this resource.

bool xl7::directx::Resource::Flush (  ) 

"Flushes" the changes made to the local copy by writing its contents to the hardware memory.

const cl7::string_type& xl7::directx::Resource::GetIdentifier (  )  const [inline]

Returns the identifier of this resource (if specified).

ResourceManager* xl7::directx::Resource::GetManager (  )  const [inline]

Returns the resource manager responsible for this resource.

bool xl7::directx::Resource::IsAcquired (  )  const [inline]

Returns the flag specifying whether this resource has been acquired.

bool xl7::directx::Resource::IsLocked (  )  const [inline]

Returns the flag specifying whether the local copy is currently locked.

bool xl7::directx::Resource::IsResigned (  )  const [inline]

Returns the flag specifying whether this resource has temporarily been resigned.

bool xl7::directx::Resource::Lock ( unsigned  first,
unsigned  count,
void **  local_copy_data 
)

Locks the local copy for reading and/or writing. The local copy gets locked beginning with the specified offset (first), in bytes. If the given number of bytes (count) would exceed the capacity of the buffer, it will be cropped.

bool xl7::directx::Resource::Release (  ) 

Releases the resource.

bool xl7::directx::Resource::Request (  ) 

Requests the resource.

bool xl7::directx::Resource::Resign (  ) 

Temporarily resigns some stuff due to loss of the resource.

bool xl7::directx::Resource::Restore (  ) 

Restores the resource after it was lost.

bool xl7::directx::Resource::Unlock (  ) 

Unlocks the local copy.

bool xl7::directx::Resource::Update (  ) 

Updates the resource each frame.

Updates the resource each frame. Override this function to eventually update the resource each frame.

Reimplemented in xl7::direct3d::models::ModelInstance.


Member Data Documentation

The local copy of the data of this resource.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines