Muto 0.0.1
Cross-Platform Application Template
GitHub Repo | Muto Updates | Muto's Author
Loading...
Searching...
No Matches
GraphicsContext.h
Go to the documentation of this file.
1#pragma once
2/// @file GraphicsContext.h
3/// @author Damon S. Green II
4/// @brief Defines the GraphicsContext class, which is responsible for managing the graphics context in the renderer. The GraphicsContext class is an abstract class that defines the interface for graphics contexts. The actual implementation of the graphics context will be done in the RenderAPI-specific classes (e.g., OpenGLGraphicsContext).
5/// @note The GraphicsContext class is an abstract class that defines the interface for graphics contexts. The actual implementation of the graphics context will be done in the RenderAPI-specific classes (e.g., OpenGLGraphicsContext).
6
7#include "Core/Base.h"
8
9namespace Muto {
10
11 /// @class GraphicsContext
12 /// @brief Abstract class representing a graphics context.
14 {
15 public:
16 virtual ~GraphicsContext() {}
17 /// @brief Initializes the graphics context.
18 virtual void Init() = 0;
19 virtual void SwapBuffers() = 0;
20
21 };
22
23}
#define MU_CORE_ASSERT(x,...)
Definition Asserts.h:32
#define MU_PROFILE_FUNCTION()
Definition Instrumentor.h:240
#define MU_CORE_WARN(...)
warn: indicates a potential issue or important event
Definition Log.h:40
#define MU_CORE_ERROR(...)
error: indicates an error that has occurred
Definition Log.h:42
#define MU_CORE_INFO(...)
info: general information about application flow
Definition Log.h:38
Abstract class representing a graphics context.
Definition GraphicsContext.h:14
virtual void Init()=0
Initializes the graphics context.
virtual ~GraphicsContext()
Definition GraphicsContext.h:16
virtual void SwapBuffers()=0
Abstract interface representing an application window.
Definition Window.h:42
Definition WindowsWindow.h:12
void OnUpdate() override
Called every frame to update the window.
Definition WindowsWindow.cpp:156
GLFWwindow * m_Window
Definition WindowsWindow.h:30
void SetVSync(bool enabled) override
Sets whether vertical synchronization (VSync) is enabled.
Definition WindowsWindow.cpp:163
virtual void Init(const WindowProps &props)
Definition WindowsWindow.cpp:36
bool IsVSync() const override
Checks if vertical synchronization (VSync) is enabled.
Definition WindowsWindow.cpp:174
EventCallbackFn EventCallback
Definition WindowsWindow.h:38
void SetEventCallback(const EventCallbackFn &callback) override
Sets the callback function for window events.
Definition WindowsWindow.h:22
WindowData m_Data
Definition WindowsWindow.h:40
unsigned int GetWidth() const override
Retrieves the width of the window.
Definition WindowsWindow.h:18
unsigned int Height
Definition WindowsWindow.h:35
virtual ~WindowsWindow()
Definition WindowsWindow.cpp:31
unsigned int GetHeight() const override
Retrieves the height of the window.
Definition WindowsWindow.h:19
WindowsWindow(const WindowProps &props)
Definition WindowsWindow.cpp:25
GraphicsContext * m_Context
Definition WindowsWindow.h:31
bool VSync
Definition WindowsWindow.h:36
virtual void Shutdown()
Definition WindowsWindow.cpp:150
std::string Title
Definition WindowsWindow.h:34
virtual void * GetNativeWindow() const override
Retrieves the native window handle.
Definition WindowsWindow.h:25
unsigned int Width
Definition WindowsWindow.h:35
Definition WindowsWindow.h:33
The main namespace for the Muto engine.
Definition Application.cpp:15
static bool s_GLFWInitialized
Definition WindowsWindow.cpp:13
static void GLFWErrorCallback(int error, const char *description)
Definition WindowsWindow.cpp:15
Holds the data for window configuration.
Definition Window.h:22
uint32_t Width
Definition Window.h:24
uint32_t Height
Definition Window.h:25
std::string Title
Definition Window.h:23