Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualAlundra

Posted 18 March 2013 - 09:57 PM

Hi,

The use of virtual is not the good choice for renderer.Because of that I have tried a lot of code design to have one who is nice.

One of them is to have a local class declaration who is public and have a method who return the pointer (to get API-specific data).

 

class CTexture
{
public:
  class CTextureImpl;
public:
  CTexture();
  virtual ~CTexture();
  CTextureImpl* GetTextureImpl() const;
  ...
private:
  CTextureImpl* m_TextureImpl;
};

In the CTexture class implementation, include the good .h, use the CTextureImpl methods in CTexture.

Is it a good design to handle differents renderer ?

Thanks


#5Alundra

Posted 18 March 2013 - 09:56 PM

Hi,

The use of virtual is not the good choice for renderer.Because of that I have tried a lot of code design to have one who is nice.

One of them is to have a local class declaration who is public and have a method who return the pointer (to get API-specific data).

 

class CTexture
{
public:
  class CTextureImpl;
public:
  CTexture();
  virtual ~CTexture();
  CTextureImpl* GetTextureImpl() const;
private:
  CTextureImpl* m_TextureImpl;
};

In the CTexture class implementation, include the good .h, use the CTextureImpl methods in CTexture.

Is it a good design to handle differents renderer ?

Thanks


#4Alundra

Posted 18 March 2013 - 09:55 PM

Hi,

The use of virtual is not the good choice for renderer.Because of that I have tried a lot of code design to have one who is nice.

One of them is to have a local class declaration who is public and have a method who return the pointer (to get API-specific data).

 

class CTexture
{
public:
  class CTextureImpl;
  CTextureImpl* GetTextureImpl() const;

private:
  CTextureImpl* m_TextureImpl;
};

In the CTexture class implementation, include the good .h, use the CTextureImpl methods in CTexture.

Is it a good design to handle differents renderer ?

Thanks


#3Alundra

Posted 18 March 2013 - 09:54 PM

Hi,

The use of virtual is not the good choice for renderer.Because of that I have tried a lot of code design to have one who is nice.

One of them is to have a local class declaration who is public and have a method who return the pointer (to get API-specific data).

 

class CTexture
{
public:
  class CTextureImpl;
  CTextureImpl* GetTextureImpl() const;

private:
  CTextureImpl* m_TextureImpl;
};

In the CTexture class implementation, include the good .h, use the CTextureImpl methods in CTexture.

Is it a good design to handle different renderer ?

Thanks


#2Alundra

Posted 18 March 2013 - 09:53 PM

Hi,

The use of virtual is not the good choice for renderer.Because of that I have tried a lot of code design to have one who is nice.

One of them is to have a local class declaration who is public and have a method who return the pointer (to get API-specific data).

 

class CTexture
{
public:
  class CTextureImpl;
  CTextureImpl* GetTextureImpl() const;

private:
  CTextureImpl* m_TextureImpl;
};

In the CTexture class implementation, include the good .h, use the CTextureImpl method in CTexture.

Is it a good design to handle different renderer ?

Thanks


#1Alundra

Posted 18 March 2013 - 09:52 PM

Hi,

The use of virtual is not the good choice for renderer.Because of that I have tried a lot of code design to have one who is nice.

One of them is to have a local class declaration who is public and have a method who return the pointer (to get API-specific data).

 

class CTexture
{
public:
  class ITextureImpl;
  ITextureImpl* GetTextureImpl() const;

private:
  ITextureImpl* m_TextureImpl;
};

In the CTexture class implementation, include the good .h and use the good class name.

Is it a good design to handle different renderer ?

Thanks

 


PARTNERS