CoriEngine
Loading...
Searching...
No Matches
API.hpp
Go to the documentation of this file.
1#pragma once
2#include "CoriGraphicsAPI.hpp"
3
4namespace Cori {
5 namespace Core {
6 class Application;
7 }
8
12 namespace Graphics {
13 namespace Internal {
14 class API {
15 public:
16
17 static void SetViewport(const int32_t x, const int32_t y, const int32_t width, const int32_t height) {
18 s_GraphicsAPI->SetViewport(x, y, width, height);
19 }
20
21 static void SetClearColor(const glm::vec4& color) {
22 s_GraphicsAPI->SetClearColor(color);
23 }
24
25 static void ClearFramebuffer() {
26 s_GraphicsAPI->ClearFramebuffer();
27 }
28
29 static void DrawElementsTriangles(const uint32_t elementCount) {
30 s_GraphicsAPI->DrawElementsTriangles(elementCount);
31 }
32
33 static void DrawElementsInstancedTriangles(const uint32_t instanceCount) {
34 s_GraphicsAPI->DrawElementsInstancedTriangles(instanceCount);
35 }
36
37 static void EnableDepthTest() {
38 s_GraphicsAPI->EnableDepthTest();
39 }
40
41 static void DisableDepthTest() {
42 s_GraphicsAPI->DisableDepthTest();
43 }
44
45 static void EnableBlending() {
46 s_GraphicsAPI->EnableBlending();
47 }
48
49 static void DisableBlending() {
50 s_GraphicsAPI->DisableBlending();
51 }
52
53 static void SetDepthMask(const bool mode) {
54 s_GraphicsAPI->SetDepthMask(mode);
55 }
56
57 protected:
58 friend Core::Application;
59
60 static void Init();
61 static void Shutdown();
62
63 static std::unique_ptr<CoriGraphicsAPI> s_GraphicsAPI;
64 };
65 }
66 }
67}
Main Application object, there can only be one Application object. Basically a root of the program.
static void SetClearColor(const glm::vec4 &color)
Definition API.hpp:21
static void DrawElementsTriangles(const uint32_t elementCount)
Definition API.hpp:29
static void EnableBlending()
Definition API.hpp:45
static void DisableDepthTest()
Definition API.hpp:41
static void Shutdown()
Definition API.cpp:14
static void SetDepthMask(const bool mode)
Definition API.hpp:53
static void SetViewport(const int32_t x, const int32_t y, const int32_t width, const int32_t height)
Definition API.hpp:17
static void ClearFramebuffer()
Definition API.hpp:25
static void DisableBlending()
Definition API.hpp:49
static void DrawElementsInstancedTriangles(const uint32_t instanceCount)
Definition API.hpp:33
static std::unique_ptr< CoriGraphicsAPI > s_GraphicsAPI
Definition API.hpp:63
static void EnableDepthTest()
Definition API.hpp:37
Core systems of the engine are here.
Almost everything connected to graphics is in this namespace.
Definition Window.hpp:7
Global engine namespace.