Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
qpong
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Co
qpong
Commits
f187f9fb
Commit
f187f9fb
authored
4 years ago
by
Armin Co
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring
parent
270a0488
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
App/QPongApp.cpp
+2
-7
2 additions, 7 deletions
App/QPongApp.cpp
App/Window.hpp
+0
-4
0 additions, 4 deletions
App/Window.hpp
GuiCore/Application.cpp
+5
-2
5 additions, 2 deletions
GuiCore/Application.cpp
with
7 additions
and
13 deletions
App/QPongApp.cpp
+
2
−
7
View file @
f187f9fb
...
...
@@ -3,17 +3,15 @@
///
#include
<memory>
#include
<GuiCore/Application.hpp>
#include
"MainMenuLayer.hpp"
#include
"GameLayer.hpp"
#include
"Log.hpp"
class
App
:
public
GuiCore
::
Application
{
public:
App
()
:
Application
(
"QPong Application"
)
App
()
:
Application
(
"QPong Application"
)
{
QPong
::
Log
::
setup
();
pushLayer
(
std
::
make_shared
<
QPong
::
MainMenuLayer
>
());
...
...
@@ -23,9 +21,6 @@ public:
int
main
()
{
std
::
unique_ptr
<
App
>
app
=
std
::
make_unique
<
App
>
();
QPong
::
Log
::
get
()
->
info
(
"Have fun!"
);
app
->
run
();
return
0
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
App/Window.hpp
+
0
−
4
View file @
f187f9fb
...
...
@@ -18,14 +18,11 @@ public:
virtual
~
Window
();
void
onUpdate
()
override
;
uint32_t
getWidth
()
const
override
;
uint32_t
getHeight
()
const
override
;
virtual
void
setEventCallback
(
const
std
::
function
<
void
(
GuiCore
::
Event
&
)
>
)
override
;
void
setVSync
(
bool
enabled
)
override
;
bool
isVSyncEnabled
()
const
override
;
void
*
getNativeWindow
()
const
override
;
private:
...
...
@@ -40,7 +37,6 @@ private:
uint32_t
width
;
uint32_t
height
;
bool
vSyncEnabled
;
std
::
function
<
void
(
GuiCore
::
Event
&
)
>
eventCallback
;
};
Data
m_data
;
...
...
This diff is collapsed.
Click to expand it.
GuiCore/Application.cpp
+
5
−
2
View file @
f187f9fb
...
...
@@ -19,8 +19,11 @@ namespace GuiCore
Log
::
setup
();
s_instance
=
this
;
m_window
=
std
::
unique_ptr
<
IWindow
>
(
IWindow
::
create
({
name
,
width
,
height
}));
m_window
->
setEventCallback
([
this
](
auto
&&
...
args
)
->
decltype
(
auto
)
{
return
this
->
onEvent
(
std
::
forward
<
decltype
(
args
)
>
(
args
)...);
});
m_window
->
setEventCallback
(
[
this
](
auto
&&
...
args
)
->
decltype
(
auto
)
{
return
this
->
onEvent
(
std
::
forward
<
decltype
(
args
)
>
(
args
)...);
});
m_guiLayer
=
std
::
make_shared
<
ImGuiLayer
>
();
pushLayer
(
m_guiLayer
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment