Complete main menu without event bindings.

This commit is contained in:
2015-09-25 01:26:47 +02:00
parent b83de44715
commit 5f1963b8bc
40 changed files with 627 additions and 496 deletions
+3 -24
View File
@@ -54,6 +54,7 @@
#include "GUI/Frame.h"
#include "GUI/Button.h"
#include "Game/MainMenu.h"
namespace dd
{
@@ -73,24 +74,7 @@ public:
m_FrameStack = new GUI::Frame(m_EventBroker.get());
m_FrameStack->Width = 1920;
m_FrameStack->Height = 1080;
{
auto button = new GUI::Button(m_FrameStack, "SuperButt");
button->TextureReleased = "Textures/Test/TestBrick_Specular.png";
button->TexturePressed = "Textures/Test/TestBrick_Normal.png";
button->TextureHover = "Textures/Test/TestBrick_Diffuse.png";
button->X = 50;
button->Y = 75;
button->Width = 100;
button->Height = 25;
}
{
auto button = new GUI::TextureFrame(m_FrameStack, "BALLZ");
button->SetTexture("Textures/Ball.png");
button->X = 50;
button->Y = 75;
button->Width = 100;
button->Height = 100;
}
auto menu = new GUI::MainMenu(m_FrameStack, "MainMenu");
m_InputManager = std::make_shared<InputManager>(m_Renderer->Window(), m_EventBroker);
@@ -265,7 +249,7 @@ public:
// Update input
m_InputManager->Update(dt);
// Swap event queues to get fresh input data in the read queue
m_EventBroker->Swap();
//m_EventBroker->Swap();
ResourceManager::Update();
@@ -273,11 +257,6 @@ public:
m_EventBroker->Process<GUI::Frame>();
m_FrameStack->UpdateLayered(dt);
//
// if (glfwGetKey(m_Renderer->Window(), GLFW_KEY_R)) {
// ResourceManager::Reload("Shaders/Deferred/3/Fragment.glsl");
// }
if (glfwGetKey(m_Renderer->Window(), GLFW_KEY_R)) {
ResourceManager::Reload("Shaders/Deferred/3/Fragment.glsl");
}
-3
View File
@@ -33,9 +33,6 @@ class PNG : public Image
public:
PNG(std::string path);
~PNG();
private:
};
}
+5 -4
View File
@@ -122,6 +122,7 @@ struct FrameJob : SpriteJob
{
Rectangle Scissor;
Rectangle Viewport;
std::string Name;
void CalculateHash() override
{
@@ -136,7 +137,7 @@ public:
void Add(T &job)
{
job.CalculateHash();
Jobs.push_front(std::shared_ptr<T>(new T(job)));
Jobs.push_back(std::shared_ptr<T>(new T(job)));
}
void Sort()
@@ -149,17 +150,17 @@ public:
Jobs.clear();
}
std::forward_list<std::shared_ptr<RenderJob>>::const_iterator begin()
std::list<std::shared_ptr<RenderJob>>::const_iterator begin()
{
return Jobs.begin();
}
std::forward_list<std::shared_ptr<RenderJob>>::const_iterator end()
std::list<std::shared_ptr<RenderJob>>::const_iterator end()
{
return Jobs.end();
}
std::forward_list<std::shared_ptr<RenderJob>> Jobs;
std::list<std::shared_ptr<RenderJob>> Jobs;
};
struct RenderQueueCollection
+3
View File
@@ -43,6 +43,9 @@ public:
operator GLuint() const { return m_Texture; }
unsigned int Width = 0;
unsigned int Height = 0;
private:
GLuint m_Texture = 0;
};
+6 -6
View File
@@ -44,24 +44,24 @@ struct Rectangle
int Height;
virtual int Left() const { return X; }
void SetLeft(int left)
virtual void SetLeft(int left)
{
Width += X - left;
//Width += X - left;
X = left;
}
virtual int Right() const { return X + Width; }
void SetRight(int right)
virtual void SetRight(int right)
{
Width = right - X;
}
virtual int Top() const { return Y; }
void SetTop(int top)
virtual void SetTop(int top)
{
Height += Y - top;
//Height += Y - top;
Y = top;
}
virtual int Bottom() const { return Y + Height; }
int SetBottom(int bottom)
virtual void SetBottom(int bottom)
{
Height = bottom - Y;
}