if a 3D engine supports OGL or D3D, does it means it is written in these APIs?

Started by
11 comments, last by Buzz1982 20 years, 8 months ago
// 3ddevice.hclass C3DDevice{public:    virtual ~C3DDevice() { }    virtual void RenderTriangle() pure;    static 3DDevice* m_pCurrent;private:}; // 3ddevice_d3d.hclass C3DDevice_Direct3D : public C3DDevice{public:    void RenderTriangle();}; // 3ddevice_d3d.cppvoid C3DDevice_Direct3D::RenderTriangle(){    ...} // 3ddevice_ogl.hclass C3DDevice_OpenGL : public C3DDevice{public:    void RenderTriangle();}; // 3ddevice_ogl.cppvoid C3DDevice_OpenGL::RenderTriangle(){    ...}   // Initialize...C3DDevice::m_pCurrent = new C3DDevice_OpenGL; // OpenGL   // Ah, the user changed to Direct3d in the menudelete C3DDevice::m_pCurrent;C3DDevice::m_pCurrent = new C3DDevice_Direct3D; // Direct3D


That's what I would do..

[edited by - Sunray on August 19, 2003 10:25:26 AM]

[edited by - Sunray on August 19, 2003 10:26:16 AM]
[size="1"]Perl - Made by Idiots, Java - Made for Idiots, C++ - Envied by Idiots | http://sunray.cplusplus.se
Advertisement
quote:Original post by Sunray
virtual void RenderTriangle() pure;

Must be a new keyword? ;-)

--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote:Original post by Arild Fines
quote:Original post by Sunray
virtual void RenderTriangle() pure;

Must be a new keyword? ;-)


Yup, pure is in the list of my own keywords

Actually a #define
[size="1"]Perl - Made by Idiots, Java - Made for Idiots, C++ - Envied by Idiots | http://sunray.cplusplus.se

This topic is closed to new replies.

Advertisement