CGraphicsAPI.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionCore.h>
5 #include <ionMath.h>
6 #include <ionFramework.h>
7 
8 #include "Enums.h"
9 #include "IShaderProgram.h"
10 #include "IVertexBuffer.h"
11 #include "IIndexBuffer.h"
12 #include "ITexture.h"
13 #include "IGraphicsContext.h"
14 #include "IDrawContext.h"
15 
16 
17 namespace ion
18 {
19 
20  class CWindow;
21 
24  {
25 
26  public:
27 
28  virtual void PreWindowCreationSetup() = 0;
29  virtual void PostWindowCreationSetup() = 0;
30 
33  virtual SharedPointer<Graphics::IPixelShader> CreatePixelShaderFromSource(string const & Source) = 0;
34 
36 
39 
41 
43 
48 
50 
51  };
52 
54  class CGraphicsAPI : public Singleton<CGraphicsAPI>
55  {
56 
57  public:
58 
59  void Init(IGraphicsImplementation * Implementation);
60 
63 
64  SharedPointer<Graphics::IVertexShader> CreateVertexShaderFromFile(string const & FileName);
65  SharedPointer<Graphics::IGeometryShader> CreateGeometryShaderFromFile(string const & FileName);
66  SharedPointer<Graphics::IPixelShader> CreatePixelShaderFromFile(string const & FileName);
67 
71 
73 
76 
78 
80 
87 
89 
90  protected:
91 
92  IGraphicsImplementation * Implementation = nullptr;
93 
94  private:
95 
96  friend class Singleton<CGraphicsAPI>;
97  CGraphicsAPI()
98  {}
99 
100  };
101 
102 }
virtual SharedPointer< Graphics::IIndexBuffer > CreateIndexBuffer()=0
virtual SharedPointer< Graphics::ITexture2D > CreateTexture2D(vec2u const &Size, Graphics::ITexture::EMipMaps const MipMaps, Graphics::ITexture::EFormatComponents const Components, Graphics::ITexture::EInternalFormatType const Type)=0
virtual SharedPointer< Graphics::IDepthBuffer > CreateDepthBuffer(vec2u const &Size)=0
std::shared_ptr< T > SharedPointer
Definition: ionSmartPointer.h:22
EInternalFormatType
Definition: ITexture.h:43
Alternative to Pipeline State rendering. Represents the context for one or many draw calls...
Definition: IDrawContext.h:34
virtual SharedPointer< Graphics::ITextureCubeMap > CreateTextureCubeMap(vec2u const &Size, Graphics::ITexture::EMipMaps const MipMaps, Graphics::ITexture::EFormatComponents const Components, Graphics::ITexture::EInternalFormatType const Type)=0
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
EMipMaps
Definition: ITexture.h:57
virtual SharedPointer< Graphics::IVertexShader > CreateVertexShaderFromSource(string const &Source)=0
virtual SharedPointer< Graphics::IShaderProgram > CreateShaderProgram()=0
virtual SharedPointer< Graphics::ITexture3D > CreateTexture3D(vec3u const &Size, Graphics::ITexture::EMipMaps const MipMaps, Graphics::ITexture::EFormatComponents const Components, Graphics::ITexture::EInternalFormatType const Type)=0
virtual SharedPointer< Graphics::IGeometryShader > CreateGeometryShaderFromSource(string const &Source)=0
Definition: CWindow.h:17
virtual SharedPointer< Graphics::ITexture2DArray > CreateTexture2DArray(vec3u const &Size, Graphics::ITexture::EMipMaps const MipMaps, Graphics::ITexture::EFormatComponents const Components, Graphics::ITexture::EInternalFormatType const Type)=0
EFormatComponents
Definition: ITexture.h:35
Lightweight wrapper for std::type_info that enables sorting (e.g. for use in a std::map) ...
Definition: ionClass.h:180
virtual SharedPointer< Graphics::IGraphicsContext > GetWindowContext(CWindow *Window)=0
virtual SharedPointer< Graphics::IVertexBuffer > CreateVertexBuffer()=0
Base class for Singleton design pattern implementation.
Definition: ionClass.h:90
virtual SharedPointer< Graphics::IPixelShader > CreatePixelShaderFromSource(string const &Source)=0
virtual void PostWindowCreationSetup()=0
Definition: CImage.h:10
virtual Graphics::IDrawContext * CreateDrawContext()=0
Definition: CGraphicsAPI.h:54
Definition: CGraphicsAPI.h:23
virtual void PreWindowCreationSetup()=0