From fc7b4579e49aaeecc81919e247e03f68bd5abfd4 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 18 Nov 2018 22:32:55 +0800 Subject: =?UTF-8?q?*=E7=B2=92=E5=AD=90=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Game/je_application.cpp | 12 +++++++----- src/libjin/Game/je_entity.h | 4 ++-- src/libjin/Game/je_gameobject.h | 9 +++------ 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src/libjin/Game') diff --git a/src/libjin/Game/je_application.cpp b/src/libjin/Game/je_application.cpp index a5a8812..723a809 100644 --- a/src/libjin/Game/je_application.cpp +++ b/src/libjin/Game/je_application.cpp @@ -6,20 +6,21 @@ #include "../time/je_timer.h" #include "../input/je_event.h" #include "../graphics/je_window.h" +#include "../graphics/je_gl.h" #include "../math/je_math.h" #include "je_application.h" +using namespace JinEngine::Graphics; +using namespace JinEngine::Input; +using namespace JinEngine::Time; +using namespace JinEngine::Math; + namespace JinEngine { namespace Game { - using namespace JinEngine::Graphics; - using namespace JinEngine::Input; - using namespace JinEngine::Time; - using namespace JinEngine::Math; - Application::Application() :_running(true) {}; /* default game loop */ @@ -49,6 +50,7 @@ namespace JinEngine dt = current - previous; if (_onUpdate != nullptr) _onUpdate(dt); + glClear(GL_COLOR_BUFFER_BIT); if (_onDraw != nullptr) _onDraw(); wnd->swapBuffers(); diff --git a/src/libjin/Game/je_entity.h b/src/libjin/Game/je_entity.h index 39822b6..80c6ff3 100644 --- a/src/libjin/Game/je_entity.h +++ b/src/libjin/Game/je_entity.h @@ -7,7 +7,7 @@ namespace JinEngine { namespace Game { - +/* /// /// /// @@ -20,7 +20,7 @@ namespace JinEngine }; - +*/ } // namespace Game } // namespace JinEngine diff --git a/src/libjin/Game/je_gameobject.h b/src/libjin/Game/je_gameobject.h index fefc6df..7c6ec2b 100644 --- a/src/libjin/Game/je_gameobject.h +++ b/src/libjin/Game/je_gameobject.h @@ -16,7 +16,7 @@ namespace JinEngine { namespace Game { - + /* /// /// Game object base class. /// @@ -61,10 +61,7 @@ namespace JinEngine bool mIsVisible; // if the entity is visible or not bool mIsActive; // if the entity is joined into the logic - /// - /// Position of entity. - /// - Math::Vector2 mPosition; + Math::Transform mTransform; }; @@ -77,7 +74,7 @@ namespace JinEngine /// Entity set. For searching and keeps entities unique and sorted. /// typedef std::set EntitySet; - + */ } // namespace Game } // namespace JinEngine -- cgit v1.1-26-g67d0