34 #ifndef DC_GRAPHICS_INCLUDED
35 #define DC_GRAPHICS_INCLUDED
46 #include <Dynacoe/Util/Chain.h>
47 #include <Dynacoe/Color.h>
48 #include <Dynacoe/Image.h>
49 #include <Dynacoe/Particle.h>
51 #include <Dynacoe/Modules/Assets.h>
52 #include <Dynacoe/Components/Render2D.h>
53 #include <Dynacoe/Components/RenderMesh.h>
54 #include <Dynacoe/Camera.h>
214 static Camera & GetCamera2D();
215 static Camera & GetRenderCamera();
221 friend class GraphicsResizeCallback;
224 static Renderer * drawBuffer;
229 static void setDisplayMode(Renderer::Polygon p, Renderer::Dimension, Renderer::AlphaRule a);
232 static float * transformResult;
233 static float * transformResult2;
234 static float * quadVertices2D;
247 static bool autoRefresh;
254 friend class Aspect3D;
258 static void storeFont();
260 static Image * errorImage;
261 static std::vector<int> consoleTextures;
265 struct GraphicsState {
266 Renderer::Dimension dim;
267 Renderer::Polygon polygon;
268 Renderer::AlphaRule alpha;
280 float fontGlyphScaleWidth;
283 static GraphicsState state;
284 static FontSpec defaultFontSpec;
286 static void storeSystemImages();
290 std::string GetName() {
return "Graphics"; }
291 void Init();
void InitAfter();
void RunBefore();
void RunAfter();
void DrawBefore();
void DrawAfter();
293 static void Flush2D();
294 static void UpdateCameraTransforms(
Camera * );
Backend.
Definition: Backend.h:56
static void Commit()
Forces the rendered scene to be drawn on the screen. This is normally done for you.
Base component to render a 2D object.
Definition: Render2D.h:42
static void SetRenderer(Renderer *)
Sets the current Renderer instance.
static void SetCamera3D(Camera &)
Sets the current camera to view from for 3D renderings.
static void EnableFiltering(bool doIt)
Disables or enables bilinear filtering of Images during rendering. Bilinear filtering makes stratched...
The viewport object.
Definition: Camera.h:56
Class for abstracting visual data blocks.
Definition: Image.h:62
Assets are referred to by an AssetID. The AssetID uniquely refers to an Asset stored within memory...
Definition: AssetID.h:42
static Renderer * GetRenderer()
Retrieve the Renderer instance.
static Camera & GetCamera3D()
Returns the current cameras.
Defines how an AspectMesh is visualized.
Definition: Material.h:44
static void Draw(Render2D &)
Draws an Aspect to the current display.
static void SetCamera2D(Camera &)
Sets the current camera to view from for 2D renderings.
static void SetRenderCamera(Camera &)
Sets the current camera that processes all visuals and hands them to the display i.e. the window.
Aspect representing a 3D object that reduces to a Mesh.
Definition: RenderMesh.h:50
The central class for rendering.
Definition: Graphics.h:86
static bool DrawEachFrame()
Returns whether each frame is being drawn, updated, and swapped automatically by Dynacoe or not...
Uniquely identifies an Entity.
Definition: Entity.h:67
Handles loading media.
Definition: Assets.h:97