CGraphicsAPI.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionCore.h>
5 #include <ionMath.h>
6 
7 #include "Enums.h"
8 #include "IShaderProgram.h"
9 #include "IVertexBuffer.h"
10 #include "IIndexBuffer.h"
11 #include "ITexture.h"
12 #include "IGraphicsContext.h"
13 #include "IDrawContext.h"
14 
15 
16 namespace ion
17 {
18 
19  class CWindow;
20 
23  {
24 
25  public:
26 
27  virtual void PreWindowCreationSetup() = 0;
28  virtual void PostWindowCreationSetup() = 0;
29 
32  virtual SharedPointer<Graphics::IPixelStage> CreatePixelShaderFromSource(string const & Source) = 0;
33 
35 
38 
40 
42 
47 
49 
50  };
51 
53  class CGraphicsAPI : public Singleton<CGraphicsAPI>
54  {
55 
56  public:
57 
58  void Init(IGraphicsImplementation * Implementation);
59 
62 
63  SharedPointer<Graphics::IVertexStage> CreateVertexStageFromFile(string const & FileName);
64  SharedPointer<Graphics::IGeometryStage> CreateGeometryStageFromFile(string const & FileName);
65  SharedPointer<Graphics::IPixelStage> CreatePixelStageFromFile(string const & FileName);
66 
67  SharedPointer<Graphics::IVertexStage> CreateVertexStageFromSource(string const & Source);
68  SharedPointer<Graphics::IGeometryStage> CreateGeometryStageFromSource(string const & Source);
69  SharedPointer<Graphics::IPixelStage> CreatePixelStageFromSource(string const & Source);
70 
72 
75 
77 
79 
86 
88 
89  protected:
90 
91  IGraphicsImplementation * Implementation = nullptr;
92 
93  private:
94 
95  friend class Singleton<CGraphicsAPI>;
96  CGraphicsAPI()
97  {}
98 
99  };
100 
101 }
virtual SharedPointer< Graphics::IDepthBuffer > CreateDepthBuffer(vec2i const &Size)=0
virtual SharedPointer< Graphics::IGeometryStage > CreateGeometryShaderFromSource(string const &Source)=0
virtual SharedPointer< Graphics::IIndexBuffer > CreateIndexBuffer()=0
virtual SharedPointer< Graphics::IVertexStage > CreateVertexShaderFromSource(string const &Source)=0
EInternalFormatType
Definition: ITexture.h:44
Alternative to Pipeline State rendering. Represents the context for one or many draw calls...
Definition: IDrawContext.h:34
virtual SharedPointer< Graphics::ITexture2D > CreateTexture2D(vec2i const &Size, Graphics::ITexture::EMipMaps const MipMaps, Graphics::ITexture::EFormatComponents const Components, Graphics::ITexture::EInternalFormatType const Type)=0
virtual SharedPointer< Graphics::ITexture3D > CreateTexture3D(vec3i 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:59
Base class for Singleton design pattern implementation.
Definition: Singleton.h:13
Lightweight wrapper for std::type_info that enables sorting (e.g. for use in a std::map) ...
Definition: ionClass.h:20
Definition: CWindow.h:16
EFormatComponents
Definition: ITexture.h:36
virtual SharedPointer< Graphics::IGraphicsContext > GetWindowContext(CWindow *Window)=0
virtual SharedPointer< Graphics::IVertexBuffer > CreateVertexBuffer()=0
virtual void PostWindowCreationSetup()=0
Definition: CImage.h:11
virtual Graphics::IDrawContext * CreateDrawContext()=0
virtual SharedPointer< Graphics::IPixelStage > CreatePixelShaderFromSource(string const &Source)=0
std::shared_ptr< T > SharedPointer
Definition: ionSmartPointer.h:25
virtual SharedPointer< Graphics::ITexture2DArray > CreateTexture2DArray(vec3i const &Size, Graphics::ITexture::EMipMaps const MipMaps, Graphics::ITexture::EFormatComponents const Components, Graphics::ITexture::EInternalFormatType const Type)=0
virtual SharedPointer< Graphics::ITextureCubeMap > CreateTextureCubeMap(vec2i const &Size, Graphics::ITexture::EMipMaps const MipMaps, Graphics::ITexture::EFormatComponents const Components, Graphics::ITexture::EInternalFormatType const Type)=0
Definition: CGraphicsAPI.h:53
Definition: CGraphicsAPI.h:22
virtual SharedPointer< Graphics::IShader > CreateShaderProgram()=0
virtual void PreWindowCreationSetup()=0