Updated the FPS Histogram and reorganize some files.
parent
9c3aac4789
commit
b0ee113811
|
@ -51,15 +51,15 @@ add_executable(zeus
|
|||
zeus/mesh/BlockModel.h
|
||||
zeus/engine/TextureAtlas.cpp
|
||||
zeus/engine/TextureAtlas.h
|
||||
zeus/world/World.cpp
|
||||
zeus/world/World.h
|
||||
zeus/game/world/World.cpp
|
||||
zeus/game/world/World.h
|
||||
zeus/blocks/BlockChunk.cpp
|
||||
zeus/blocks/BlockChunk.h
|
||||
zeus/engine/helpers/ArrayTrans3D.h
|
||||
zeus/mesh/MeshChunk.cpp
|
||||
zeus/mesh/MeshChunk.h
|
||||
zeus/world/GameInstance.cpp
|
||||
zeus/world/GameInstance.h
|
||||
zeus/game/GameInstance.cpp
|
||||
zeus/game/GameInstance.h
|
||||
zeus/engine/graphics/Renderer.cpp
|
||||
zeus/engine/graphics/Renderer.h
|
||||
zeus/lua_api/LuaParser.cpp
|
||||
|
@ -70,6 +70,6 @@ add_executable(zeus
|
|||
zeus/engine/graphics/TextBuilder.h
|
||||
zeus/engine/graphics/TextBuilder.cpp
|
||||
zeus/engine/graphics/HudText.cpp
|
||||
zeus/engine/graphics/HudText.h zeus/world/DebugGui.cpp zeus/world/DebugGui.h)
|
||||
zeus/engine/graphics/HudText.h zeus/game/gui/DebugGui.cpp zeus/gui/DebugGui.h)
|
||||
|
||||
target_link_libraries(zeus ${OPENGL_gl_LIBRARY} glfw libGLEW.so pthread lua dl)
|
Binary file not shown.
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 206 B |
|
@ -42,6 +42,9 @@ int Window::initialize() {
|
|||
// glfwWindowHint(GLFW_SAMPLES, 16);
|
||||
// glEnable(GL_MULTISAMPLE);
|
||||
|
||||
//VSync 1 = On, 0 = Off
|
||||
glfwSwapInterval(1);
|
||||
|
||||
//Create the window
|
||||
mainWindow = glfwCreateWindow(width, height, "Zeus_cpp OPENGL Linux x64", nullptr, nullptr);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ Renderer::Renderer(GLint winWidth, GLint winHeight) {
|
|||
camera = new Camera(glm::vec3(0.0f, 16.0f, 0.0f), glm::vec3(0, 1, 0), -90.0f, -45.0f, 10.0f, 0.1f);
|
||||
|
||||
worldShader = new Shader();
|
||||
worldShader->createFromFile("../zeus/shader/world.vs", "../zeus/shader/world.fs");
|
||||
worldShader->createFromFile("../zeus/shader/game.vs", "../zeus/shader/game.fs");
|
||||
|
||||
uProj = worldShader->getUniformLocation("projection");
|
||||
uModel = worldShader->getUniformLocation("model");
|
||||
|
|
|
@ -22,14 +22,14 @@ void GameInstance::initialize(Renderer* renderer) {
|
|||
|
||||
p.doFile("../lua/file.lua");
|
||||
|
||||
//The world requires the blockAtlas for meshing and handling inputs.
|
||||
//The game requires the blockAtlas for meshing and handling inputs.
|
||||
world = new World(blockAtlas);
|
||||
|
||||
renderer->getCamera()->setPosition(glm::vec3(8, 24, 8));
|
||||
|
||||
int SIZE = 10;
|
||||
int SIZE = 8;
|
||||
for (int i = -SIZE; i < SIZE; i++) {
|
||||
for (int j = 0; j < 10; j++) {
|
||||
for (int j = 0; j < 8; j++) {
|
||||
for (int k = -SIZE; k < SIZE; k++) {
|
||||
world->genNewChunk(glm::vec3(i, j, k));
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
#define SRC_GAMEWORLD_H
|
||||
|
||||
|
||||
#include "World.h"
|
||||
#include "world/World.h"
|
||||
#include "../engine/Camera.h"
|
||||
#include "../engine/Window.h"
|
||||
#include "../engine/PerlinNoise.h"
|
||||
|
@ -14,7 +14,7 @@
|
|||
#include "../engine/helpers/ArrayTrans3D.h"
|
||||
#include "../lua_api/LuaParser.h"
|
||||
#include "../engine/graphics/HudText.h"
|
||||
#include "DebugGui.h"
|
||||
#include "../gui/DebugGui.h"
|
||||
|
||||
class GameInstance {
|
||||
public:
|
|
@ -2,7 +2,7 @@
|
|||
// Created by aurailus on 27/12/18.
|
||||
//
|
||||
|
||||
#include "DebugGui.h"
|
||||
#include "../../gui/DebugGui.h"
|
||||
|
||||
DebugGui::DebugGui() {
|
||||
fontTexture = new Texture((char*)"../tex/font.png");
|
||||
|
@ -26,7 +26,7 @@ DebugGui::DebugGui() {
|
|||
|
||||
fpsHistogram = new Entity();
|
||||
fpsHistogram->create(new Mesh(), histogramTexture);
|
||||
fpsHistogram->setPosition(glm::vec3(0, 768, 0));
|
||||
fpsHistogram->setPosition(glm::vec3(8, 764, 0));
|
||||
}
|
||||
|
||||
void DebugGui::pushGuiObjects(std::vector<Entity*> &list) {
|
||||
|
@ -42,8 +42,8 @@ void DebugGui::fpsHistUpdate() {
|
|||
|
||||
unsigned int indOffset = 0;
|
||||
float xOffset = 0;
|
||||
float width = 8;
|
||||
float height = 1;
|
||||
float width = 4;
|
||||
float height = 0.5;
|
||||
float i = 0.10;
|
||||
|
||||
for (double num : fpsHistory) {
|
|
@ -6,8 +6,8 @@
|
|||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||
|
||||
#include "World.h"
|
||||
#include "../engine/PerlinNoise.h"
|
||||
#include "../engine/helpers/ArrayTrans3D.h"
|
||||
#include "../../engine/PerlinNoise.h"
|
||||
#include "../../engine/helpers/ArrayTrans3D.h"
|
||||
|
||||
World::World(BlockAtlas *atlas) {
|
||||
blockAtlas = atlas;
|
||||
|
@ -43,7 +43,7 @@ void World::update() {
|
|||
//Create / Finalize MeshChunks
|
||||
handleMeshGenQueue();
|
||||
|
||||
// world.printElapsedMs();
|
||||
// game.printElapsedMs();
|
||||
}
|
||||
|
||||
int World::getBlock(glm::vec3 pos) {
|
|
@ -13,9 +13,9 @@
|
|||
#include <bits/unordered_map.h>
|
||||
#include <mutex>
|
||||
|
||||
#include "../blocks/BlockChunk.h"
|
||||
#include "../mesh/MeshChunk.h"
|
||||
#include "../blocks/BlockAtlas.h"
|
||||
#include "../../blocks/BlockChunk.h"
|
||||
#include "../../mesh/MeshChunk.h"
|
||||
#include "../../blocks/BlockAtlas.h"
|
||||
|
||||
class World {
|
||||
private:
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
|
||||
#include "../engine/graphics/HudText.h"
|
||||
#include "World.h"
|
||||
#include "../game/world/World.h"
|
||||
#include <sstream>
|
||||
|
||||
class DebugGui {
|
Loading…
Reference in New Issue