File tree 7 files changed +18
-18
lines changed
7 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ namespace GLCore {
13
13
14
14
Application* Application::s_Instance = nullptr ;
15
15
16
- Application::Application ()
16
+ Application::Application (const std::string& name, uint32_t width, uint32_t height )
17
17
{
18
18
if (!s_Instance)
19
19
{
@@ -24,7 +24,7 @@ namespace GLCore {
24
24
GLCORE_ASSERT (!s_Instance, " Application already exists!" );
25
25
s_Instance = this ;
26
26
27
- m_Window = std::unique_ptr<Window>(Window::Create ());
27
+ m_Window = std::unique_ptr<Window>(Window::Create ({ name, width, height } ));
28
28
m_Window->SetEventCallback (BIND_EVENT_FN (OnEvent));
29
29
30
30
// Renderer::Init();
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ namespace GLCore {
16
16
class Application
17
17
{
18
18
public:
19
- Application ();
19
+ Application (const std::string& name = " OpenGL Sandbox " , uint32_t width = 1280 , uint32_t height = 720 );
20
20
virtual ~Application () = default ;
21
21
22
22
void Run ();
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ namespace GLCore {
22
22
std::vector<Layer*>::iterator end () { return m_Layers.end (); }
23
23
private:
24
24
std::vector<Layer*> m_Layers;
25
- unsigned int m_LayerInsertIndex = 0 ;
25
+ uint32_t m_LayerInsertIndex = 0 ;
26
26
};
27
27
28
28
}
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ namespace GLCore {
10
10
struct WindowProps
11
11
{
12
12
std::string Title;
13
- unsigned int Width;
14
- unsigned int Height;
13
+ uint32_t Width;
14
+ uint32_t Height;
15
15
16
16
WindowProps (const std::string& title = " OpenGL Sandbox" ,
17
- unsigned int width = 1280 ,
18
- unsigned int height = 720 )
17
+ uint32_t width = 1280 ,
18
+ uint32_t height = 720 )
19
19
: Title(title), Width(width), Height(height)
20
20
{
21
21
}
@@ -31,8 +31,8 @@ namespace GLCore {
31
31
32
32
virtual void OnUpdate () = 0;
33
33
34
- virtual unsigned int GetWidth () const = 0;
35
- virtual unsigned int GetHeight () const = 0;
34
+ virtual uint32_t GetWidth () const = 0;
35
+ virtual uint32_t GetHeight () const = 0;
36
36
37
37
// Window attributes
38
38
virtual void SetEventCallback (const EventCallbackFn& callback) = 0;
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ namespace GLCore {
7
7
class WindowResizeEvent : public Event
8
8
{
9
9
public:
10
- WindowResizeEvent (unsigned int width, unsigned int height)
10
+ WindowResizeEvent (uint32_t width, uint32_t height)
11
11
: m_Width(width), m_Height(height) {}
12
12
13
- inline unsigned int GetWidth () const { return m_Width; }
14
- inline unsigned int GetHeight () const { return m_Height; }
13
+ inline uint32_t GetWidth () const { return m_Width; }
14
+ inline uint32_t GetHeight () const { return m_Height; }
15
15
16
16
std::string ToString () const override
17
17
{
@@ -23,7 +23,7 @@ namespace GLCore {
23
23
EVENT_CLASS_TYPE (WindowResize)
24
24
EVENT_CLASS_CATEGORY (EventCategoryApplication)
25
25
private:
26
- unsigned int m_Width, m_Height;
26
+ uint32_t m_Width, m_Height;
27
27
};
28
28
29
29
class WindowCloseEvent : public Event
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ namespace GLCore {
105
105
}
106
106
});
107
107
108
- glfwSetCharCallback (m_Window, [](GLFWwindow* window, unsigned int keycode)
108
+ glfwSetCharCallback (m_Window, [](GLFWwindow* window, uint32_t keycode)
109
109
{
110
110
WindowData& data = *(WindowData*)glfwGetWindowUserPointer (window);
111
111
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ namespace GLCore {
14
14
15
15
void OnUpdate () override ;
16
16
17
- inline unsigned int GetWidth () const override { return m_Data.Width ; }
18
- inline unsigned int GetHeight () const override { return m_Data.Height ; }
17
+ inline uint32_t GetWidth () const override { return m_Data.Width ; }
18
+ inline uint32_t GetHeight () const override { return m_Data.Height ; }
19
19
20
20
// Window attributes
21
21
inline void SetEventCallback (const EventCallbackFn& callback) override { m_Data.EventCallback = callback; }
@@ -32,7 +32,7 @@ namespace GLCore {
32
32
struct WindowData
33
33
{
34
34
std::string Title;
35
- unsigned int Width, Height;
35
+ uint32_t Width, Height;
36
36
bool VSync;
37
37
38
38
EventCallbackFn EventCallback;
You can’t perform that action at this time.
0 commit comments