loadingscreen has been draw when loading a world
This commit is contained in:
@@ -170,6 +170,7 @@
|
|||||||
<ClCompile Include="lib\serial\src\impl\list_ports\list_ports_win.cc" />
|
<ClCompile Include="lib\serial\src\impl\list_ports\list_ports_win.cc" />
|
||||||
<ClCompile Include="lib\serial\src\impl\win.cc" />
|
<ClCompile Include="lib\serial\src\impl\win.cc" />
|
||||||
<ClCompile Include="lib\serial\src\serial.cc" />
|
<ClCompile Include="lib\serial\src\serial.cc" />
|
||||||
|
<ClCompile Include="LoadingScreen.cpp" />
|
||||||
<ClCompile Include="Main.cpp" />
|
<ClCompile Include="Main.cpp" />
|
||||||
<ClCompile Include="Menu.cpp" />
|
<ClCompile Include="Menu.cpp" />
|
||||||
<ClCompile Include="MenuElement.cpp" />
|
<ClCompile Include="MenuElement.cpp" />
|
||||||
@@ -203,6 +204,7 @@
|
|||||||
<ClInclude Include="lib\serial\include\impl\win.h" />
|
<ClInclude Include="lib\serial\include\impl\win.h" />
|
||||||
<ClInclude Include="lib\serial\include\serial.h" />
|
<ClInclude Include="lib\serial\include\serial.h" />
|
||||||
<ClInclude Include="lib\serial\include\v8stdint.h" />
|
<ClInclude Include="lib\serial\include\v8stdint.h" />
|
||||||
|
<ClInclude Include="LoadingScreen.h" />
|
||||||
<ClInclude Include="Main.h" />
|
<ClInclude Include="Main.h" />
|
||||||
<ClInclude Include="Menu.h" />
|
<ClInclude Include="Menu.h" />
|
||||||
<ClInclude Include="MenuElement.h" />
|
<ClInclude Include="MenuElement.h" />
|
||||||
|
|||||||
@@ -123,6 +123,9 @@
|
|||||||
<ClCompile Include="Util.cpp">
|
<ClCompile Include="Util.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="LoadingScreen.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="World.h">
|
<ClInclude Include="World.h">
|
||||||
@@ -221,6 +224,9 @@
|
|||||||
<ClInclude Include="Util.h">
|
<ClInclude Include="Util.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="LoadingScreen.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="worlds\worlds.json">
|
<None Include="worlds\worlds.json">
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
#include "LoadingScreen.h"
|
||||||
|
#include <GL\freeglut.h>
|
||||||
|
#include "CrystalPoint.h"
|
||||||
|
#include "Util.h"
|
||||||
|
|
||||||
|
LoadingScreen::LoadingScreen()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LoadingScreen::~LoadingScreen()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoadingScreen::draw()
|
||||||
|
{
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glLoadIdentity();
|
||||||
|
glOrtho(0, CrystalPoint::width, CrystalPoint::height, 0, -10, 10);
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glLoadIdentity();
|
||||||
|
|
||||||
|
glDisable(GL_LIGHTING);
|
||||||
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
|
||||||
|
glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glVertex2f(0, 0);
|
||||||
|
glVertex2f(0, CrystalPoint::height);
|
||||||
|
glVertex2f(CrystalPoint::width, CrystalPoint::height);
|
||||||
|
glVertex2f(CrystalPoint::width, 0);
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
glColor4f(1.0f, 1.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
|
Util::glutBitmapString(loading,
|
||||||
|
CrystalPoint::width / 2 - Util::glutTextWidth(loading),
|
||||||
|
CrystalPoint::height / 2 - 7);
|
||||||
|
|
||||||
|
|
||||||
|
glEnable(GL_LIGHTING);
|
||||||
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
glutSwapBuffers();
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class LoadingScreen
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LoadingScreen();
|
||||||
|
~LoadingScreen();
|
||||||
|
|
||||||
|
void draw();
|
||||||
|
|
||||||
|
private:
|
||||||
|
const std::string loading = "Loading...";
|
||||||
|
};
|
||||||
|
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
World::World(const std::string &fileName)
|
World::World(const std::string &fileName)
|
||||||
{
|
{
|
||||||
|
ls.draw();
|
||||||
nextworld = false;
|
nextworld = false;
|
||||||
|
|
||||||
//Store player instance
|
//Store player instance
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "Skybox.h"
|
#include "Skybox.h"
|
||||||
#include "CrystalPoint.h"
|
#include "CrystalPoint.h"
|
||||||
#include "Portal.h"
|
#include "Portal.h"
|
||||||
|
#include "LoadingScreen.h"
|
||||||
|
|
||||||
class Entity;
|
class Entity;
|
||||||
|
|
||||||
@@ -32,6 +33,8 @@ private:
|
|||||||
std::vector<Entity*> entities;
|
std::vector<Entity*> entities;
|
||||||
std::vector<Enemy*> enemies;
|
std::vector<Enemy*> enemies;
|
||||||
//std::vector<Crystal*> crystals;
|
//std::vector<Crystal*> crystals;
|
||||||
|
|
||||||
|
LoadingScreen ls;
|
||||||
public:
|
public:
|
||||||
World(const std::string &fileName);
|
World(const std::string &fileName);
|
||||||
~World();
|
~World();
|
||||||
|
|||||||
Reference in New Issue
Block a user