Karma Engine
Loading...
Searching...
No Matches
Karma
src
Platform
Linux
LinuxWindow.h
1
#pragma once
2
3
#include "Karma/Window.h"
4
5
struct
GLFWwindow;
6
7
namespace
Karma
8
{
9
class
GraphicsContext;
10
11
class
LinuxWindow
:
public
Window
12
{
13
public
:
14
LinuxWindow
(
const
WindowProps
& props);
15
virtual
~LinuxWindow
();
16
17
void
OnUpdate()
override
;
18
virtual
bool
OnResize(
WindowResizeEvent
& event)
override
;
19
20
inline
unsigned
int
GetWidth()
const override
{
return
m_Data.Width; }
21
inline
unsigned
int
GetHeight()
const override
{
return
m_Data.Height; }
22
23
inline
void
SetEventCallback(
const
EventCallbackFn& callback)
override
24
{
25
m_Data.EventCallback = callback;
26
}
27
inline
virtual
void
* GetNativeWindow()
const override
{
return
m_Window; }
28
29
void
SetVSync(
bool
enabled)
override
;
30
bool
IsVSync()
const override
;
31
32
private
:
33
void
Init(
const
WindowProps
& props);
34
35
void
SetGLFWCallbacks(GLFWwindow* glfwWindow);
36
void
ShutDown();
37
38
GLFWwindow* m_Window;
39
GraphicsContext
* m_Context;
40
41
struct
WindowData
42
{
43
std::string Title;
44
unsigned
int
Width, Height;
45
bool
VSync;
46
47
EventCallbackFn EventCallback;
48
};
49
50
WindowData m_Data;
51
};
52
}
Karma::GraphicsContext
Definition
GraphicsContext.h:8
Karma::LinuxWindow
Definition
LinuxWindow.h:12
Karma::WindowResizeEvent
Definition
ApplicationEvent.h:10
Karma::Window
Definition
Window.h:27
Karma::WindowProps
Definition
Window.h:12
Generated by
1.12.0